From c8dfcdfe75600e87d1c8c3631be9168832551d8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Litera?= Date: Thu, 14 Dec 2023 08:21:46 +0100 Subject: [PATCH] Feat(eslint-config-typescript): Supperessions of errors are allowed * but only with description * otherwise it will not raise an error but only warn closes #127 --- packages/eslint-config-typescript/index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/eslint-config-typescript/index.js b/packages/eslint-config-typescript/index.js index 605cf94..3238961 100644 --- a/packages/eslint-config-typescript/index.js +++ b/packages/eslint-config-typescript/index.js @@ -48,6 +48,18 @@ module.exports = { '@typescript-eslint/no-use-before-define': 'warn', 'no-use-before-define': 'off', + // Allow alter TypesScript's compiler errors only with description + // This rule will warn only when you use ts-expect-error, ts-ignore, ts-nocheck without description + // @see: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/ban-ts-comment.md + '@typescript-eslint/ban-ts-comment': [ + 'warn', + { + 'ts-expect-error': 'allow-with-description', + 'ts-ignore': 'allow-with-description', + 'ts-nocheck': 'allow-with-description', + }, + ], + // TS code is mostly self-documented and having JSDoc directives for everything is redundant // when you can easily infer return values and argument types from the code itself. 'jsdoc/require-jsdoc': 'off',