From 1e68c469e1d569bf55c7bc462f3aa0022f99a1ea Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Mon, 3 Aug 2020 08:57:04 -0700 Subject: [PATCH] feat(eslint-plugin): [ban-ts-comment] change default for `ts-expect-error` to `allow-with-description` Fixes #2146 BREAKING CHANGE: Default rule options is a breaking change. --- .../docs/rules/ban-ts-comment.md | 2 +- .../eslint-plugin/src/rules/ban-ts-comment.ts | 20 +++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/ban-ts-comment.md b/packages/eslint-plugin/docs/rules/ban-ts-comment.md index 60e6508d3bd3..2509793ebd37 100644 --- a/packages/eslint-plugin/docs/rules/ban-ts-comment.md +++ b/packages/eslint-plugin/docs/rules/ban-ts-comment.md @@ -29,7 +29,7 @@ interface Options { } const defaultOptions: Options = { - 'ts-expect-error': true, + 'ts-expect-error': 'allow-with-description', 'ts-ignore': true, 'ts-nocheck': true, 'ts-check': false, diff --git a/packages/eslint-plugin/src/rules/ban-ts-comment.ts b/packages/eslint-plugin/src/rules/ban-ts-comment.ts index 3eccf04ced20..f8c688415987 100644 --- a/packages/eslint-plugin/src/rules/ban-ts-comment.ts +++ b/packages/eslint-plugin/src/rules/ban-ts-comment.ts @@ -11,16 +11,6 @@ interface Options { export const defaultMinimumDescriptionLength = 3; -const defaultOptions: [Options] = [ - { - 'ts-expect-error': true, - 'ts-ignore': true, - 'ts-nocheck': true, - 'ts-check': false, - minimumDescriptionLength: defaultMinimumDescriptionLength, - }, -]; - type MessageIds = | 'tsDirectiveComment' | 'tsDirectiveCommentRequiresDescription'; @@ -98,7 +88,15 @@ export default util.createRule<[Options], MessageIds>({ }, ], }, - defaultOptions, + defaultOptions: [ + { + 'ts-expect-error': 'allow-with-description', + 'ts-ignore': true, + 'ts-nocheck': true, + 'ts-check': false, + minimumDescriptionLength: defaultMinimumDescriptionLength, + }, + ], create(context, [options]) { const tsCommentRegExp = /^\/*\s*@ts-(expect-error|ignore|check|nocheck)(.*)/; const sourceCode = context.getSourceCode(); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy