Skip to content

Commit

Permalink
feat: add @typescript-eslint/recommended rules
Browse files Browse the repository at this point in the history
- Disable "@typescript-eslint/no-var-requires" in JS files
- Disable `import/no-unresolved` since TypeScript would ideally handle
that issue
  • Loading branch information
MarkH817 committed Dec 15, 2021
1 parent 920439a commit 6d33824
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"plugins": [
Expand Down Expand Up @@ -60,6 +61,7 @@
"import/newline-after-import": "error",
"import/no-dynamic-require": "error",
"import/no-mutable-exports": "error",
"import/no-unresolved": "off",
"import/order": [
"error",
{
Expand All @@ -78,5 +80,13 @@
"jsx-a11y/no-onchange": "off",
"react/self-closing-comp": "error"
},
"overrides": [
{
"files": ["*.js"],
"rules": {
"@typescript-eslint/no-var-requires": "off"
}
}
],
"settings": { "react": { "version": "latest" } }
}
12 changes: 12 additions & 0 deletions test/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,19 @@ Object {
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
],
"overrides": Array [
Object {
"files": Array [
"*.js",
],
"rules": Object {
"@typescript-eslint/no-var-requires": "off",
},
},
],
"parser": "@typescript-eslint/parser",
"parserOptions": Object {
"ecmaFeatures": Object {
Expand All @@ -43,6 +54,7 @@ Object {
"import/newline-after-import": "error",
"import/no-dynamic-require": "error",
"import/no-mutable-exports": "error",
"import/no-unresolved": "off",
"import/order": Array [
"error",
Object {
Expand Down

0 comments on commit 6d33824

Please sign in to comment.