eslint-import-resolver-typescript
TypeScript .ts .tsx module resolver for `eslint-plugin-import`.
Last updated 18 days ago by bradzacher .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install eslint-import-resolver-typescript 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 1.1.1                                ...           latest (18 days ago)
  • 1.1.1                                ...           next (18 days ago)

6 Versions

  • 1.1.1                                ...           18 days ago
  • 1.1.0                                ...           a month ago
  • 1.1.0-rc.0                                ...           a month ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago

Copyright 2014 - 2018 © taobao.org |