eslint-plugin-import validates ES2015 import and export syntax, resolves module paths, and enforces ordering and dependency boundaries in JavaScript and TypeScript projects.
Overview
eslint-plugin-import extends ESLint with rules that understand static import and export syntax introduced in ES2015. It helps catch misspelled paths, unresolved modules, invalid exports, dependency cycles, and style issues such as duplicate imports or namespace misuse.
Rule groups cover helpful warnings, module system restrictions, static analysis like no-unresolved and no-cycle, and stylistic ordering with import/order. Flat and legacy eslintrc configs load preset bundles; TypeScript projects pair it with eslint-import-resolver-typescript.
Pluggable resolvers adapt resolution to webpack aliases, Node semantics, or custom loaders. Settings tune extensions, externals folders in monorepos, and ignore patterns for asset imports.
Teams enable it alongside eslint-plugin-node or framework presets to keep large codebases consistent about how files reference each other.
Key features
- Unresolved import detection
- Export and namespace validation
- Dependency cycle checking
- Configurable import ordering
- Webpack and Node resolvers
- Flat and eslintrc presets
- TypeScript resolver integration
- Extraneous dependency checks
Use cases
- Catch broken import paths in CI
- Enforce import sort conventions
- Block CommonJS in packages
- Guard monorepo package boundaries