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.',
},
],
},
],
},
lodash Article's
30 articles in total
lodash._merge vs Defu
read article
Lodash - a javascript power tool
read article
Learn Lodash _.drop - Creates a slice of array with n elements dropped from the beginning.
read article
Reducing Bundle size of a Frontend application by optimizing Lodash imports
read article
How to Use Lodash with Vue In short
read article
Force Lodash Import Scope
read article
Useful Lodash Methods
read article
Why Lodash?
read article
Eslint rule to restrict imports
currently reading
Lodash Debounce
read article
Type Safe GroupBy In TypeScript
read article
15 useful Lodash methods for everyday coding
read article
A very simple introduction to Functional Programming
read article
How to use Lodash debounce method?
read article
Lodash: _.isEmpty() - Check falsy values
read article
JavaScript - Some very useful lodash/fp functions
read article
setState in useEffect loops the application
read article
Making lodash function get type safe
read article
Lodash pour JS
read article
Functional composition and lodash
read article
Lighter LoDash Builds for Laravel
read article
JavaScript Utility Libraries
read article
NodeJS Module: Lodash
read article
Lodash import - done Right!
read article
Shortcut to use lodash library
read article
Building APIs with Json-Server, Faker and Lodash
read article
Lodash chaining alternative
read article
Debouncing (lodash) with React
read article
Use lodash.debounce inside a function component in React
read article
Beware of Mutation in Spread & React Hooks and How Can You Fix It
read article
Featured ones: