From 5cd4eb08dd68e3bb16e9f9a1afde9a62d550025a Mon Sep 17 00:00:00 2001 From: Andrew Fuller <2483304+ajfuller@users.noreply.github.com> Date: Wed, 9 Jan 2019 11:52:33 -0500 Subject: [PATCH] Change recommended configuration so that the `typescript-eslint-parser` is only used for `import` plugin rather than globally Presumably this is being used while people convert over to TypesScript, so scoping it to the individual plugin settings can prevent unrelated issues from popping up. We noticed some additional errors when changing the global parser, so this was the fix that worked in our case and follows the structure from the`eslint-plugin-import` docs https://github.com/benmosher/eslint-plugin-import#importparsers --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1a92f0d..39a5cd9 100644 --- a/README.md +++ b/README.md @@ -21,13 +21,15 @@ Add the following to your `.eslintrc` config: ```CJSON { - "parser": "typescript-eslint-parser", "plugins": ["import"], "rules": { // turn on errors for missing imports "import/no-unresolved": "error" }, "settings": { + "import/parsers": { + "typescript-eslint-parser": [".ts", ".tsx"] + }, "import/resolver": { // use /tsconfig.json "typescript": {}, @@ -41,6 +43,7 @@ Add the following to your `.eslintrc` config: } ``` + ## Contributing - Make sure your change is covered by a test import.