Skip to content

Commit

Permalink
feat: update eslint packages to stable latest versions (#7277)
Browse files Browse the repository at this point in the history
* feat: update eslint packages to stable latest versions

not v9 for now since lots of breaking changes
plugin prettier also v4 for now, v5 breaks due to

* fix: add back missed storybook lint import

* fix: remove react-app eslint rules due to incompatibility with eslint

since we are still on CRA4

* fix: add react-hooks eslint plugin since react-app plugin is removed

* feat: add eslint rules to ignore explicit anys in test code

# Conflicts:
#	.eslintrc

* fix: ALL LINT ERRORS DUE TO ANYS

* feat: add looser eslint rules for test files
  • Loading branch information
karrui committed May 15, 2024
1 parent 337ef43 commit e5a020f
Show file tree
Hide file tree
Showing 29 changed files with 5,796 additions and 3,646 deletions.
10 changes: 8 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,16 @@
"typesafe/no-throw-sync-func": "error"
}
},
{ "files": ["*.spec.ts"], "extends": ["plugin:jest/recommended"] },
{
"files": ["**/*.spec.ts", "**/__tests__/**/*.ts"],
"extends": ["plugin:jest/recommended"],
"rules": {
"@typescript-eslint/no-explicit-any": "off"
}
},
{
"files": ["*.ts", "*.js"],
"excludedFiles": ["**/*.spec.ts", "**/.spec.js", "**/__tests__/**/*.ts"],
"excludedFiles": ["**/*.spec.ts", "**/__tests__/**/*.ts"],
"rules": {
"@typescript-eslint/no-non-null-assertion": "error"
}
Expand Down
3 changes: 3 additions & 0 deletions __tests__/e2e/utils/field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ export const createMyInfoField = (
...fieldBase,
ValidationOptions: { selectedValidation: null, customVal: null },
}
default:
// eslint-disable-next-line typesafe/no-throw-sync-func
throw new Error(`Unimplemented MyInfo field type: ${fieldType}`)
}
}

Expand Down
11 changes: 7 additions & 4 deletions frontend/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
"extends": [
"eslint:recommended",
"plugin:prettier/recommended",
"plugin:storybook/recommended"
"plugin:storybook/recommended",
"plugin:react-hooks/recommended"
],
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"extends": ["react-app", "plugin:@typescript-eslint/recommended"],
"extends": ["plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"rules": {
"@typescript-eslint/no-unused-vars": "warn"
Expand All @@ -26,10 +27,12 @@
"**/__tests__/**/*.[jt]s?(x)",
"**/?(*.)+(spec|test).[jt]s?(x)"
],
"extends": ["react-app/jest", "plugin:testing-library/react"],
"extends": ["plugin:testing-library/react"],
"rules": {
"@typescript-eslint/no-non-null-assertion": "off",
"testing-library/no-unnecessary-act": "off"
"testing-library/no-unnecessary-act": "off",
"@typescript-eslint/no-explicit-any": "off",
"no-unsafe-optional-chaining": "off"
}
}
],
Expand Down
Loading

0 comments on commit e5a020f

Please sign in to comment.