Skip to content
Permalink
Browse files

feat(eslint-plugin): [ban-ts-comment] change default for `ts-expect-e…

…rror` to `allow-with-description` (#2351)

BREAKING CHANGE:

Default rule options is a breaking change.
Fixes #2146
  • Loading branch information
bradzacher committed Aug 29, 2020
1 parent c70f54f commit a3f163abc03f0fefc6dca1f205b728a4425209e4
@@ -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,
@@ -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();

0 comments on commit a3f163a

Please sign in to comment.
You can’t perform that action at this time.