talira

eslint-import-resolver-typescript

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.

  1. typescript-eslint The tooling that lets ESLint and Prettier lint and read TypeScript
  2. eslint-plugin-simple-import-sort Autofixable import and export sorting for ESLint
  3. ESLint Find and fix problems in your JavaScript code.
  4. eslint-plugin-import ESLint rules that validate imports and exports
  5. eslint-plugin-unicorn More than 300 powerful ESLint rules
  6. eslint-plugin-jsdoc JSDoc linting rules for ESLint.

Compare eslint-import-resolver-typescript with the top 3