Skip to content

Commit 5cd4eb0

Browse files
authored
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
1 parent 04f5d6c commit 5cd4eb0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@ Add the following to your `.eslintrc` config:
2121

2222
```CJSON
2323
{
24-
"parser": "typescript-eslint-parser",
2524
"plugins": ["import"],
2625
"rules": {
2726
// turn on errors for missing imports
2827
"import/no-unresolved": "error"
2928
},
3029
"settings": {
30+
"import/parsers": {
31+
"typescript-eslint-parser": [".ts", ".tsx"]
32+
},
3133
"import/resolver": {
3234
// use <root>/tsconfig.json
3335
"typescript": {},
@@ -41,6 +43,7 @@ Add the following to your `.eslintrc` config:
4143
}
4244
```
4345

46+
4447
## Contributing
4548

4649
- Make sure your change is covered by a test import.

0 commit comments

Comments
 (0)