1.1.3 • Published 5 years ago
eslint-plugin-import-root v1.1.3
eslint-plugin-import-root
Checks all imports are inside the project scope.
Installation
You'll first need to install ESLint:
$ npm i eslint --save-devNext, install eslint-plugin-import-root:
$ npm install eslint-plugin-import-root --save-devNote: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-import-root globally.
Usage
Add import-root to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
"plugins": [
"import-root"
]
}Then configure the rules you want to use under the rules section.
{
"rules": {
"import-root/no-external": "error",
"import-root/no-absolute": "error"
}
}Supported Rules
- import-root/no-external Disallow relative paths leading outside of the directory containing the package.json file.
- import-root/no-absolute Disallow all absolute imports (starting with a /).