dev-resources.site
for different kinds of informations.
Eslint rule to restrict imports
Published at
12/18/2022
Categories
eslint
linting
javascript
lodash
Author
kzuraw
Author
6 person written this
kzuraw
open
I recently learned that there is a way to restrict imports of certain libraries in Eslint. This is useful for example when you want to restrict the use of a certain library. For example, you might want to restrict the use of lodash.js in your codebase. You can do this by adding the following rule to your Eslint config:
rules: {
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'lodash',
message: 'Please use the native implementation instead.',
},
],
},
],
},
linting Article's
30 articles in total
How to Configure VSCode for Auto Formatting and Linting in Python
read article
Level Up Your OpenAPI Specs using Linting
read article
Most elemental code formatting for Typescript/Javascript: .editorconfig vs prettier
read article
standardrb, but more
read article
Introducing Japr - The Project Linter
read article
Level Up Your TypeScript Projects: Discover the Power of ESLint and Prettier
read article
Interview with Greg Molnar - Rails developer and penetration tester
read article
Setting WordPress Coding Standards per project using Composer
read article
Linting Proto Files With Buf
read article
ESLint: The Hows, Whys, and Who Behind It
read article
Puppet-lint: Soft dependency conflicts after updating
read article
Eslint rule to restrict imports
currently reading
Laravel Tooling: 4 tools for static analysis
read article
Terraform: Variable validation with samples
read article
An Incremental Approach to Linting to Your Projects
read article
Add EsLint to existing Angular Project and Configure WebStorm
read article
Quick ESLint guide + VsCode ESLint on save
read article
Chickity-check yo self before you wreck yo self!
read article
How to configure Eslint in Gatsby projects
read article
Automatically sorting your Tailwind CSS class names
read article
Setting up ESLint + Prettier
read article
Incrementally adding Stylelint rules with Betterer
read article
Conventional Git Commit Messages and Linting
read article
ยฟQuรฉ es Linting y ESLint?
read article
My 2020 Python linting setup: How I Learned to Stop Worrying and Love the automated code formatting
read article
ESLint not working in VSCode? Help build a troubleshooting checklist!
read article
SERIES: React Native (Step by Step) - Working with Typescript and Linting
read article
Adding Markdown Linting to my Blogโs Build Process with GitHub Actions and markdownlint
read article
TIL - ๐งน unimport linter formatter
read article
Adding New Lint Rules Without the Fuss
read article
Featured ones: