diff --git a/.eslintrc.js b/.eslintrc.js index e6f1876..15c0237 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -214,6 +214,9 @@ module.exports = { "@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", @@ -237,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 diff --git a/config.json b/config.json index a47777a..9da6bc3 100644 --- a/config.json +++ b/config.json @@ -187,6 +187,9 @@ "@typescript-eslint/no-unsafe-member-access": [ "off" ], + "@typescript-eslint/restrict-template-expressions": [ + "off" + ], "@typescript-eslint/consistent-indexed-object-style": [ "off" ], @@ -1024,9 +1027,6 @@ "@typescript-eslint/restrict-plus-operands": [ "error" ], - "@typescript-eslint/restrict-template-expressions": [ - "error" - ], "@typescript-eslint/triple-slash-reference": [ "error" ], diff --git a/sandbox.ts b/sandbox.ts index 1ae136e..2735b2d 100644 --- a/sandbox.ts +++ b/sandbox.ts @@ -23,6 +23,5 @@ console.log(fs.readSync); // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export const getDummy = (param: unknown) => { - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions console.log(`${dummy} and ${param} a, ${first}, ${pkg.version}`); };