eslint-plugin-import
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
array-includes | 3.1.8 | 25.71 kB | MIT | prod | |
array.prototype.findlastindex | 1.2.5 | 28.69 kB | MIT | prod | |
array.prototype.flat | 1.3.2 | 6.64 kB | MIT | prod | |
array.prototype.flatmap | 1.3.2 | 6.72 kB | MIT | prod | |
debug | 3.2.7 | 16.48 kB | MIT | prod | |
doctrine | 2.1.0 | 21.74 kB | Apache-2.0 | prod | |
eslint-import-resolver-node | 0.3.9 | 2.42 kB | MIT | prod peer | |
eslint-module-utils | 2.8.1 | 49.9 kB | MIT | prod | |
eslint | 8.57.0 | 2.9 MB | MIT | prod peer | |
hasown | 2.0.2 | 8.56 kB | MIT | prod | |
is-core-module | 2.13.1 | 9.05 kB | MIT | prod | |
is-glob | 4.0.3 | 4.16 kB | MIT | prod | |
minimatch | 3.1.2 | 11.66 kB | ISC | prod | |
object.fromentries | 2.0.8 | 15.94 kB | MIT | prod | |
object.groupby | 1.0.3 | 14.24 kB | MIT | prod | |
object.values | 1.2.0 | 30.78 kB | MIT | prod | |
semver | 6.3.1 | 18.65 kB | ISC | prod | |
tsconfig-paths | 3.15.0 | 43.02 kB | MIT | prod |
ESLint-plugin-import is a tool that helps in linting the syntax of ES2015+ (ES6+) import/export in your JavaScript files. It aims to prevent issues related to the misspelling of file paths or import names which could arise while using ES2015 + static module syntax. This plugin ensures that all your imports are correctly spelled, exist as files or modules, and that only named exports from named files are imported.
To use ESLint-plugin-import, you must first install it via npm by running the following command in the terminal:
npm install eslint-plugin-import --save-dev
After the plugin is installed, you can start using it by adding it to your ESLint configuration, either manually or by extending the canned configurations that come with the plugin. Here's an example of manual configuration in your .eslintrc.(yml|json|js)
file:
plugins:
- import
rules:
import/no-unresolved: [2, {commonjs: true, amd: true}]
import/named: 2
import/namespace: 2
import/default: 2
import/export: 2
# etc...
You can also extend the canned configurations like this:
extends:
- eslint:recommended
- plugin:import/recommended
Both of these configurations will enable ESLint-plugin-import and allow it to start warning you about any potential import/export issues in your code.
You can find the entire documentation of ESLint-plugin-import on its GitHub pages. The documentation provides a thorough explanation of the library's features, configurations, and the different rules it has for linting import/export syntax. It is helpful for developers that want to learn more about the internals of the library and how to efficiently utilize it to prevent import/export errors.