Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

eslint-import-resolver-typescript

1.1.1 • Public • Published

eslint-import-resolver-typescript

This plugin adds typescript support to eslint-plugin-import.

This means you can:

  • import/require files with extension .ts/.tsx!
  • Use paths defined in tsconfig.json.

Installation

npm install --save-dev eslint-plugin-import typescript-eslint-parser eslint-import-resolver-typescript

Configuration

Add the following to your .eslintrc config:

{
  "settings": {
    "parser": "typescript-eslint-parser",
    "plugins": [
      "import"
    ],
    "rules": {
      // turn on errors for missing imports
      "import/no-unresolved": "error"
    },
    "import/resolver": {
      // use <root>/tsconfig.json
      "typescript": {},
 
      // use <root>/path/to/folder/tsconfig.json
      "typescript": {
        "directory": "./path/to/folder"
      }
    }
  }
}

Contributing

  • Make sure your change is covered by a test import.
  • Make sure that npm test passes without a failure.

install

npm i eslint-import-resolver-typescript

Downloadsweekly downloads

19,206

version

1.1.1

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability