11# eslint-import-resolver-ts
22
3+ [ ![ GitHub Actions] ( https://github.com/rx-ts/eslint-import-resolver-ts/workflows/Node%20CI/badge.svg )] ( https://github.com/rx-ts/eslint-import-resolver-ts/actions )
34[ ![ Travis] ( https://img.shields.io/travis/com/rx-ts/eslint-import-resolver-ts.svg )] ( https://travis-ci.com/rx-ts/eslint-import-resolver-ts )
5+ [ ![ type-coverage] ( https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Frx-ts%2Feslint-import-resolver-ts%2Fmaster%2Fpackage.json )] ( https://github.com/plantain-00/type-coverage )
6+ [ ![ npm] ( https://img.shields.io/npm/v/eslint-import-resolver-ts.svg )] ( https://www.npmjs.com/package/eslint-import-resolver-ts )
7+ [ ![ GitHub Release] ( https://img.shields.io/github/release/rx-ts/eslint-import-resolver-ts )] ( https://github.com/rx-ts/eslint-import-resolver-ts/releases )
48
5- This plugin adds typescript support to [ ` eslint-plugin-import ` ] ( https://www.npmjs.com/package/eslint-plugin-import ) .
9+ [ ![ David Peer] ( https://img.shields.io/david/peer/rx-ts/eslint-import-resolver-ts.svg )] ( https://david-dm.org/rx-ts/eslint-import-resolver-ts?type=peer )
10+ [ ![ David] ( https://img.shields.io/david/rx-ts/eslint-import-resolver-ts.svg )] ( https://david-dm.org/rx-ts/eslint-import-resolver-ts )
11+ [ ![ David Dev] ( https://img.shields.io/david/dev/rx-ts/eslint-import-resolver-ts.svg )] ( https://david-dm.org/rx-ts/eslint-import-resolver-ts?type=dev )
12+
13+ [ ![ Conventional Commits] ( https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg )] ( https://conventionalcommits.org )
14+ [ ![ JavaScript Style Guide] ( https://img.shields.io/badge/code_style-standard-brightgreen.svg )] ( https://standardjs.com )
15+ [ ![ Code Style: Prettier] ( https://img.shields.io/badge/code_style-prettier-ff69b4.svg )] ( https://github.com/prettier/prettier )
16+ [ ![ codechecks.io] ( https://raw.githubusercontent.com/codechecks/docs/master/images/badges/badge-default.svg?sanitize=true )] ( https://codechecks.io )
17+
18+ This plugin adds TypeScript support to [ ` eslint-plugin-import ` ] ( https://www.npmjs.com/package/eslint-plugin-import ) .
619
720This means you can:
821
922- ` import ` /` require ` files with extension ` .ts ` /` .tsx ` !
1023- 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
24+ - Prefer resolve ` @types/* ` definitions over plain ` .js ` .
25+ - Multiple tsconfigs support just like normal.
26+
27+ ## TOC <!-- omit in toc -->
28+
29+ - [ Installation] ( #installation )
30+ - [ Configuration] ( #configuration )
31+ - [ Contributing] ( #contributing )
1332
1433## Installation
1534
@@ -25,7 +44,7 @@ yarn add -D eslint-plugin-import @typescript-eslint/parser eslint-import-resolve
2544
2645Add the following to your ` .eslintrc ` config:
2746
28- ``` JSONC
47+ ``` jsonc
2948{
3049 " plugins" : [" import" ],
3150 " rules" : {
@@ -38,7 +57,9 @@ Add the following to your `.eslintrc` config:
3857 },
3958 " import/resolver" : {
4059 // use <root>/tsconfig.json
41- " ts" : {},
60+ " ts" : {
61+ " alwaysTryTypes" : true // always try to resolve types under `<roo/>@types` directory even it doesn't contain any source code, like `@types/unist`
62+ },
4263
4364 // use <root>/path/to/folder/tsconfig.json
4465 " ts" : {
@@ -75,9 +96,10 @@ Add the following to your `.eslintrc` config:
7596## Contributing
7697
7798- Make sure your change is covered by a test import.
78- - Make sure that ` npm test ` passes without a failure.
79- - Make sure your code is formatted ` npm format ` .
99+ - Make sure that ` yarn test ` passes without a failure.
100+ - Make sure that ` yarn lint ` passes without conflicts.
101+ - Make sure your code changes match our [ type-coverage] ( https://github.com/plantain-00/type-coverage ) settings: ` yarn type-coverage ` .
80102
81- We have an [ automatic travis build ] ( https://travis-ci.org /rx-ts/eslint-import-resolver-ts ) which will run the above on your PRs.
103+ We have [ GitHub Actions ] ( https://github.com /rx-ts/eslint-import-resolver-ts/actions ) which will run the above commands on your PRs.
82104
83105If either fails, we won't be able to merge your PR until it's fixed.
0 commit comments