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

Feat(eslint-config-typescript): Supperessions of errors are allowed #165

Merged
merged 1 commit into from
Dec 14, 2023
Merged
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
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