Skip to content

Commit 5fe9aa4

Browse files
JounQinljharb
authored andcommitted
[readme] clarify eslint-import-resolver-typescript usage
1 parent 0ef8cba commit 5fe9aa4

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

Diff for: CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
2424
- [Docs] `order`: use correct default value ([#2392], thanks [@hyperupcall])
2525
- [meta] replace git.io link in comments with the original URL ([#2444], thanks [@liby])
2626
- [Docs] remove global install in readme ([#2412], thanks [@aladdin-add])
27+
- [readme] clarify `eslint-import-resolver-typescript` usage ([#2503], thanks [@JounQin])
2728

2829
## [2.26.0] - 2022-04-05
2930

@@ -996,6 +997,7 @@ for info on changes for earlier releases.
996997

997998
[`memo-parser`]: ./memo-parser/README.md
998999

1000+
[#2503]: https://github.com/import-js/eslint-plugin-import/pull/2503
9991001
[#2490]: https://github.com/import-js/eslint-plugin-import/pull/2490
10001002
[#2466]: https://github.com/import-js/eslint-plugin-import/pull/2466
10011003
[#2440]: https://github.com/import-js/eslint-plugin-import/pull/2440

Diff for: README.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -157,19 +157,24 @@ rules:
157157

158158
You may use the following shortcut or assemble your own config using the granular settings described below.
159159

160-
Make sure you have installed [`@typescript-eslint/parser`] which is used in the following configuration. Unfortunately NPM does not allow to list optional peer dependencies.
160+
Make sure you have installed [`@typescript-eslint/parser`] and [`eslint-import-resolver-typescript`] which are used in the following configuration.
161161

162162
```yaml
163163
extends:
164164
- eslint:recommended
165165
- plugin:import/recommended
166-
- plugin:import/typescript # this line does the trick
166+
# the following lines do the trick
167+
- plugin:import/typescript
168+
settings:
169+
import/resolver:
170+
# You will also need to install and configure the TypeScript resolver
171+
# See also https://github.com/import-js/eslint-import-resolver-typescript#configuration
172+
typescript: true
173+
node: true
167174
```
168175
169176
[`@typescript-eslint/parser`]: https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser
170-
171-
You will also need to install and configure the TypeScript resolver:
172-
[`eslint-import-resolver-typescript`](https://github.com/alexgorbatchev/eslint-import-resolver-typescript).
177+
[`eslint-import-resolver-typescript`]: https://github.com/import-js/eslint-import-resolver-typescript
173178

174179
# Resolvers
175180

0 commit comments

Comments
 (0)