{"id":13484114,"url":"https://github.com/import-js/eslint-plugin-import","last_synced_at":"2025-09-09T20:21:26.220Z","repository":{"id":28717464,"uuid":"32238354","full_name":"import-js/eslint-plugin-import","owner":"import-js","description":"ESLint plugin with rules that help validate proper imports.","archived":false,"fork":false,"pushed_at":"2025-06-20T21:59:00.000Z","size":4069,"stargazers_count":5809,"open_issues_count":585,"forks_count":1547,"subscribers_count":37,"default_branch":"main","last_synced_at":"2025-09-08T20:19:07.526Z","etag":null,"topics":["code-quality","eslint","eslint-plugin","hacktoberfest","import","javascript","lint","linting"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/import-js.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["import-js","ljharb"],"patreon":null,"open_collective":"eslint-plugin-import","ko_fi":null,"tidelift":"npm/eslint-plugin-import","community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2015-03-15T00:21:57.000Z","updated_at":"2025-09-08T06:53:18.000Z","dependencies_parsed_at":"2024-03-05T15:10:13.007Z","dependency_job_id":"98128dfc-b039-450b-aa6b-947e77fb7dae","html_url":"https://github.com/import-js/eslint-plugin-import","commit_stats":{"total_commits":2101,"total_committers":391,"mean_commits":5.373401534526854,"dds":0.6025702046644454,"last_synced_commit":"fa36d4983c03f1e3a63c3cd555ea2fb34adc0a86"},"previous_names":["benmosher/eslint-plugin-import"],"tags_count":224,"template":false,"template_full_name":null,"purl":"pkg:github/import-js/eslint-plugin-import","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/import-js%2Feslint-plugin-import","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/import-js%2Feslint-plugin-import/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/import-js%2Feslint-plugin-import/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/import-js%2Feslint-plugin-import/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/import-js","download_url":"https://codeload.github.com/import-js/eslint-plugin-import/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/import-js%2Feslint-plugin-import/sbom","scorecard":{"id":233290,"data":{"date":"2025-08-11","repo":{"name":"github.com/import-js/eslint-plugin-import","commit":"01c9eb04331d2efa8d63f2d7f4bfec3bc44c94f3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":6.1,"checks":[{"name":"Code-Review","score":6,"reason":"Found 19/30 approved changesets -- score normalized to 6","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":10,"reason":"6 commit(s) and 12 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'pull-requests' permission set to 'read': .github/workflows/require-allow-edits.yml:11","Info: topLevel 'contents' permission set to 'read': .github/workflows/eslint-8+.yml:10","Info: topLevel 'contents' permission set to 'read': .github/workflows/eslint-old.yml:10","Warn: no topLevel permission defined: .github/workflows/native-wsl.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/node-pretest.yml:6","Info: topLevel 'contents' permission set to 'read': .github/workflows/packages.yml:10","Warn: no topLevel permission defined: .github/workflows/rebase.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/require-allow-edits.yml:6","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/eslint-8+.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/import-js/eslint-plugin-import/eslint-8+.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/eslint-8+.yml:50: update your workflow using https://app.stepsecurity.io/secureworkflow/import-js/eslint-plugin-import/eslint-8+.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/eslint-8+.yml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/import-js/eslint-plugin-import/eslint-8+.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/eslint-8+.yml:62: update your workflow using https://app.stepsecurity.io/secureworkflow/import-js/eslint-plugin-import/eslint-8+.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/eslint-old.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/import-js/eslint-plugin-import/eslint-old.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/eslint-old.yml:91: update your workflow using https://app.stepsecurity.io/secureworkflow/import-js/eslint-plugin-import/eslint-old.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/eslint-old.yml:92: update your workflow using https://app.stepsecurity.io/secureworkflow/import-js/eslint-plugin-import/eslint-old.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/eslint-old.yml:105: update your workflow using https://app.stepsecurity.io/secureworkflow/import-js/eslint-plugin-import/eslint-old.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/native-wsl.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/import-js/eslint-plugin-import/native-wsl.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/native-wsl.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/import-js/eslint-plugin-import/native-wsl.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/native-wsl.yml:149: update your workflow using https://app.stepsecurity.io/secureworkflow/import-js/eslint-plugin-import/native-wsl.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node-pretest.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/import-js/eslint-plugin-import/node-pretest.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/node-pretest.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/import-js/eslint-plugin-import/node-pretest.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node-pretest.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/import-js/eslint-plugin-import/node-pretest.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/node-pretest.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/import-js/eslint-plugin-import/node-pretest.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/packages.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/import-js/eslint-plugin-import/packages.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/packages.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/import-js/eslint-plugin-import/packages.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/packages.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/import-js/eslint-plugin-import/packages.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/packages.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/import-js/eslint-plugin-import/packages.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/rebase.yml:7: update your workflow using https://app.stepsecurity.io/secureworkflow/import-js/eslint-plugin-import/rebase.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/require-allow-edits.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/import-js/eslint-plugin-import/require-allow-edits.yml/main?enable=pin","Warn: npmCommand not pinned by hash: tests/dep-time-travel.sh:14","Warn: npmCommand not pinned by hash: tests/dep-time-travel.sh:18","Warn: npmCommand not pinned by hash: tests/dep-time-travel.sh:23","Warn: npmCommand not pinned by hash: tests/dep-time-travel.sh:25","Warn: npmCommand not pinned by hash: tests/dep-time-travel.sh:31","Warn: npmCommand not pinned by hash: tests/dep-time-travel.sh:34","Warn: npmCommand not pinned by hash: tests/dep-time-travel.sh:37","Warn: npmCommand not pinned by hash: tests/dep-time-travel.sh:43","Warn: npmCommand not pinned by hash: tests/dep-time-travel.sh:49","Warn: npmCommand not pinned by hash: .github/workflows/node-pretest.yml:32","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of  15 third-party GitHubAction dependencies pinned","Info:   0 out of  10 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 19 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T05:11:47.221Z","repository_id":28717464,"created_at":"2025-08-17T05:11:47.222Z","updated_at":"2025-08-17T05:11:47.222Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274231453,"owners_count":25245659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-quality","eslint","eslint-plugin","hacktoberfest","import","javascript","lint","linting"],"created_at":"2024-07-31T17:01:19.562Z","updated_at":"2025-09-09T20:21:26.181Z","avatar_url":"https://github.com/import-js.png","language":"JavaScript","readme":"# eslint-plugin-import\n\n[![github actions][actions-image]][actions-url]\n[![travis-ci](https://travis-ci.org/import-js/eslint-plugin-import.svg?branch=main)](https://travis-ci.org/import-js/eslint-plugin-import)\n[![coverage][codecov-image]][codecov-url]\n[![win32 build status](https://ci.appveyor.com/api/projects/status/3mw2fifalmjlqf56/branch/main?svg=true)](https://ci.appveyor.com/project/import-js/eslint-plugin-import/branch/main)\n[![npm](https://img.shields.io/npm/v/eslint-plugin-import.svg)](https://www.npmjs.com/package/eslint-plugin-import)\n[![npm downloads](https://img.shields.io/npm/dt/eslint-plugin-import.svg?maxAge=2592000)](https://www.npmtrends.com/eslint-plugin-import)\n\nThis plugin intends to support linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import names. All the goodness that the ES2015+ static module syntax intends to provide, marked up in your editor.\n\n**IF YOU ARE USING THIS WITH SUBLIME**: see the [bottom section](#sublimelinter-eslint) for important info.\n\n## Rules\n\n\u003c!-- begin auto-generated rules list --\u003e\n\n💼 Configurations enabled in.\\\n⚠️ Configurations set to warn in.\\\n🚫 Configurations disabled in.\\\n❗ Set in the `errors` configuration.\\\n☑️ Set in the `recommended` configuration.\\\n⌨️ Set in the `typescript` configuration.\\\n🚸 Set in the `warnings` configuration.\\\n🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\\\n💡 Manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).\\\n❌ Deprecated.\n\n### Helpful warnings\n\n| Name                                                                   | Description                                                                           | 💼   | ⚠️    | 🚫 | 🔧 | 💡 | ❌  |\n| :--------------------------------------------------------------------- | :------------------------------------------------------------------------------------ | :--- | :---- | :- | :- | :- | :- |\n| [export](docs/rules/export.md)                                         | Forbid any invalid exports, i.e. re-export of the same name.                          | ❗ ☑️ |       |    |    |    |    |\n| [no-deprecated](docs/rules/no-deprecated.md)                           | Forbid imported names marked with `@deprecated` documentation tag.                    |      |       |    |    |    |    |\n| [no-empty-named-blocks](docs/rules/no-empty-named-blocks.md)           | Forbid empty named import blocks.                                                     |      |       |    | 🔧 | 💡 |    |\n| [no-extraneous-dependencies](docs/rules/no-extraneous-dependencies.md) | Forbid the use of extraneous packages.                                                |      |       |    |    |    |    |\n| [no-mutable-exports](docs/rules/no-mutable-exports.md)                 | Forbid the use of mutable exports with `var` or `let`.                                |      |       |    |    |    |    |\n| [no-named-as-default](docs/rules/no-named-as-default.md)               | Forbid use of exported name as identifier of default export.                          |      | ☑️ 🚸 |    |    |    |    |\n| [no-named-as-default-member](docs/rules/no-named-as-default-member.md) | Forbid use of exported name as property of default export.                            |      | ☑️ 🚸 |    |    |    |    |\n| [no-unused-modules](docs/rules/no-unused-modules.md)                   | Forbid modules without exports, or exports without matching import in another module. |      |       |    |    |    |    |\n\n### Module systems\n\n| Name                                                               | Description                                                          | 💼 | ⚠️ | 🚫 | 🔧 | 💡 | ❌  |\n| :----------------------------------------------------------------- | :------------------------------------------------------------------- | :- | :- | :- | :- | :- | :- |\n| [no-amd](docs/rules/no-amd.md)                                     | Forbid AMD `require` and `define` calls.                             |    |    |    |    |    |    |\n| [no-commonjs](docs/rules/no-commonjs.md)                           | Forbid CommonJS `require` calls and `module.exports` or `exports.*`. |    |    |    |    |    |    |\n| [no-import-module-exports](docs/rules/no-import-module-exports.md) | Forbid import statements with CommonJS module.exports.               |    |    |    | 🔧 |    |    |\n| [no-nodejs-modules](docs/rules/no-nodejs-modules.md)               | Forbid Node.js builtin modules.                                      |    |    |    |    |    |    |\n| [unambiguous](docs/rules/unambiguous.md)                           | Forbid potentially ambiguous parse goal (`script` vs. `module`).     |    |    |    |    |    |    |\n\n### Static analysis\n\n| Name                                                                     | Description                                                                                     | 💼   | ⚠️ | 🚫 | 🔧 | 💡 | ❌  |\n| :----------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------- | :--- | :- | :- | :- | :- | :- |\n| [default](docs/rules/default.md)                                         | Ensure a default export is present, given a default import.                                     | ❗ ☑️ |    |    |    |    |    |\n| [enforce-node-protocol-usage](docs/rules/enforce-node-protocol-usage.md) | Enforce either using, or omitting, the `node:` protocol when importing Node.js builtin modules. |      |    |    | 🔧 |    |    |\n| [named](docs/rules/named.md)                                             | Ensure named imports correspond to a named export in the remote file.                           | ❗ ☑️ |    | ⌨️ |    |    |    |\n| [namespace](docs/rules/namespace.md)                                     | Ensure imported namespaces contain dereferenced properties as they are dereferenced.            | ❗ ☑️ |    |    |    |    |    |\n| [no-absolute-path](docs/rules/no-absolute-path.md)                       | Forbid import of modules using absolute paths.                                                  |      |    |    | 🔧 |    |    |\n| [no-cycle](docs/rules/no-cycle.md)                                       | Forbid a module from importing a module with a dependency path back to itself.                  |      |    |    |    |    |    |\n| [no-dynamic-require](docs/rules/no-dynamic-require.md)                   | Forbid `require()` calls with expressions.                                                      |      |    |    |    |    |    |\n| [no-internal-modules](docs/rules/no-internal-modules.md)                 | Forbid importing the submodules of other modules.                                               |      |    |    |    |    |    |\n| [no-relative-packages](docs/rules/no-relative-packages.md)               | Forbid importing packages through relative paths.                                               |      |    |    | 🔧 |    |    |\n| [no-relative-parent-imports](docs/rules/no-relative-parent-imports.md)   | Forbid importing modules from parent directories.                                               |      |    |    |    |    |    |\n| [no-restricted-paths](docs/rules/no-restricted-paths.md)                 | Enforce which files can be imported in a given folder.                                          |      |    |    |    |    |    |\n| [no-self-import](docs/rules/no-self-import.md)                           | Forbid a module from importing itself.                                                          |      |    |    |    |    |    |\n| [no-unresolved](docs/rules/no-unresolved.md)                             | Ensure imports point to a file/module that can be resolved.                                     | ❗ ☑️ |    |    |    |    |    |\n| [no-useless-path-segments](docs/rules/no-useless-path-segments.md)       | Forbid unnecessary path segments in import and require statements.                              |      |    |    | 🔧 |    |    |\n| [no-webpack-loader-syntax](docs/rules/no-webpack-loader-syntax.md)       | Forbid webpack loader syntax in imports.                                                        |      |    |    |    |    |    |\n\n### Style guide\n\n| Name                                                                             | Description                                                                | 💼 | ⚠️    | 🚫 | 🔧 | 💡 | ❌  |\n| :------------------------------------------------------------------------------- | :------------------------------------------------------------------------- | :- | :---- | :- | :- | :- | :- |\n| [consistent-type-specifier-style](docs/rules/consistent-type-specifier-style.md) | Enforce or ban the use of inline type-only markers for named imports.      |    |       |    | 🔧 |    |    |\n| [dynamic-import-chunkname](docs/rules/dynamic-import-chunkname.md)               | Enforce a leading comment with the webpackChunkName for dynamic imports.   |    |       |    |    | 💡 |    |\n| [exports-last](docs/rules/exports-last.md)                                       | Ensure all exports appear after other statements.                          |    |       |    |    |    |    |\n| [extensions](docs/rules/extensions.md)                                           | Ensure consistent use of file extension within the import path.            |    |       |    |    |    |    |\n| [first](docs/rules/first.md)                                                     | Ensure all imports appear before other statements.                         |    |       |    | 🔧 |    |    |\n| [group-exports](docs/rules/group-exports.md)                                     | Prefer named exports to be grouped together in a single export declaration |    |       |    |    |    |    |\n| [imports-first](docs/rules/imports-first.md)                                     | Replaced by `import/first`.                                                |    |       |    | 🔧 |    | ❌  |\n| [max-dependencies](docs/rules/max-dependencies.md)                               | Enforce the maximum number of dependencies a module can have.              |    |       |    |    |    |    |\n| [newline-after-import](docs/rules/newline-after-import.md)                       | Enforce a newline after import statements.                                 |    |       |    | 🔧 |    |    |\n| [no-anonymous-default-export](docs/rules/no-anonymous-default-export.md)         | Forbid anonymous values as default exports.                                |    |       |    |    |    |    |\n| [no-default-export](docs/rules/no-default-export.md)                             | Forbid default exports.                                                    |    |       |    |    |    |    |\n| [no-duplicates](docs/rules/no-duplicates.md)                                     | Forbid repeated import of the same module in multiple places.              |    | ☑️ 🚸 |    | 🔧 |    |    |\n| [no-named-default](docs/rules/no-named-default.md)                               | Forbid named default exports.                                              |    |       |    |    |    |    |\n| [no-named-export](docs/rules/no-named-export.md)                                 | Forbid named exports.                                                      |    |       |    |    |    |    |\n| [no-namespace](docs/rules/no-namespace.md)                                       | Forbid namespace (a.k.a. \"wildcard\" `*`) imports.                          |    |       |    | 🔧 |    |    |\n| [no-unassigned-import](docs/rules/no-unassigned-import.md)                       | Forbid unassigned imports                                                  |    |       |    |    |    |    |\n| [order](docs/rules/order.md)                                                     | Enforce a convention in module import order.                               |    |       |    | 🔧 |    |    |\n| [prefer-default-export](docs/rules/prefer-default-export.md)                     | Prefer a default export if module exports a single name or multiple names. |    |       |    |    |    |    |\n\n\u003c!-- end auto-generated rules list --\u003e\n\n## `eslint-plugin-import` for enterprise\n\nAvailable as part of the Tidelift Subscription.\n\nThe maintainers of `eslint-plugin-import` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-eslint-plugin-import?utm_source=npm-eslint-plugin-import\u0026utm_medium=referral\u0026utm_campaign=enterprise\u0026utm_term=repo)\n\n## Installation\n\n```sh\n# inside your project's working tree\nnpm install eslint-plugin-import --save-dev\n```\n\n### Config - Legacy (`.eslintrc`)\n\nAll rules are off by default. However, you may extend one of the preset configs, or configure them manually in your `.eslintrc.(yml|json|js)`.\n\n - Extending a preset config:\n\n```jsonc\n{\n  \"extends\": [\n     \"eslint:recommended\",\n     \"plugin:import/recommended\",\n  ],\n}\n```\n\n - Configuring manually:\n\n```jsonc\n{\n  \"rules\": {\n    \"import/no-unresolved\": [\"error\", { \"commonjs\": true, \"amd\": true }],\n    \"import/named\": \"error\",\n    \"import/namespace\": \"error\",\n    \"import/default\": \"error\",\n    \"import/export\": \"error\",\n    // etc...\n  },\n},\n```\n\n### Config - Flat (`eslint.config.js`)\n\nAll rules are off by default. However, you may configure them manually in your `eslint.config.(js|cjs|mjs)`, or extend one of the preset configs:\n\n```js\nimport importPlugin from 'eslint-plugin-import';\nimport js from '@eslint/js';\n\nexport default [\n  js.configs.recommended,\n  importPlugin.flatConfigs.recommended,\n  {\n    files: ['**/*.{js,mjs,cjs}'],\n    languageOptions: {\n      ecmaVersion: 'latest',\n      sourceType: 'module',\n    },\n    rules: {\n      'no-unused-vars': 'off',\n      'import/no-dynamic-require': 'warn',\n      'import/no-nodejs-modules': 'warn',\n    },\n  },\n];\n```\n\n## TypeScript\n\nYou may use the following snippet or assemble your own config using the granular settings described below it.\n\nMake sure you have installed [`@typescript-eslint/parser`] and [`eslint-import-resolver-typescript`] which are used in the following configuration.\n\n```jsonc\n{\n  \"extends\": [\n    \"eslint:recommended\",\n    \"plugin:import/recommended\",\n// the following lines do the trick\n    \"plugin:import/typescript\",\n  ],\n  \"settings\": {\n    \"import/resolver\": {\n      // You will also need to install and configure the TypeScript resolver\n      // See also https://github.com/import-js/eslint-import-resolver-typescript#configuration\n      \"typescript\": true,\n      \"node\": true,\n    },\n  },\n}\n```\n\n[`@typescript-eslint/parser`]: https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser\n[`eslint-import-resolver-typescript`]: https://github.com/import-js/eslint-import-resolver-typescript\n\n### Config - Flat with `config()` in `typescript-eslint`\n\nIf you are using the `config` method from [`typescript-eslint`](https://github.com/typescript-eslint/typescript-eslint), ensure that the `flatConfig` is included within the `extends` array.\n\n```js\nimport tseslint from 'typescript-eslint';\nimport importPlugin from 'eslint-plugin-import';\nimport js from '@eslint/js';\n\nexport default tseslint.config(\n  js.configs.recommended,\n  // other configs...\n  {\n    files: ['**/*.{ts,tsx}'],\n    extends: [importPlugin.flatConfigs.recommended, importPlugin.flatConfigs.typescript],\n    // other configs...\n  }\n);\n```\n\n## Resolvers\n\nWith the advent of module bundlers and the current state of modules and module\nsyntax specs, it's not always obvious where `import x from 'module'` should look\nto find the file behind `module`.\n\nUp through v0.10ish, this plugin has directly used substack's [`resolve`] plugin,\nwhich implements Node's import behavior. This works pretty well in most cases.\n\nHowever, webpack allows a number of things in import module source strings that\nNode does not, such as loaders (`import 'file!./whatever'`) and a number of\naliasing schemes, such as [`externals`]: mapping a module id to a global name at\nruntime (allowing some modules to be included more traditionally via script tags).\n\nIn the interest of supporting both of these, v0.11 introduces resolvers.\n\nCurrently [Node] and [webpack] resolution have been implemented, but the\nresolvers are just npm packages, so [third party packages are supported](https://github.com/import-js/eslint-plugin-import/wiki/Resolvers) (and encouraged!).\n\nYou can reference resolvers in several ways (in order of precedence):\n\n - as a conventional `eslint-import-resolver` name, like `eslint-import-resolver-foo`:\n\n ```jsonc\n// .eslintrc\n{\n  \"settings\": {\n    // uses 'eslint-import-resolver-foo':\n    \"import/resolver\": \"foo\",\n  },\n}\n```\n\n```yaml\n# .eslintrc.yml\nsettings:\n  # uses 'eslint-import-resolver-foo':\n  import/resolver: foo\n```\n\n```js\n// .eslintrc.js\nmodule.exports = {\n  settings: {\n    'import/resolver': {\n      foo: { someConfig: value }\n    }\n  }\n}\n```\n\n - with a full npm module name, like `my-awesome-npm-module`:\n\n```jsonc\n// .eslintrc\n{\n  \"settings\": {\n    \"import/resolver\": \"my-awesome-npm-module\",\n  },\n}\n```\n\n```yaml\n# .eslintrc.yml\nsettings:\n  import/resolver: 'my-awesome-npm-module'\n```\n\n```js\n// .eslintrc.js\nmodule.exports = {\n  settings: {\n    'import/resolver': {\n      'my-awesome-npm-module': { someConfig: value }\n    }\n  }\n}\n```\n\n - with a filesystem path to resolver, defined in this example as a `computed property` name:\n\n```js\n// .eslintrc.js\nmodule.exports = {\n  settings: {\n    'import/resolver': {\n      [path.resolve('../../../my-resolver')]: { someConfig: value }\n    }\n  }\n}\n```\n\nRelative paths will be resolved relative to the source's nearest `package.json` or\nthe process's current working directory if no `package.json` is found.\n\nIf you are interesting in writing a resolver, see the [spec](./resolvers/README.md) for more details.\n\n[`resolve`]: https://www.npmjs.com/package/resolve\n[`externals`]: https://webpack.github.io/docs/library-and-externals.html\n\n[Node]: https://www.npmjs.com/package/eslint-import-resolver-node\n[webpack]: https://www.npmjs.com/package/eslint-import-resolver-webpack\n\n## Settings\n\nYou may set the following settings in your `.eslintrc`:\n\n### `import/extensions`\n\nA list of file extensions that will be parsed as modules and inspected for\n`export`s.\n\nThis defaults to `['.js']`, unless you are using the `react` shared config,\nin which case it is specified as `['.js', '.jsx']`. Despite the default,\nif you are using TypeScript (without the `plugin:import/typescript` config\ndescribed above) you must specify the new extensions (`.ts`, and also `.tsx`\nif using React).\n\n```js\n\"settings\": {\n  \"import/extensions\": [\n    \".js\",\n    \".jsx\"\n  ]\n}\n```\n\nIf you require more granular extension definitions, you can use:\n\n```js\n\"settings\": {\n  \"import/resolver\": {\n    \"node\": {\n      \"extensions\": [\n        \".js\",\n        \".jsx\"\n      ]\n    }\n  }\n}\n```\n\nNote that this is different from (and likely a subset of) any `import/resolver`\nextensions settings, which may include `.json`, `.coffee`, etc. which will still\nfactor into the `no-unresolved` rule.\n\nAlso, the following `import/ignore` patterns will overrule this list.\n\n### `import/ignore`\n\nA list of regex strings that, if matched by a path, will\nnot report the matching module if no `export`s are found.\nIn practice, this means rules other than [`no-unresolved`](./docs/rules/no-unresolved.md#ignore) will not report on any\n`import`s with (absolute filesystem) paths matching this pattern.\n\n`no-unresolved` has its own [`ignore`](./docs/rules/no-unresolved.md#ignore) setting.\n\n```jsonc\n{\n  \"settings\": {\n    \"import/ignore\": [\n      \"\\.coffee$\", // fraught with parse errors\n      \"\\.(scss|less|css)$\", // can't parse unprocessed CSS modules, either\n    ],\n  },\n}\n```\n\n### `import/core-modules`\n\nAn array of additional modules to consider as \"core\" modules--modules that should\nbe considered resolved but have no path on the filesystem. Your resolver may\nalready define some of these (for example, the Node resolver knows about `fs` and\n`path`), so you need not redefine those.\n\nFor example, Electron exposes an `electron` module:\n\n```js\nimport 'electron'  // without extra config, will be flagged as unresolved!\n```\n\nthat would otherwise be unresolved. To avoid this, you may provide `electron` as a\ncore module:\n\n```jsonc\n// .eslintrc\n{\n  \"settings\": {\n    \"import/core-modules\": [\"electron\"],\n  },\n}\n```\n\nIn Electron's specific case, there is a shared config named `electron`\nthat specifies this for you.\n\nContribution of more such shared configs for other platforms are welcome!\n\n### `import/external-module-folders`\n\nAn array of folders. Resolved modules only from those folders will be considered as \"external\". By default - `[\"node_modules\"]`. Makes sense if you have configured your path or webpack to handle your internal paths differently and want to consider modules from some folders, for example `bower_components` or `jspm_modules`, as \"external\".\n\nThis option is also useful in a monorepo setup: list here all directories that contain monorepo's packages and they will be treated as external ones no matter which resolver is used.\n\nIf you are using `yarn` PnP as your package manager, add the `.yarn` folder and all your installed dependencies will be considered as `external`, instead of `internal`.\n\nEach item in this array is either a folder's name, its subpath, or its absolute prefix path:\n\n - `jspm_modules` will match any file or folder named `jspm_modules` or which has a direct or non-direct parent named `jspm_modules`, e.g. `/home/me/project/jspm_modules` or `/home/me/project/jspm_modules/some-pkg/index.js`.\n\n - `packages/core` will match any path that contains these two segments, for example `/home/me/project/packages/core/src/utils.js`.\n\n - `/home/me/project/packages` will only match files and directories inside this directory, and the directory itself.\n\nPlease note that incomplete names are not allowed here so `components` won't match `bower_components` and `packages/ui` won't match `packages/ui-utils` (but will match `packages/ui/utils`).\n\n### `import/parsers`\n\nA map from parsers to file extension arrays. If a file extension is matched, the\ndependency parser will require and use the map key as the parser instead of the\nconfigured ESLint parser. This is useful if you're inter-op-ing with TypeScript\ndirectly using webpack, for example:\n\n```jsonc\n// .eslintrc\n{\n  \"settings\": {\n    \"import/parsers\": {\n      \"@typescript-eslint/parser\": [\".ts\", \".tsx\"],\n    },\n  },\n}\n```\n\nIn this case, [`@typescript-eslint/parser`](https://www.npmjs.com/package/@typescript-eslint/parser)\nmust be installed and require-able from the running `eslint` module's location\n(i.e., install it as a peer of ESLint).\n\nThis is currently only tested with `@typescript-eslint/parser` (and its predecessor,\n`typescript-eslint-parser`) but should theoretically work with any moderately\nESTree-compliant parser.\n\nIt's difficult to say how well various plugin features will be supported, too,\ndepending on how far down the rabbit hole goes. Submit an issue if you find strange\nbehavior beyond here, but steel your heart against the likely outcome of closing\nwith `wontfix`.\n\n### `import/resolver`\n\nSee [resolvers](#resolvers).\n\n### `import/cache`\n\nSettings for cache behavior. Memoization is used at various levels to avoid the copious amount of `fs.statSync`/module parse calls required to correctly report errors.\n\nFor normal `eslint` console runs, the cache lifetime is irrelevant, as we can strongly assume that files should not be changing during the lifetime of the linter process (and thus, the cache in memory)\n\nFor long-lasting processes, like [`eslint_d`] or [`eslint-loader`], however, it's important that there be some notion of staleness.\n\nIf you never use [`eslint_d`] or [`eslint-loader`], you may set the cache lifetime to `Infinity` and everything should be fine:\n\n```jsonc\n// .eslintrc\n{\n  \"settings\": {\n    \"import/cache\": {\n      \"lifetime\": \"∞\", // or Infinity, in a JS config\n    },\n  },\n}\n```\n\nOtherwise, set some integer, and cache entries will be evicted after that many seconds have elapsed:\n\n```jsonc\n// .eslintrc\n{\n  \"settings\": {\n    \"import/cache\": {\n      \"lifetime\": 5, // 30 is the default\n    },\n  },\n}\n```\n\n[`eslint_d`]: https://www.npmjs.com/package/eslint_d\n[`eslint-loader`]: https://www.npmjs.com/package/eslint-loader\n\n### `import/internal-regex`\n\nA regex for packages should be treated as internal. Useful when you are utilizing a monorepo setup or developing a set of packages that depend on each other.\n\nBy default, any package referenced from [`import/external-module-folders`](#importexternal-module-folders) will be considered as \"external\", including packages in a monorepo like yarn workspace or lerna environment. If you want to mark these packages as \"internal\" this will be useful.\n\nFor example, if your packages in a monorepo are all in `@scope`, you can configure `import/internal-regex` like this\n\n```jsonc\n// .eslintrc\n{\n  \"settings\": {\n    \"import/internal-regex\": \"^@scope/\",\n  },\n}\n```\n\n### `import/node-version`\n\nA string that represents the version of Node.js that you are using.\nA falsy value will imply the version of Node.js that you are running ESLint with.\n\n```jsonc\n// .eslintrc\n{\n  \"settings\": {\n    \"import/node-version\": \"22.3.4\",\n  },\n}\n```\n\n## SublimeLinter-eslint\n\nSublimeLinter-eslint introduced a change to support `.eslintignore` files\nwhich altered the way file paths are passed to ESLint when linting during editing.\nThis change sends a relative path instead of the absolute path to the file (as ESLint\nnormally provides), which can make it impossible for this plugin to resolve dependencies\non the filesystem.\n\nThis workaround should no longer be necessary with the release of ESLint 2.0, when\n`.eslintignore` will be updated to work more like a `.gitignore`, which should\nsupport proper ignoring of absolute paths via `--stdin-filename`.\n\nIn the meantime, see [roadhump/SublimeLinter-eslint#58](https://github.com/roadhump/SublimeLinter-eslint/issues/58)\nfor more details and discussion, but essentially, you may find you need to add the following\n`SublimeLinter` config to your Sublime project file:\n\n```json\n{\n    \"folders\":\n    [\n        {\n            \"path\": \"code\"\n        }\n    ],\n    \"SublimeLinter\":\n    {\n        \"linters\":\n        {\n            \"eslint\":\n            {\n                \"chdir\": \"${project}/code\"\n            }\n        }\n    }\n}\n```\n\nNote that `${project}/code` matches the `code` provided at `folders[0].path`.\n\nThe purpose of the `chdir` setting, in this case, is to set the working directory\nfrom which ESLint is executed to be the same as the directory on which SublimeLinter-eslint\nbases the relative path it provides.\n\nSee the SublimeLinter docs on [`chdir`](https://www.sublimelinter.com/en/latest/linter_settings.html#chdir)\nfor more information, in case this does not work with your project.\n\nIf you are not using `.eslintignore`, or don't have a Sublime project file, you can also\ndo the following via a `.sublimelinterrc` file in some ancestor directory of your\ncode:\n\n```json\n{\n  \"linters\": {\n    \"eslint\": {\n      \"args\": [\"--stdin-filename\", \"@\"]\n    }\n  }\n}\n```\n\nI also found that I needed to set `rc_search_limit` to `null`, which removes the file\nhierarchy search limit when looking up the directory tree for `.sublimelinterrc`:\n\nIn Package Settings / SublimeLinter / User Settings:\n\n```json\n{\n  \"user\": {\n    \"rc_search_limit\": null\n  }\n}\n```\n\nI believe this defaults to `3`, so you may not need to alter it depending on your\nproject folder max depth.\n\n[codecov-image]: https://codecov.io/gh/import-js/eslint-plugin-import/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/import-js/eslint-plugin-import/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/import-js/eslint-plugin-import\n[actions-url]: https://github.com/import-js/eslint-plugin-import\n","funding_links":["https://github.com/sponsors/import-js","https://github.com/sponsors/ljharb","https://opencollective.com/eslint-plugin-import","https://tidelift.com/funding/github/npm/eslint-plugin-import","https://tidelift.com/subscription/pkg/npm-eslint-plugin-import?utm_source=npm-eslint-plugin-import\u0026utm_medium=referral\u0026utm_campaign=enterprise\u0026utm_term=repo"],"categories":["JavaScript","javascript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimport-js%2Feslint-plugin-import","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimport-js%2Feslint-plugin-import","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimport-js%2Feslint-plugin-import/lists"}