Catch broken file path imports and missing named exports during development before your app crashes at runtime.
Enforce a consistent, readable order for all import statements across your entire JavaScript or TypeScript project.
Prevent circular dependencies between files that can cause hard-to-debug loading errors.
Flag packages used in code but missing from your package.json dependencies list.
Install via npm, add plugin to your ESLint config, and extend the recommended preset. A TypeScript config preset is included for TS projects.
eslint-plugin-import is an add-on for ESLint, a tool that checks JavaScript code for problems while you write it. This plugin focuses specifically on the import and export statements that modern JavaScript uses to share code between files. It adds a collection of rules that catch mistakes your editor would not otherwise flag, before those mistakes reach a running application. The most practical rules handle things like typos in file paths, importing a named export that does not actually exist in the source file, and importing packages that are not listed in your project's dependencies. These are errors that tend to appear only at runtime without this kind of static analysis, and they can be confusing to trace back to the source. A second category of rules covers code organization. The plugin can enforce a consistent order for import statements at the top of a file, require a blank line between third-party imports and your own project files, forbid duplicate imports of the same module, and prevent circular dependencies, where file A imports from file B while file B also imports from file A. There is also a group of rules about module system consistency. Projects that are migrating from older CommonJS-style code to modern ES module syntax can use these rules to flag mixed usage, such as a file that uses both require() and import at the same time. Installation involves adding the package from npm and referencing it in your ESLint configuration file. Most rules can be turned on or off individually, and the plugin ships with a recommended configuration that enables a sensible starting set. It works with JavaScript and TypeScript projects and includes a typescript configuration preset for TypeScript users.
← import-js on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.