eslint-import-resolver-typescript

A TypeScript-aware module resolver that plugs into eslint-plugin-import(-x) so ESLint can correctly follow .ts/.tsx imports, tsconfig paths, and package export maps.

Tool
npm
v4.4.5
829 stars
ISC

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
48 /100 Fair
Development Activity 8
Maintenance 44
Community 52
Maturity 60
Momentum 28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
69 /100 Good
Architecture 72
Code Quality 78
Innovation 55
Learning Curve 70

eslint-import-resolver-typescript adds TypeScript support to eslint-plugin-import and eslint-plugin-import-x, which otherwise only understand plain JavaScript module resolution. Without it, rules like import/no-unresolved and import/named misfire constantly in a TypeScript codebase because ESLint’s default resolver has no notion of .ts, .tsx, .d.ts extensions, tsconfig.json path mapping, or the imports/exports fields in package.json.

Under the hood it delegates the actual filesystem resolution to unrs-resolver (a Rust-backed resolver also used by other tools in the Rust-JS ecosystem for speed), while it owns the TypeScript-specific policy layer: parsing tsconfig.json/jsconfig.json via get-tsconfig, matching path aliases, preferring @types/* type declarations over sibling .js/.jsx files, and supporting multiple tsconfigs in a monorepo (either as an explicit array, a glob, or TypeScript project references).

Configuration is exposed two ways: as a flat-config resolver object (createTypeScriptImportResolver) for eslint-plugin-import-x@>=4.5, and as the classic import/resolver: { typescript: {...} } settings block for older eslint-plugin-import setups. Both accept the same option surface — alwaysTryTypes, bun (for Bun’s built-in modules), project path(s), plus pass-through options like conditionNames, extensions, and mainFields that map directly onto unrs-resolver’s own resolution algorithm.

It has been a near-default dependency in TypeScript + ESLint projects since 2017, with 45 contributors and a v2/v3/v4 history that tracks changes in how Node and bundlers resolve TypeScript-specific file extensions and export conditions.

What You Get

  • Flat-config resolver factory - createTypeScriptImportResolver() for direct use in eslint.config.js with eslint-plugin-import-x >=4.5, no legacy settings block needed
  • Classic settings-block support - import/resolver: { typescript: {...} } for .eslintrc and older eslint-plugin-import versions
  • tsconfig/jsconfig path mapping - resolves paths aliases from tsconfig.json or jsconfig.json, including glob patterns and arrays for monorepos
  • TypeScript project references support - can resolve nested tsconfigs across a monorepo using references, avoiding one-tsconfig-per-package duplication
  • @types/* precedence - alwaysTryTypes resolves ambient type declarations over sibling plain JS files, useful for packages with separate @types definitions
  • Bun module resolution - bun: true (or running under bun --bun eslint) resolves Bun’s built-in modules like bun:test
  • Rust-backed resolution engine - delegates to unrs-resolver for the actual filesystem walk, keeping large-project lint runs fast

Common Use Cases

  • Fixing false-positive import/no-unresolved errors - a team adds TypeScript to a JS codebase and ESLint’s import rules start flagging valid .ts imports as unresolved; this resolver fixes that without disabling the rule
  • Monorepos with multiple tsconfigs - a pnpm/Yarn workspace with per-package tsconfig.json files configures project: 'packages/*/tsconfig.json' so cross-package imports resolve correctly from any file
  • Migrating from .eslintrc to flat config - a project moving to ESLint 9’s flat config switches from the import/resolver settings object to createTypeScriptImportResolver() for a cleaner, importable config
  • Projects using path aliases - an app defines @/* path mapping in tsconfig.json for absolute imports; without this resolver ESLint can’t verify those aliased imports actually point to real files
  • Bun-based TypeScript projects - a project running on Bun needs ESLint to recognize bun:test and other Bun built-ins as valid imports rather than flagging them as missing modules

Under The Hood

Architecture

The package centers on a single resolve() function in src/index.ts that layers TypeScript-specific policy on top of a general-purpose resolver. It first short-circuits Node/Bun core modules via isBuiltin/isBunBuiltin, then normalizes caller options in normalize-options.ts (resolving and sorting candidate tsconfig projects by directory affinity in helpers.ts’s sortProjectsByAffinity), and finally delegates the actual filesystem walk to an unrs-resolver ResolverFactory instance. Three module-level caches (resolverCache, tsconfigCache, matcherCache), keyed by a stable hash of the options plus cwd, avoid re-parsing tsconfig files and rebuilding resolvers across repeated ESLint rule invocations — a meaningful cost given ESLint calls resolvers per-import, per-file. The design cleanly separates “which tsconfig applies to this file” (this package’s job) from “how do we actually resolve a module path” (delegated entirely to unrs-resolver), so a change to Node’s module resolution algorithm is absorbed by the dependency rather than requiring changes here.

Tech Stack

Written in TypeScript, built dual-format (ESM lib/index.js + CJS lib/index.cjs) via tsc and tsdown, and published under the import-js GitHub org. Core runtime dependencies are narrow and purpose-built: unrs-resolver (Rust-backed resolution), get-tsconfig (tsconfig/jsconfig parsing and path-matcher creation), is-bun-module, stable-hash-x for cache keys, and tinyglobby for glob-pattern project globbing. It integrates with ESLint via the eslint-import-context package’s useRuleContext() rather than depending on ESLint directly, letting it work across both eslint-plugin-import and eslint-plugin-import-x. Yarn Berry (PnP-aware, packageManager: yarn@4.9.2) manages the workspace, with changesets driving releases.

Code Quality

Tests run under Vitest (vitest run) plus a standalone e2e smoke test (tests/e2e/withJsExtension/test.cjs), with an extensive tests/e2e/ suite covering path-alias resolution, multiple tsconfigs, tsconfig project references, dotted include/exclude paths, and querystring-suffixed imports — each as its own fixture directory with a real tsconfig and expected resolution snapshot. The project enforces a 100%-minimum type-coverage threshold via the type-coverage tool (typeCoverage.atLeast: 100 in package.json), which is a stronger and more unusual guarantee than typical --noImplicitAny type checking. Linting runs through the shared @1stg/common-config ESLint config plus a dedicated tsc --noEmit pass, and CI (GitHub Actions) enforces both on every PR alongside Codecov coverage reporting. No test framework gaps were found; the codebase is small and every exported function has corresponding fixture coverage.

API Design The public surface is deliberately narrow: one resolver factory (createTypeScriptImportResolver) for flat config, and one options object shape shared with the legacy import/resolver.typescript settings block, so migrating between ESLint config formats requires no relearning. Defaults are sensible and documented inline in the README (default extensions, extensionAlias, conditionNames, mainFields are all shown as copy-pasteable JSON), which keeps the common case a one-line alwaysTryTypes: true addition to config while still exposing every knob unrs-resolver itself supports for advanced monorepo or non-standard resolution setups.

Used by 50 apps in this directory

Go
76%
Other

Flipt

Developer Tools · Devops

4,926

Git-native feature flag platform that stores, versions, and deploys feature toggles directly in your own Git repositories with no external database required.

View details
90
Repo Health
83
Technical
68
Dependency
Built with
Go 76%
TypeScript 23%
Updated 6 days ago
TypeScript
62%
Other

Flowise

AI Development · Automation · Developer Tools

55,521

Drag-and-drop visual builder for AI agents, RAG pipelines, and multi-agent systems—deploy anywhere in minutes.

View details
75
Repo Health
77
Technical
63
Dependency
Built with
TypeScript 62%
JavaScript 27%
Updated 2 months ago
TypeScript
92%
MIT

GB Studio

Design Tools · Developer Tools · Game Development

9,434

Drag-and-drop retro Game Boy game creator that compiles real ROMs — no coding required.

View details
88
Repo Health
83
Technical
72
Dependency
Built with
TypeScript 92%
Updated 1 weeks ago
Rust
68%
Other

GitButler

AI Development · Developer Tools · Devops

21,841

Git, but better — a modern version control client with stacked branches, parallel workflows, unlimited undo, and first-class support for AI-powered development.

View details
89
Repo Health
84
Technical
66
Dependency
Built with
Rust 68%
TypeScript 20%
Updated 6 days ago
Go
83%
MIT

Gitea

Developer Tools · Devops · Project Management

58,668

Self-hosted DevOps in a single Go binary — Git hosting, GitHub Actions-compatible CI/CD, and 30+ package registries without any SaaS dependency.

View details
93
Repo Health
79
Technical
64
Dependency
Built with
Go 83%
Updated 6 days ago
Rust
89%
Apache 2.0

Graphite

Code Editors · Design Tools

27,703

A free, open source procedural 2D design tool that unifies vector, raster, motion graphics, and generative art in a single node-based nondestructive workflow.

View details
84
Repo Health
77
Technical
70
Dependency
Built with
Rust 89%
Updated 6 days ago
TypeScript
98%
Other

GrowthBook

Ab Testing Experimentation · Analytics · Developer Tools

8,527

Open source feature flags, A/B testing, and warehouse-native experimentation that queries your existing data infrastructure—no data movement required.

View details
92
Repo Health
85
Technical
63
Dependency
Built with
TypeScript 98%
Updated 6 days ago
Go
62%
Apache 2.0

Harness Open Source

Code Editors · Developer Tools · Devops

38,684

A unified open source DevOps platform combining Git hosting, CI/CD pipelines, cloud development environments, and artifact registries in a single self-hosted system.

View details
90
Repo Health
79
Technical
64
Dependency
Built with
Go 62%
TypeScript 33%
Updated 1 weeks ago
Go
87%
MIT

Hatchet

AI Development · Automation · Developer Tools

8,174

A Postgres-backed orchestration engine for background tasks, AI agents, and durable workflows that replaces Redis queues and multi-datastore durable execution platforms with a single self-hostable service.

View details
88
Repo Health
83
Technical
67
Dependency
Built with
Go 87%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers