{"name":"eslint-import-resolver-typescript","version":"3.7.0","keywords":["typescript","eslint","import","resolver","plugin"],"author":{"name":"Alex Gorbatchev","email":"alex.gorbatchev@gmail.com"},"license":"ISC","_id":"eslint-import-resolver-typescript@3.7.0","contributors":[{"url":"https://www.1stG.me","name":"JounQin","email":"admin@1stg.me"}],"homepage":"https://github.com/import-js/eslint-import-resolver-typescript#readme","bugs":{"url":"https://github.com/import-js/eslint-import-resolver-typescript/issues"},"dist":{"shasum":"e69925936a771a9cb2de418ccebc4cdf6c0818aa","tarball":"http://registry-npm.ywwl.com/eslint-import-resolver-typescript/download/eslint-import-resolver-typescript-3.7.0.tgz","fileCount":8,"integrity":"sha512-Vrwyi8HHxY97K5ebydMtffsWAn1SCR9eol49eCd5fJS4O1WV7PaAjbcjmbfJJSMz/t4Mal212Uz/fQZrOB8mow==","signatures":[{"sig":"MEYCIQC9y5vaaHemf8QRPLKQxGIoHk78b+Apf4XqpzdeZS2V6wIhANA2zbjp2hvINn6c1lrh6or2rGIFfxftBkDsTYZfIyta","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":52616,"size":13370,"noattachment":false,"key":"/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.7.0.tgz"},"main":"lib/index.cjs","type":"module","types":"lib/index.d.ts","es2020":"lib/index.es2020.mjs","module":"lib/index.js","engines":{"node":"^14.18.0 || >=16.0.0"},"exports":{".":{"types":"./lib/index.d.ts","es2020":"./lib/index.es2020.mjs","import":"./lib/index.js","require":"./lib/index.cjs","fesm2020":"./lib/index.es2020.mjs"},"./package.json":"./package.json"},"funding":"https://opencollective.com/unts/projects/eslint-import-resolver-ts","gitHead":"c5da7003c3e98400be91fb2c38a988fbe3dab124","scripts":{"lint":"run-p 'lint:*'","test":"run-p 'test:*'","build":"run-p 'build:*'","build:r":"r -f cjs,es2020","lint:es":"eslint src --cache -f friendly","prepare":"simple-git-hooks","release":"changeset publish","typecov":"type-coverage","build:ts":"tsc -b","lint:tsc":"tsc --noEmit","test:withPaths":"eslint --ext ts,tsx tests/withPaths","test:withJsconfig":"eslint --ext js tests/withJsconfig","test:withoutPaths":"eslint --ext ts,tsx tests/withoutPaths","test:withJsExtension":"node tests/withJsExtension/test.js && eslint --ext ts,tsx tests/withJsExtension","test:withQuerystring":"eslint --ext ts,tsx tests/withQuerystring","test:importXResolverV3":"eslint --config=tests/importXResolverV3/eslint.config.js tests/importXResolverV3","test:multipleEslintrcs":"eslint --ext ts,tsx tests/multipleEslintrcs","test:multipleTsconfigs":"eslint --ext ts,tsx tests/multipleTsconfigs","test:withPathsAndNestedBaseUrl":"eslint --ext ts,tsx tests/withPathsAndNestedBaseUrl"},"_npmUser":{"name":"jounqin","email":"admin@1stg.me"},"fesm2020":"lib/index.es2020.mjs","repository":{"url":"git+https://github.com/import-js/eslint-import-resolver-typescript.git","type":"git"},"_npmVersion":"10.9.0","description":"This plugin adds `TypeScript` support to `eslint-plugin-import`","directories":{},"resolutions":{"prettier":"^2.8.8","eslint-import-resolver-typescript":"link:."},"_nodeVersion":"22.11.0","dependencies":{"debug":"^4.3.7","is-glob":"^4.0.3","fast-glob":"^3.3.2","stable-hash":"^0.0.4","get-tsconfig":"^4.7.5","is-bun-module":"^1.0.2","enhanced-resolve":"^5.15.0","@nolyfill/is-core-module":"1.0.39"},"typeCoverage":{"cache":true,"detail":true,"strict":true,"update":true,"atLeast":100,"ignoreCatch":true,"ignoreAsAssertion":true,"ignoreNonNullAssertion":true},"_hasShrinkwrap":false,"packageManager":"yarn@4.0.2","devDependencies":{"react":"^18.3.1","eslint":"^8.57.1","dummy.js":"link:dummy.js","prettier":"^2.8.8","size-limit":"^11.0.0","typescript":"^5.3.2","@types/node":"^18.19.67","lint-staged":"^13.3.0","@pkgr/rollup":"^4.1.3","@types/debug":"^4.1.12","@types/unist":"^2.0.11","npm-run-all2":"^5.0.2","type-coverage":"^2.27.0","@mozilla/glean":"^3.0.0","@types/is-glob":"^4.0.4","@changesets/cli":"^2.27.10","@commitlint/cli":"^17.8.1","@1stg/lib-config":"^12.0.1","simple-git-hooks":"^2.11.1","@1stg/eslint-config":"7","eslint-plugin-import":"npm:eslint-plugin-i@^2.29.1","eslint-plugin-import-x":"^4.5.0","size-limit-preset-node-lib":"^0.3.0","@changesets/changelog-github":"^0.5.0","eslint-import-resolver-typescript":"link:."},"peerDependencies":{"eslint":"*","eslint-plugin-import":"*","eslint-plugin-import-x":"*"},"peerDependenciesMeta":{"eslint-plugin-import":{"optional":true},"eslint-plugin-import-x":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/eslint-import-resolver-typescript_3.7.0_1733234165980_0.5250142134874378","host":"s3://npm-registry-packages"},"readme":"# eslint-import-resolver-typescript\n\n[![GitHub Actions](https://github.com/import-js/eslint-import-resolver-typescript/workflows/CI/badge.svg)](https://github.com/import-js/eslint-import-resolver-typescript/actions/workflows/ci.yml)\n[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Fimport-js%2Feslint-import-resolver-typescript%2Fmaster%2Fpackage.json)](https://github.com/plantain-00/type-coverage)\n[![npm](https://img.shields.io/npm/v/eslint-import-resolver-typescript.svg)](https://www.npmjs.com/package/eslint-import-resolver-typescript)\n[![GitHub Release](https://img.shields.io/github/release/import-js/eslint-import-resolver-typescript)](https://github.com/import-js/eslint-import-resolver-typescript/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[![changesets](https://img.shields.io/badge/maintained%20with-changesets-176de3.svg)](https://github.com/changesets/changesets)\n\nThis is a resolver for `eslint-plugin-impprt(-x)` plugin, not an ESLint plugin itself, it adds [`TypeScript`][] support to [`eslint-plugin-import`][] (Or maybe you want to try [`eslint-plugin-import-x`][] for faster speed)\n\nThis means you can:\n\n- `import`/`require` files with extension `.cts`/`.mts`/`.ts`/`.tsx`/`.d.cts`/`.d.mts`/`.d.ts`\n- Use [`paths`](https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping) defined in `tsconfig.json`\n- Prefer resolving `@types/*` definitions over plain `.js`/`.jsx`\n- Multiple tsconfigs support just like normal\n- `imports/exports` fields support in `package.json`\n\n## TOC <!-- omit in toc -->\n\n- [Notice](#notice)\n- [Installation](#installation)\n  - [`eslint-plugin-import`](#eslint-plugin-import)\n  - [`eslint-plugin-import-x`](#eslint-plugin-import-x)\n- [Configuration](#configuration)\n  - [`eslint.config.js`](#eslintconfigjs)\n  - [`.eslintrc`](#eslintrc)\n- [Options from `rspack-resolver`](#options-from-rspack-resolver)\n  - [`conditionNames`](#conditionnames)\n  - [`extensions`](#extensions)\n  - [`extensionAlias`](#extensionalias)\n  - [`mainFields`](#mainfields)\n  - [Other options](#other-options)\n  - [Default options](#default-options)\n- [Contributing](#contributing)\n- [Sponsors](#sponsors)\n- [Backers](#backers)\n- [Changelog](#changelog)\n- [License](#license)\n\n## Notice\n\nAfter version 2.0.0, `.d.ts` will take higher priority then normal `.js`/`.jsx` files on resolving `node_modules` packages in favor of `@types/*` definitions or its own definition.\n\nIf you're facing some problems on rules `import/default` or `import/named` from [`eslint-plugin-import`][], do not post any issue here, because they are just working exactly as [expected](https://github.com/import-js/eslint-import-resolver-typescript/issues/31#issuecomment-539751607) on our sides, take [import-js/eslint-plugin-import#1525](https://github.com/import-js/eslint-plugin-import/issues/1525) as reference or post a new issue to [`eslint-plugin-import`][] instead.\n\n## Installation\n\n### `eslint-plugin-import`\n\n```sh\n# npm\nnpm i -D eslint-plugin-import eslint-import-resolver-typescript\n\n# pnpm\npnpm i -D eslint-plugin-import eslint-import-resolver-typescript\n\n# yarn\nyarn add -D eslint-plugin-import eslint-import-resolver-typescript\n```\n\n### `eslint-plugin-import-x`\n\n```sh\n# npm\nnpm i -D eslint-plugin-import-x eslint-import-resolver-typescript\n\n# pnpm\npnpm i -D eslint-plugin-import-x eslint-import-resolver-typescript\n\n# yarn\nyarn add -D eslint-plugin-import-x eslint-import-resolver-typescript\n```\n\n## Configuration\n\n### `eslint.config.js`\n\nIf you are using `eslint-plugin-import-x@>=4.5.0`, you can use import/require to reference `eslint-import-resolver-typescript` directly in your ESLint flat config:\n\n```js\n// eslint.config.js, CommonJS is also supported\nimport { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript'\n\nexport default [\n  {\n    settings: {\n      'import-x/resolver-next': [\n        createTypeScriptImportResolver({\n          alwaysTryTypes: true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`\n\n          // Choose from one of the \"project\" configs below or omit to use <root>/tsconfig.json by default\n\n          // use <root>/path/to/folder/tsconfig.json\n          project: 'path/to/folder',\n\n          // Multiple tsconfigs (Useful for monorepos)\n\n          // use a glob pattern\n          project: 'packages/*/tsconfig.json',\n\n          // use an array\n          project: [\n            'packages/module-a/tsconfig.json',\n            'packages/module-b/tsconfig.json',\n          ],\n\n          // use an array of glob patterns\n          project: [\n            'packages/*/tsconfig.json',\n            'other-packages/*/tsconfig.json',\n          ],\n\n          // use <root>/jsconfig.json\n          project: 'jsconfig.json',\n        }),\n      ],\n    },\n  },\n]\n```\n\nBut if you are using `eslint-plugin-import` or the older version of `eslint-plugin-import-x`, you can't use require/import:\n\n```js\n// eslint.config.js, CommonJS is also supported\nexport default [\n  {\n    settings: {\n      'import/resolver': {\n        typescript: {\n          alwaysTryTypes: true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`\n\n          // Choose from one of the \"project\" configs below or omit to use <root>/tsconfig.json by default\n\n          // use <root>/path/to/folder/tsconfig.json\n          project: 'path/to/folder',\n\n          // Multiple tsconfigs (Useful for monorepos)\n\n          // use a glob pattern\n          project: 'packages/*/tsconfig.json',\n\n          // use an array\n          project: [\n            'packages/module-a/tsconfig.json',\n            'packages/module-b/tsconfig.json',\n          ],\n\n          // use an array of glob patterns\n          project: [\n            'packages/*/tsconfig.json',\n            'other-packages/*/tsconfig.json',\n          ],\n\n          // use <root>/jsconfig.json\n          project: 'jsconfig.json',\n        },\n      },\n    },\n  },\n]\n```\n\n### `.eslintrc`\n\nAdd the following to your `.eslintrc` config:\n\n```jsonc\n{\n  \"plugins\": [\"import\"],\n  \"rules\": {\n    // turn on errors for missing imports\n    \"import/no-unresolved\": \"error\",\n  },\n  \"settings\": {\n    \"import/parsers\": {\n      \"@typescript-eslint/parser\": [\".ts\", \".tsx\"],\n    },\n    \"import/resolver\": {\n      \"typescript\": {\n        \"alwaysTryTypes\": true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`\n\n        // Choose from one of the \"project\" configs below or omit to use <root>/tsconfig.json by default\n\n        // use <root>/path/to/folder/tsconfig.json\n        \"project\": \"path/to/folder\",\n\n        // Multiple tsconfigs (Useful for monorepos)\n\n        // use a glob pattern\n        \"project\": \"packages/*/tsconfig.json\",\n\n        // use an array\n        \"project\": [\n          \"packages/module-a/tsconfig.json\",\n          \"packages/module-b/tsconfig.json\",\n        ],\n\n        // use an array of glob patterns\n        \"project\": [\n          \"packages/*/tsconfig.json\",\n          \"other-packages/*/tsconfig.json\",\n        ],\n\n        // use <root>/jsconfig.json\n        \"project\": \"jsconfig.json\",\n      },\n    },\n  },\n}\n```\n\n## Options from [`rspack-resolver`][]\n\n### `conditionNames`\n\nDefault:\n\n```jsonc\n[\n  \"types\",\n  \"import\",\n\n  // APF: https://angular.io/guide/angular-package-format\n  \"esm2020\",\n  \"es2020\",\n  \"es2015\",\n\n  \"require\",\n  \"node\",\n  \"node-addons\",\n  \"browser\",\n  \"default\",\n]\n```\n\n### `extensions`\n\nDefault:\n\n```jsonc\n[\n  // `.mts`, `.cts`, `.d.mts`, `.d.cts`, `.mjs`, `.cjs` are not included because `.cjs` and `.mjs` must be used explicitly\n  \".ts\",\n  \".tsx\",\n  \".d.ts\",\n  \".js\",\n  \".jsx\",\n  \".json\",\n  \".node\",\n]\n```\n\n### `extensionAlias`\n\nDefault:\n\n```jsonc\n{\n  \".js\": [\n    \".ts\",\n    // `.tsx` can also be compiled as `.js`\n    \".tsx\",\n    \".d.ts\",\n    \".js\",\n  ],\n  \".jsx\": [\".tsx\", \".d.ts\", \".jsx\"],\n  \".cjs\": [\".cts\", \".d.cts\", \".cjs\"],\n  \".mjs\": [\".mts\", \".d.mts\", \".mjs\"],\n}\n```\n\n### `mainFields`\n\nDefault:\n\n```jsonc\n[\n  \"types\",\n  \"typings\",\n\n  // APF: https://angular.io/guide/angular-package-format\n  \"fesm2020\",\n  \"fesm2015\",\n  \"esm2020\",\n  \"es2020\",\n\n  \"module\",\n  \"jsnext:main\",\n\n  \"main\",\n]\n```\n\n### Other options\n\nYou can pass through other options of [`rspack-resolver`][] directly\n\n### Default options\n\nYou can reuse `defaultConditionNames`, `defaultExtensions`, `defaultExtensionAlias` and `defaultMainFields` by `require/import` them directly\n\n## Contributing\n\n- Make sure your change is covered by a test import.\n- Make sure that `yarn test` passes without a failure.\n- Make sure that `yarn lint` passes without conflicts.\n- Make sure your code changes match our [type-coverage](https://github.com/plantain-00/type-coverage) settings: `yarn type-coverage`.\n\nWe have [GitHub Actions](https://github.com/import-js/eslint-import-resolver-typescript/actions) which will run the above commands on your PRs.\n\nIf either fails, we won't be able to merge your PR until it's fixed.\n\n[![Sponsors](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 backers and sponsors](https://opencollective.com/1stG/organizations.svg)](https://opencollective.com/1stG) | [![RxTS Open Collective backers and sponsors](https://opencollective.com/rxts/organizations.svg)](https://opencollective.com/rxts) | [![UnTS Open Collective backers and 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 and sponsors](https://opencollective.com/1stG/individuals.svg)](https://opencollective.com/1stG) | [![RxTS Open Collective backers and sponsors](https://opencollective.com/rxts/individuals.svg)](https://opencollective.com/rxts) | [![UnTS Open Collective backers and sponsors](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[ISC][]\n\n[`eslint-plugin-import`]: https://github.com/import-js/eslint-plugin-import\n[`eslint-plugin-import-x`]: https://github.com/un-ts/eslint-plugin-import-x\n[`rspack-resolver`]: https://github.com/unrs/rspack-resolver\n[`typescript`]: https://www.typescriptlang.org\n[isc]: https://opensource.org/licenses/ISC\n","publish_time":1733234166187,"maintainers":[{"name":"alexgorbatchev","email":"alex.gorbatchev@gmail.com"},{"name":"jounqin","email":"admin@1stg.me"},{"name":"bradzacher","email":"brad.zacher@gmail.com"}],"_cnpm_publish_time":1733234166187,"dist-tags":{"beta":"2.6.0-beta","latest":"4.4.5","next":"1.1.1","release-v3":"3.10.1"}}