eslint-plugin-restrict-imports
Eslint plugin to ban specified imports in specified directories
This is useful to ban not using a barrelled import in multi-package repositories.
Installation
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-restrict-imports
:
$ npm install eslint-plugin-restrict-imports --save-dev
Usage
Add restrict-imports
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
Then configure the rules you want to use under the rules section.
Rule configuration:
Default Rule configuration:
Supported Rules
- restrict-imports - Ban imports from a location in any directory.