ESLint rules that validate imports and exports
open sourceMITfree
eslint-plugin-import is an ESLint plugin with rules for ES2015+ import and export syntax. It catches misspelled file paths and import names, unresolved modules, imports of undeclared dependencies, cycles, duplicate imports and invalid exports, and enforces style such as import order, grouping and file extensions. Many rules fix themselves with ESLint's --fix. It ships recommended, errors, warnings and TypeScript configurations, and finds modules through pluggable resolvers (Node.js, webpack, TypeScript).
Problems it solves
- catch imports of files or names that don't exist before the code runs
- enforce a consistent import order in a JavaScript or TypeScript codebase
- find circular dependencies between my modules
- stop code from importing packages that aren't in package.json
Features
- unresolved import and named export checks
- import order and grouping rules
- cycle detection
- undeclared and extraneous dependency checks
- auto-fixable rules
- recommended and TypeScript configurations
- pluggable module resolvers
Alternatives
The same job
These do what eslint-plugin-import does.
- ESLint Find and fix problems in your JavaScript code.
