{"id":13801652,"url":"https://github.com/un-ts/eslint-plugin-import-x","last_synced_at":"2026-06-20T14:32:22.307Z","repository":{"id":47121137,"uuid":"239121486","full_name":"un-ts/eslint-plugin-import-x","owner":"un-ts","description":"A fork of `eslint-plugin-import` using `get-tsconfig` to replace `tsconfig-paths` and heavy `typescript` under the hood.","archived":false,"fork":true,"pushed_at":"2024-04-20T20:23:38.000Z","size":4499,"stargazers_count":197,"open_issues_count":11,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-22T23:29:22.522Z","etag":null,"topics":["eslint","eslint-plugin","eslint-plugin-import"],"latest_commit_sha":null,"homepage":"https://npm.im/eslint-plugin-import-x","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"import-js/eslint-plugin-import","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/un-ts.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},"funding":{"github":["JounQin","1stG","rx-ts","un-ts"],"patreon":"1stG","open_collective":"unts","custom":["https://opencollective.com/1stG","https://opencollective.com/rxts","https://afdian.net/@JounQin"]}},"created_at":"2020-02-08T11:37:08.000Z","updated_at":"2024-05-21T08:02:00.000Z","dependencies_parsed_at":"2023-01-21T08:15:54.751Z","dependency_job_id":"a392ed2d-1005-4515-90ec-54e8a5cfc9e8","html_url":"https://github.com/un-ts/eslint-plugin-import-x","commit_stats":{"total_commits":1915,"total_committers":356,"mean_commits":5.379213483146067,"dds":0.5639686684073106,"last_synced_commit":"67645970778040dce2bf567ed2ab445c284662c7"},"previous_names":["un-es/eslint-plugin-import-x","un-ts/eslint-plugin-import-x","un-es/eslint-plugin-i"],"tags_count":179,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/un-ts%2Feslint-plugin-import-x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/un-ts%2Feslint-plugin-import-x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/un-ts%2Feslint-plugin-import-x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/un-ts%2Feslint-plugin-import-x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/un-ts","download_url":"https://codeload.github.com/un-ts/eslint-plugin-import-x/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":218326696,"owners_count":16312955,"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","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":["eslint","eslint-plugin","eslint-plugin-import"],"created_at":"2024-08-04T00:01:25.436Z","updated_at":"2025-10-02T13:31:15.866Z","avatar_url":"https://github.com/un-ts.png","language":"TypeScript","funding_links":["https://github.com/sponsors/JounQin","https://github.com/sponsors/1stG","https://github.com/sponsors/rx-ts","https://github.com/sponsors/un-ts","https://patreon.com/1stG","https://opencollective.com/unts","https://opencollective.com/1stG","https://opencollective.com/rxts","https://afdian.net/@JounQin"],"categories":["TypeScript","Plugins","Utilities"],"sub_categories":["Practices and Specific ES Features","ESLint Plugins"],"readme":"# eslint-plugin-import-x\n\n[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/un-ts/eslint-plugin-import-x/ci.yml?branch=master)](https://github.com/un-ts/eslint-plugin-import-x/actions/workflows/ci.yml?query=branch%3Amaster)\n[![Codecov](https://img.shields.io/codecov/c/github/un-ts/eslint-plugin-import-x.svg)](https://codecov.io/gh/un-ts/eslint-plugin-import-x)\n[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage\u0026prefix=%E2%89%A5\u0026suffix=%\u0026query=$.typeCoverage.atLeast\u0026uri=https%3A%2F%2Fraw.githubusercontent.com%2Fun-ts%2Fsynckit%2Fmain%2Fpackage.json)](https://github.com/plantain-00/type-coverage)\n[![CodeRabbit Pull Request Reviews](https://img.shields.io/coderabbit/prs/github/un-ts/eslint-plugin-import-x)](https://coderabbit.ai)\n[![npm](https://img.shields.io/npm/v/eslint-plugin-import-x.svg)](https://www.npmjs.com/package/eslint-plugin-import-x)\n[![GitHub Release](https://img.shields.io/github/release/un-ts/eslint-plugin-import-x)](https://github.com/un-ts/eslint-plugin-import-x/releases)\n\n[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)\n[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\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\nIt started as a fork of [`eslint-plugin-import`] using [`get-tsconfig`] to replace [`tsconfig-paths`] and heavy [`typescript`] under the hood, making it faster, through less [heavy dependency on Typescript](https://github.com/import-js/eslint-plugin-import/blob/da5f6ec13160cb288338db0c2a00c34b2d932f0d/src/exportMap/typescript.js#L16), and cleaner dependencies altogether.\n\n[`eslint-plugin-i` is now `eslint-plugin-import-x`](https://github.com/un-ts/eslint-plugin-import-x/issues/24#issuecomment-1991605123)\n\n**IF YOU ARE USING THIS WITH SUBLIME**: see the [bottom section](#sublimelinter-eslint) for important info.\n\n## TOC \u003c!-- omit in toc --\u003e\n\n- [Why](#why)\n- [Differences](#differences)\n- [Installation](#installation)\n- [Configuration (new: `eslint.config.*`)](#configuration-new-eslintconfig)\n  - [JS example](#js-example)\n  - [Typescript example](#typescript-example)\n  - [As a standalone ESLint plugin](#as-a-standalone-eslint-plugin)\n  - [Using `defineConfig`](#using-defineconfig)\n- [Configuration (legacy: `.eslintrc*`)](#configuration-legacy-eslintrc)\n  - [TypeScript](#typescript)\n- [Rules](#rules)\n  - [Helpful warnings](#helpful-warnings)\n  - [Module systems](#module-systems)\n  - [Static analysis](#static-analysis)\n  - [Style guide](#style-guide)\n- [Resolvers](#resolvers)\n  - [`import-x/resolver-next`](#import-xresolver-next)\n  - [`import-x/resolver`](#import-xresolver)\n- [Settings](#settings)\n  - [`import-x/extensions`](#import-xextensions)\n  - [`import-x/ignore`](#import-xignore)\n  - [`import-x/core-modules`](#import-xcore-modules)\n  - [`import-x/external-module-folders`](#import-xexternal-module-folders)\n  - [`import-x/parsers`](#import-xparsers)\n  - [`import-x/resolver` and `import-x/resolver-next`](#import-xresolver-and-import-xresolver-next)\n  - [`import-x/cache`](#import-xcache)\n  - [`import-x/internal-regex`](#import-xinternal-regex)\n- [SublimeLinter-eslint](#sublimelinter-eslint)\n- [Sponsors and Backers](#sponsors-and-backers)\n  - [Sponsors](#sponsors)\n  - [Backers](#backers)\n- [Changelog](#changelog)\n- [License](#license)\n- [Star History](#star-history)\n\n## Why\n\nMany issues cannot be fixed easily without API changes. For example, see:\n\n- \u003chttps://github.com/import-js/eslint-plugin-import/issues/1479\u003e\n- \u003chttps://github.com/import-js/eslint-plugin-import/issues/2108\u003e\n- \u003chttps://github.com/import-js/eslint-plugin-import/issues/2111\u003e\n\n[`eslint-plugin-import`] refused to accept BREAKING CHANGES for these issues, so we had to fork it.\n\n[`eslint-plugin-import`] now claims in \u003chttps://github.com/un-ts/eslint-plugin-import-x/issues/170\u003e that it will accept BREAKING CHANGES. However, still nothing is happening: \u003chttps://github.com/import-js/eslint-plugin-import/pull/3091\u003e.\n\n[`eslint-plugin-import`] refuses to support the `exports` feature, and the maintainer even locked the feature request issue \u003chttps://github.com/import-js/eslint-plugin-import/issues/1810\u003e to prevent future discussion. In the meantime, `eslint-plugin-import-x` now provides first-party support for the `exports` feature \u003chttps://github.com/un-ts/eslint-plugin-import-x/pull/209\u003e, which will become the default in the next major version (v5).\n\nWe haven't resolved all the issues yet, but we are working on them, which could happen in the next major version (v5): \u003chttps://github.com/un-ts/eslint-plugin-import-x/issues/235\u003e.\n\n## Differences\n\nSo what are the differences from `eslint-plugin-import` exactly?\n\n- we target [Node `^18.18.0 || ^20.9.0 || \u003e=21.1.0`](https://github.com/un-ts/eslint-plugin-import-x/blob/8b2d6d3b612eb57fb68c3fddec25b02fc622df7c/package.json#L12) + [ESLint `^8.57.0 || ^9.0.0`](https://github.com/un-ts/eslint-plugin-import-x/blob/8b2d6d3b612eb57fb68c3fddec25b02fc622df7c/package.json#L71), while `eslint-plugin-import` targets [Node `\u003e=4`](https://github.com/import-js/eslint-plugin-import/blob/da5f6ec13160cb288338db0c2a00c34b2d932f0d/package.json#L6) and [ESLint `^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9`](https://github.com/import-js/eslint-plugin-import/blob/da5f6ec13160cb288338db0c2a00c34b2d932f0d/package.json#L115C16-L115C64)\n- we don't depend on old and outdated dependencies, so [we have 16 dependencies](https://npmgraph.js.org/?q=eslint-plugin-import-x) compared to [117 dependencies for `eslint-plugin-import`](https://npmgraph.js.org/?q=eslint-plugin-import)\n- `eslint-plugin-import` uses `tsconfig-paths` + `typescript` itself to load `tsconfig`s while we use the single `get-tsconfig` instead, which is much faster and cleaner\n- `eslint-plugin-import` uses [`resolve`] which doesn't support the `exports` field in `package.json` while we build our own rust-based resolver [`unrs-resolver`] instead, which is feature-rich and way more performant.\n- Our [v3 resolver](./resolvers/README.md#v3) interface shares a single `resolver` instance by default which is used all across resolving chains so it would benefit from caching and memoization out-of-the-box\n- ...\n\nThe list could be longer in the future, but we don't want to make it too long here. Hope you enjoy and let's get started.\n\n## Installation\n\n```sh\n# inside your project's working tree\nnpm install eslint-plugin-import-x --save-dev\n```\n\n## Configuration (new: `eslint.config.*`)\n\nFrom [`v8.21.0`](https://github.com/eslint/eslint/releases/tag/v8.21.0), ESLint announced a new config system.\nIn the new system, `.eslintrc*` is no longer used. `eslint.config.*` would be the default config file name.\n\n### JS example\n\n```js\nimport js from '@eslint/js'\nimport { importX } from 'eslint-plugin-import-x'\n\nexport default [js.configs.recommended, importX.flatConfigs.recommended]\n```\n\n### Typescript example\n\nYou have to install `eslint-import-resolver-typescript`:\n\n```sh\nnpm install eslint-import-resolver-typescript --save-dev\n```\n\n```js\nimport js from '@eslint/js'\nimport { importX } from 'eslint-plugin-import-x'\nimport tsParser from '@typescript-eslint/parser'\n\nexport default [\n  js.configs.recommended,\n  importX.flatConfigs.recommended,\n  importX.flatConfigs.typescript,\n  {\n    files: ['**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}'],\n    languageOptions: {\n      parser: tsParser,\n      ecmaVersion: 'latest',\n      sourceType: 'module',\n    },\n    rules: {\n      'import-x/no-dynamic-require': 'warn',\n      'import-x/no-nodejs-modules': 'warn',\n    },\n  },\n]\n```\n\n\u003e [!NOTE]\n\u003e A complete list of available configuration can be found in [config/flat folders](src/config/flat)\n\n### As a standalone ESLint plugin\n\n```js\nimport { importX } from 'eslint-plugin-import-x'\n\nexport default [\n  {\n    plugins: {\n      'import-x': importX,\n    },\n    languageOptions: {\n      ecmaVersion: 'latest',\n      sourceType: 'module',\n    },\n    rules: {\n      'import-x/no-dynamic-require': 'warn',\n      'import-x/no-nodejs-modules': 'warn',\n    },\n  },\n]\n```\n\n### Using `defineConfig`\n\n```js\nimport { importX } from 'eslint-plugin-import-x'\nimport { defineConfig } from 'eslint/config'\n\nexport default defineConfig([\n  {\n    plugins: {\n      'import-x': importX,\n    },\n    extends: ['import-x/flat/recommended'],\n    rules: {\n      'import-x/no-dynamic-require': 'warn',\n    },\n  },\n])\n```\n\n## Configuration (legacy: `.eslintrc*`)\n\n\u003e [!TIP]\n\u003e If your eslint is `\u003e=8.23.0`, you're 100% ready to use the new config system.\n\u003e See dedicated section above.\n\n\u003e [!NOTE]\n\u003e All rules are off by default. However, you may configure them manually\n\u003e in your `.eslintrc.(yml|json|js)`, or extend one of the canned configs:\n\n```yaml\nextends:\n  - eslint:recommended\n  - plugin:import-x/recommended\n  # alternatively, 'recommended' is the combination of these two rule sets:\n  - plugin:import-x/errors\n  - plugin:import-x/warnings\n\n# or configure manually:\nplugins:\n  - import-x\n\nrules:\n  import-x/no-unresolved: [2, { commonjs: true, amd: true }]\n  import-x/named: 2\n  import-x/namespace: 2\n  import-x/default: 2\n  import-x/export: 2\n  # etc...\n```\n\n### TypeScript\n\nYou may use the following snippet or assemble your own config using the granular settings described below it.\n\n\u003e [!WARNING]\n\u003e Make sure you have installed [`@typescript-eslint/parser`] and [`eslint-import-resolver-typescript`] which are used in the following configuration.\n\n```yaml\nextends:\n  - eslint:recommended\n  - plugin:import-x/recommended\n  # the following lines do the trick\n  - plugin:import-x/typescript\nsettings:\n  import-x/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```\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 `flat/errors` configuration.\\\n☑️ Set in the `flat/recommended` configuration.\\\n⌨️ Set in the `flat/typescript` configuration.\\\n🚸 Set in the `flat/warnings` 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-rename-default](docs/rules/no-rename-default.md)                   | Forbid importing a default export by a different name.                                |             | 🚸 🚸       |     |     |     |     |\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| [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-x/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| [prefer-namespace-import](docs/rules/prefer-namespace-import.md)                 | Enforce using namespace imports for specific modules, like `react`/`react-dom`, etc. |     |             |     | 🔧  |     |     |\n\n\u003c!-- end auto-generated rules list --\u003e\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### `import-x/resolver-next`\n\n\u003e [!warning]\n\u003e\n\u003e Only available in the new flat config system. If you are using the legacy config system, please use `import-x/resolver` instead.\n\n```js\n// eslint.config.js\n\nimport { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript'\nimport { createNodeResolver } from 'eslint-plugin-import-x'\n\nexport default [\n  {\n    settings: {\n      'import-x/resolver-next': [\n        createTypeScriptImportResolver(/* Your override options go here */),\n        createNodeResolver(/* Your override options go here */),\n      ],\n    },\n  },\n]\n```\n\n### `import-x/resolver`\n\n```yaml\n# .eslintrc.yml\nsettings:\n  # uses 'eslint-import-resolver-foo':\n  import-x/resolver: foo\n```\n\n```js\n// .eslintrc.js\nmodule.exports = {\n  settings: {\n    'import-x/resolver': {\n      foo: { someConfig: value },\n    },\n  },\n}\n```\n\n- with a full npm module name, like `my-awesome-npm-module`:\n\n```yaml\n# .eslintrc.yml\nsettings:\n  import-x/resolver: 'my-awesome-npm-module'\n```\n\n```js\n// .eslintrc.js\nmodule.exports = {\n  settings: {\n    'import-x/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-x/resolver': {\n      [path.resolve('../../../my-resolver')]: { someConfig: value },\n    },\n  },\n}\n```\n\n- use the `import` or `require` syntax to directly import the resolver object:\n\n```js\n// .eslintrc.mjs\nimport * as tsResolver from 'eslint-import-resolver-typescript'\n\nexport default {\n  settings: {\n    'import-x/resolver': {\n      name: 'tsResolver', // required, could be any string you like\n      // enable: false, // optional, defaults to true\n      // optional, options to pass to the resolver https://github.com/import-js/eslint-import-resolver-typescript#configuration\n      options: {\n        bun: true, // optional, resolve Bun modules https://github.com/import-js/eslint-import-resolver-typescript#bun\n      },\n      resolver: tsResolver, // required, the resolver object\n    },\n  },\n}\n```\n\n```js\n// .eslintrc.cjs\nconst tsResolver = require('eslint-import-resolver-typescript')\n\nmodule.exports = {\n  settings: {\n    'import-x/resolver': {\n      name: 'tsResolver', // required, could be any string you like\n      // enable: false, // optional, defaults to true\n      // optional, options to pass to the resolver https://github.com/import-js/eslint-import-resolver-typescript#configuration\n      options: {\n        bun: true, // optional, resolve Bun modules https://github.com/import-js/eslint-import-resolver-typescript#bun\n      },\n      resolver: tsResolver, // required, the resolver object\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## Settings\n\nYou may set the following settings in your `.eslintrc`:\n\n### `import-x/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-x/typescript` config\ndescribed above) you must specify the new extensions (`.ts`, and also `.tsx`\nif using React).\n\n```js\n\"settings\": {\n  \"import-x/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-x/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-x/resolver`\nextensions settings, which may include `.json`, `.coffee`, etc. which will still\nfactor into the `no-unresolved` rule.\n\nAlso, the following `import-x/ignore` patterns will overrule this list.\n\n### `import-x/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```yaml\nsettings:\n  import-x/ignore:\n    - \\.coffee$ # fraught with parse errors\n    - \\.(scss|less|css)$ # can't parse unprocessed CSS modules, either\n```\n\n### `import-x/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```yaml\n# .eslintrc.yml\nsettings:\n  import-x/core-modules: [electron]\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-x/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-x/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```yaml\n# .eslintrc.yml\nsettings:\n  import-x/parsers:\n    '@typescript-eslint/parser': [.ts, .tsx]\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-x/resolver` and `import-x/resolver-next`\n\nSee [resolvers](#resolvers).\n\n### `import-x/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```yaml\n# .eslintrc.yml\nsettings:\n  import-x/cache:\n    lifetime: ∞ # or Infinity\n```\n\nOtherwise, set some integer, and cache entries will be evicted after that many seconds have elapsed:\n\n```yaml\n# .eslintrc.yml\nsettings:\n  import-x/cache:\n    lifetime: 5 # 30 is the default\n```\n\n### `import-x/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-x/external-module-folders`](#import-xexternal-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-x/internal-regex` like this\n\n```yaml\n# .eslintrc.yml\nsettings:\n  import-x/internal-regex: ^@scope/\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      \"path\": \"code\"\n    }\n  ],\n  \"SublimeLinter\": {\n    \"linters\": {\n      \"eslint\": {\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## Sponsors and Backers\n\n[![Sponsors and Backers](https://raw.githubusercontent.com/1stG/static/master/sponsors.svg)](https://github.com/sponsors/JounQin)\n\n### Sponsors\n\n| 1stG                                                                                                                   | RxTS                                                                                                                   | UnTS                                                                                                                   |\n| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |\n| [![1stG Open Collective sponsors](https://opencollective.com/1stG/organizations.svg)](https://opencollective.com/1stG) | [![RxTS Open Collective sponsors](https://opencollective.com/rxts/organizations.svg)](https://opencollective.com/rxts) | [![UnTS Open Collective sponsors](https://opencollective.com/unts/organizations.svg)](https://opencollective.com/unts) |\n\n### Backers\n\n| 1stG                                                                                                                | RxTS                                                                                                                | UnTS                                                                                                                |\n| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |\n| [![1stG Open Collective backers](https://opencollective.com/1stG/individuals.svg)](https://opencollective.com/1stG) | [![RxTS Open Collective backers](https://opencollective.com/rxts/individuals.svg)](https://opencollective.com/rxts) | [![UnTS Open Collective backers](https://opencollective.com/unts/individuals.svg)](https://opencollective.com/unts) |\n\n## Changelog\n\nDetailed changes for each release are documented in [CHANGELOG.md](./CHANGELOG.md).\n\n## License\n\n[MIT][] © [JounQin][]@[1stG.me][]\n\n## Star History\n\n\u003ca href=\"https://www.star-history.com/#un-ts/eslint-plugin-import-x\u0026Date\"\u003e\n \u003cpicture\u003e\n   \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/svg?repos=un-ts/eslint-plugin-import-x\u0026type=Date\u0026theme=dark\" /\u003e\n   \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/svg?repos=un-ts/eslint-plugin-import-x\u0026type=Date\" /\u003e\n   \u003cimg alt=\"Star History Chart\" src=\"https://api.star-history.com/svg?repos=un-ts/eslint-plugin-import-x\u0026type=Date\" /\u003e\n \u003c/picture\u003e\n\u003c/a\u003e\n\n[`@typescript-eslint/parser`]: https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser\n[`eslint-plugin-import`]: https://github.com/import-js/eslint-plugin-import\n[`eslint-import-resolver-typescript`]: https://github.com/import-js/eslint-import-resolver-typescript\n[`eslint_d`]: https://www.npmjs.com/package/eslint_d\n[`eslint-loader`]: https://www.npmjs.com/package/eslint-loader\n[`get-tsconfig`]: https://github.com/privatenumber/get-tsconfig\n[`tsconfig-paths`]: https://github.com/dividab/tsconfig-paths\n[`typescript`]: https://github.com/microsoft/TypeScript\n[`unrs-resolver`]: https://github.com/unrs/unrs-resolver\n[`resolve`]: https://www.npmjs.com/package/resolve\n[`externals`]: https://webpack.github.io/docs/library-and-externals.html\n[1stG.me]: https://www.1stG.me\n[JounQin]: https://github.com/JounQin\n[MIT]: http://opensource.org/licenses/MIT\n[node]: https://www.npmjs.com/package/eslint-import-resolver-node\n[webpack]: https://www.npmjs.com/package/eslint-import-resolver-webpack\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fun-ts%2Feslint-plugin-import-x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fun-ts%2Feslint-plugin-import-x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fun-ts%2Feslint-plugin-import-x/lists"}