Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: upgraded @typescript-eslint* to v6.7 #182

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 36 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ module.exports = {
extends: [
// Base recommended set of rules
"eslint:recommended",
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin/src/configs
// recommended extends @typescript-eslint/eslint-recommended which disables some of eslint:recommended
"plugin:@typescript-eslint/recommended",

// https://typescript-eslint.io/linting/configs/#recommended-configurations
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic",

// Additional recommended react rules
"plugin:react/recommended",
// Additional recommended react-hooks rules
Expand Down Expand Up @@ -203,6 +205,25 @@ module.exports = {
],
},
],

// Relax some @typescript-eslint/recommended-type-checked rules
// Sometimes we use any type implictely, because we don't have the type at all
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-enum-comparison": "off",
"@typescript-eslint/no-unsafe-member-access": "off",

// Allow to serialize caught variables like `${err}` (because err would have unknown type by default)
"@typescript-eslint/restrict-template-expressions": "off",

// Relax some @typescript-eslint/stylistic rules
// Allow to use indexed objects
"@typescript-eslint/consistent-indexed-object-style": "off",
// Allow to use interfaces and types
"@typescript-eslint/consistent-type-definitions": "off",
// Allow to use T[] and Array<T>
"@typescript-eslint/array-type": "off",
},
overrides: [
// Typescript overrides
Expand All @@ -219,6 +240,18 @@ module.exports = {
// Allow assertion operator in unit tests because TS does not recognize
// jest expects such as toBeDefined() or not.toBeNull() as type-validating
"@typescript-eslint/no-non-null-assertion": "off",
// Lots of tests can have async test callback, for consistency and easy update
// Allow to have them without await in the callback body, because side effect in tests are minimal
"@typescript-eslint/require-await": "off",
},
},
// TSOA/Nest Overrides
{
files: ["**/controllers/**"],
rules: {
// Some annotations helpers must be used but explicitly return any
// Disable them for those cases
"@typescript-eslint/no-unsafe-return": "off",
},
},
// Storybook overrides
Expand Down
Loading
Loading