TypeScript import resolution for eslint-plugin-import and eslint-plugin-import-x
open sourceISCfree
eslint-import-resolver-typescript is a resolver, not a rule plugin, that lets eslint-plugin-import and eslint-plugin-import-x resolve TypeScript imports: .ts, .tsx, .mts, .cts and .d.ts files, path aliases from tsconfig.json, several tsconfigs at once, and package.json imports and exports fields. It prefers @types definitions over plain JavaScript when resolving packages.
Problems it solves
- eslint-plugin-import says it can't resolve my TypeScript path alias
- make import/no-unresolved understand .ts files and tsconfig paths
- get ESLint import rules working in a TypeScript project
Features
- resolves .ts, .tsx, .mts, .cts and .d.ts imports
- honours paths aliases from tsconfig.json
- supports several tsconfig files
- package.json imports and exports fields
- works with eslint-plugin-import and eslint-plugin-import-x, in flat and legacy config
Alternatives
The same job
These do what eslint-import-resolver-typescript does.
- typescript-eslint The tooling that lets ESLint and Prettier lint and read TypeScript
- eslint-plugin-simple-import-sort Autofixable import and export sorting for ESLint
- ESLint Find and fix problems in your JavaScript code.
- eslint-plugin-import ESLint rules that validate imports and exports
- eslint-plugin-unicorn More than 300 powerful ESLint rules
- eslint-plugin-jsdoc JSDoc linting rules for ESLint.
