Skip to content

Commit

Permalink
Feat(eslint-config-typescript): Supperessions of errors are allowed
Browse files Browse the repository at this point in the history
  * but only with description
  * otherwise it will not raise an error but only warn

closes #127
  • Loading branch information
literat committed Dec 14, 2023
1 parent 676d0bf commit 3de8977
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/eslint-config-typescript/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 3de8977

Please sign in to comment.