eslint-import-resolver-ts-parser-service
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

eslint-import-resolver-ts-parser-service

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-service

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-service"
  }
}

Readme

Keywords

none

Package Sidebar

Install

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

Weekly Downloads

0

Version

0.2.0

License

ISC

Unpacked Size

8.5 kB

Total Files

10

Last publish

Collaborators

  • sliphua