1.1.3 • Published 4 years ago

eslint-plugin-import-root v1.1.3

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

eslint-plugin-import-root

Checks all imports are inside the project scope.

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-import-root:

$ npm install eslint-plugin-import-root --save-dev

Note: 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 /).
1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago

0.0.0

4 years ago