0.1.3 • Published 7 months ago

eslint-import-resolver-ts-parser v0.1.3

Weekly downloads
-
License
ISC
Repository
github
Last release
7 months ago

eslint-import-resolver-ts-parser

npm Package

Resolver using @typescript-eslint parser service. Plugin for eslint-plugin-import.

This plugin reads options from @typescript-eslint parser service, and then uses typescript compiler APIs to resolve paths. It can resolve whatever typescript can resolve.

Installation

npm i -D eslint-import-resolver-ts-parser

Set up the parser

Make sure you've got the @typescript-eslint/parser and @typescript-eslint/eslint-plugin working. Check out their documentations.

Attach listener

Extend your eslint config with plugin:ts-parser-service/listen. For example,

// .eslintrc.json
{
  "extends": [
    "plugin:@typescript-eslint/recommended",
    "plugin:ts-parser-service/listen",
  ]
}

eslint-plugin-ts-parser-service helps us get the parser service serving the parsing file.

Configure resolver

Set ts-parser as the import/resolver. For example,

// .eslintrc.json
{
  // ...
  "settings": {
    "import/resolver": "ts-parser"
  }
}
0.1.3

7 months ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago