Skip to content

Commit

Permalink
chore(eslint): add tsconfig parserOptions only for ts,tsx
Browse files Browse the repository at this point in the history
`eslint` complains about `parserOptions.project` configuration in files
that aren't specified in `tsconfig.json` (like `babel.config.js`). This
change moves the parser configuration to an `overrides` section
specifically for `ts` and `tsx` files.
  • Loading branch information
with-heart committed Nov 6, 2020
1 parent 20b7b8a commit 67e8b28
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 10,
"project": "tsconfig.json",
"ecmaFeatures": {
"jsx": true
}
Expand Down Expand Up @@ -65,5 +64,13 @@
"react/sort-prop-types": "error",
"react/prop-types": "off",
"@typescript-eslint/no-shadow": "off"
}
},
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"parserOptions": {
"project": ["tsconfig.json"]
}
}
]
}

0 comments on commit 67e8b28

Please sign in to comment.