From d3d88cdd75e9458ad0e4e8c37d7c5185abbdc28c Mon Sep 17 00:00:00 2001 From: JounQin Date: Wed, 20 Jul 2022 15:41:16 +0800 Subject: [PATCH] docs: clarify `eslint-import-resolver-typescript` usage --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6682d5c918..2be573e214 100644 --- a/README.md +++ b/README.md @@ -157,19 +157,23 @@ rules: You may use the following shortcut or assemble your own config using the granular settings described below. -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. +Make sure you have installed [`@typescript-eslint/parser`] and [`eslint-import-resolver-typescript`] which are used in the following configuration. Unfortunately NPM does not allow to list optional peer dependencies. ```yaml extends: - eslint:recommended - plugin:import/recommended - - plugin:import/typescript # this line does the trick +# the following lines do the trick + - plugin:import/typescript +settings: + import/resolver: + # You will also need to install and configure the TypeScript resolver + # See also https://github.com/import-js/eslint-import-resolver-typescript#configuration + typescript: true ``` [`@typescript-eslint/parser`]: https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser - -You will also need to install and configure the TypeScript resolver: -[`eslint-import-resolver-typescript`](https://github.com/alexgorbatchev/eslint-import-resolver-typescript). +[`eslint-import-resolver-typescript`]: https://github.com/import-js/eslint-import-resolver-typescript # Resolvers