JSPM

  • Created
  • Published
  • Downloads 10995805
  • Score
    100M100P100Q228177F
  • License ISC

TypeScript .ts .tsx module resolver for `eslint-plugin-import`.

Package Exports

  • eslint-import-resolver-typescript

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-import-resolver-typescript) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

eslint-import-resolver-typescript

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

This means you can:

  • import/require files with extension .ts/.tsx without using --ext!
  • 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.