1- # eslint-import-resolver-typescript
1+ # eslint-import-resolver-ts
22
3- [ ![ Build Status ] ( https://travis-ci.org/alexgorbatchev/ eslint-import-resolver-typescript .svg?branch=master )] ( https://travis-ci.org/alexgorbatchev /eslint-import-resolver-typescript )
3+ [ ![ Travis ] ( https://img.shields.io/travis/com/rx-ts/ eslint-import-resolver-ts .svg )] ( https://travis-ci.com/rx-ts /eslint-import-resolver-ts )
44
55This plugin adds typescript support to [ ` eslint-plugin-import ` ] ( https://www.npmjs.com/package/eslint-plugin-import ) .
66
77This means you can:
88
99- ` import ` /` require ` files with extension ` .ts ` /` .tsx ` !
1010- Use [ ` paths ` ] ( https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping ) defined in ` tsconfig.json ` .
11+ - prefer resolve ` @types/* ` definitions over plain ` .js `
12+ - Multiple tsconfigs just like normal
1113
1214## Installation
1315
14- ``` bash
15- npm install --save-dev eslint-plugin-import @typescript-eslint/parser eslint-import-resolver-typescript
16+ ``` sh
17+ # npm
18+ npm i -D eslint-plugin-import @typescript-eslint/parser eslint-import-resolver-ts
19+
20+ # yarn
21+ yarn add -D eslint-plugin-import @typescript-eslint/parser eslint-import-resolver-ts
1622```
1723
1824## Configuration
@@ -32,30 +38,30 @@ Add the following to your `.eslintrc` config:
3238 },
3339 " import/resolver" : {
3440 // use <root>/tsconfig.json
35- " typescript " : {},
41+ " ts " : {},
3642
3743 // use <root>/path/to/folder/tsconfig.json
38- " typescript " : {
44+ " ts " : {
3945 " directory" : " ./path/to/folder"
4046 },
4147
4248 // Multiple tsconfigs (Useful for monorepos)
4349
4450 // use a glob pattern
45- " typescript " : {
51+ " ts " : {
4652 " directory" : " ./packages/**/tsconfig.json"
4753 },
4854
4955 // use an array
50- " typescript " : {
56+ " ts " : {
5157 " directory" : [
5258 " ./packages/module-a/tsconfig.json" ,
5359 " ./packages/module-b/tsconfig.json"
5460 ]
5561 },
5662
5763 // use an array of glob patterns
58- " typescript " : {
64+ " ts " : {
5965 " directory" : [
6066 " ./packages/**/tsconfig.json" ,
6167 " ./other-packages/**/tsconfig.json"
@@ -73,5 +79,6 @@ Add the following to your `.eslintrc` config:
7379- Make sure that ` npm test ` passes without a failure.
7480- Make sure your code is formatted ` npm format ` .
7581
76- We have an [ automatic travis build] ( https://travis-ci.org/alexgorbatchev/eslint-import-resolver-typescript ) which will run the above on your PRs.
82+ We have an [ automatic travis build] ( https://travis-ci.org/rx-ts/eslint-import-resolver-ts ) which will run the above on your PRs.
83+
7784If either fails, we won't be able to merge your PR until it's fixed.
0 commit comments