Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e35c5c1

Browse files
feat(eslint-plugin): final final config changes for v6 (typescript-eslint#7157)
* feat(eslint-plugin): final final config changes for v6 * yarn generate:configs * Fix unused lint suppression complaint and test snapshot * unknown, not any, in recommended-does-not-require-program * Updated endColumn
1 parent 42fe29f commit e35c5c1

File tree

12 files changed

+9
-12
lines changed

12 files changed

+9
-12
lines changed

packages/eslint-plugin/src/configs/recommended-type-checked.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export = {
1616
'@typescript-eslint/no-base-to-string': 'error',
1717
'@typescript-eslint/no-duplicate-enum-values': 'error',
1818
'@typescript-eslint/no-duplicate-type-constituents': 'error',
19+
'@typescript-eslint/no-explicit-any': 'error',
1920
'@typescript-eslint/no-extra-non-null-assertion': 'error',
2021
'@typescript-eslint/no-floating-promises': 'error',
2122
'@typescript-eslint/no-for-in-array': 'error',

packages/eslint-plugin/src/configs/recommended.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export = {
1313
'no-array-constructor': 'off',
1414
'@typescript-eslint/no-array-constructor': 'error',
1515
'@typescript-eslint/no-duplicate-enum-values': 'error',
16+
'@typescript-eslint/no-explicit-any': 'error',
1617
'@typescript-eslint/no-extra-non-null-assertion': 'error',
1718
'no-loss-of-precision': 'off',
1819
'@typescript-eslint/no-loss-of-precision': 'error',

packages/eslint-plugin/src/configs/strict-type-checked.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export = {
1414
'no-array-constructor': 'off',
1515
'@typescript-eslint/no-array-constructor': 'error',
1616
'@typescript-eslint/no-base-to-string': 'error',
17+
'@typescript-eslint/no-confusing-void-expression': 'error',
1718
'@typescript-eslint/no-duplicate-enum-values': 'error',
1819
'@typescript-eslint/no-duplicate-type-constituents': 'error',
1920
'@typescript-eslint/no-dynamic-delete': 'error',

packages/eslint-plugin/src/configs/stylistic-type-checked.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export = {
1919
'dot-notation': 'off',
2020
'@typescript-eslint/dot-notation': 'error',
2121
'@typescript-eslint/no-confusing-non-null-assertion': 'error',
22-
'@typescript-eslint/no-confusing-void-expression': 'error',
2322
'no-empty-function': 'off',
2423
'@typescript-eslint/no-empty-function': 'error',
2524
'@typescript-eslint/no-empty-interface': 'error',
@@ -31,6 +30,5 @@ export = {
3130
'@typescript-eslint/prefer-nullish-coalescing': 'error',
3231
'@typescript-eslint/prefer-optional-chain': 'error',
3332
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
34-
'@typescript-eslint/sort-type-constituents': 'error',
3533
},
3634
};

packages/eslint-plugin/src/configs/stylistic.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,5 @@ export = {
2525
'@typescript-eslint/prefer-function-type': 'error',
2626
'@typescript-eslint/prefer-namespace-keyword': 'error',
2727
'@typescript-eslint/prefer-optional-chain': 'error',
28-
'@typescript-eslint/sort-type-constituents': 'error',
2928
},
3029
};

packages/eslint-plugin/src/rules/no-confusing-void-expression.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default util.createRule<Options, MessageId>({
2828
docs: {
2929
description:
3030
'Require expressions of type void to appear in statement position',
31-
recommended: 'stylistic',
31+
recommended: 'strict',
3232
requiresTypeChecking: true,
3333
},
3434
messages: {

packages/eslint-plugin/src/rules/no-explicit-any.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default util.createRule<Options, MessageIds>({
1717
type: 'suggestion',
1818
docs: {
1919
description: 'Disallow the `any` type',
20-
recommended: 'strict',
20+
recommended: 'recommended',
2121
},
2222
fixable: 'code',
2323
hasSuggestions: true,

packages/eslint-plugin/src/rules/sort-type-constituents.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ export default util.createRule<Options, MessageIds>({
112112
docs: {
113113
description:
114114
'Enforce constituents of a type union/intersection to be sorted alphabetically',
115-
recommended: 'stylistic',
116115
},
117116
fixable: 'code',
118117
hasSuggestions: true,

packages/eslint-plugin/src/rules/strict-boolean-expressions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export default util.createRule<Options, MessageId>({
145145
allowNullableBoolean: false,
146146
allowNullableString: false,
147147
allowNullableNumber: false,
148-
allowNullableEnum: true,
148+
allowNullableEnum: false,
149149
allowAny: false,
150150
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,
151151
},
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
var foo: any = true;
1+
var foo: unknown = true;

packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ exports[`recommended-does-not-require-program should lint successfully 1`] = `
1111
"messages": [
1212
{
1313
"column": 7,
14-
"endColumn": 15,
14+
"endColumn": 19,
1515
"endLine": 1,
1616
"line": 1,
1717
"message": "'foo' is assigned a value but never used.",
@@ -21,7 +21,7 @@ exports[`recommended-does-not-require-program should lint successfully 1`] = `
2121
"severity": 2,
2222
},
2323
],
24-
"output": "const foo: any = true;
24+
"output": "const foo: unknown = true;
2525
",
2626
"suppressedMessages": [],
2727
"usedDeprecatedRules": [],

packages/typescript-estree/src/ts-estree/ts-nodes.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ declare module 'typescript' {
2121

2222
export type TSToken = ts.Token<ts.SyntaxKind>;
2323

24-
/* eslint-disable @typescript-eslint/sort-type-constituents */
2524
export type TSNode =
2625
| ts.AssertClause
2726
| ts.AssertEntry
@@ -216,4 +215,3 @@ export type TSNode =
216215
| ts.JSDocOptionalType
217216
| ts.JSDocVariadicType
218217
| ts.JSDocAuthorTag;
219-
/* eslint-enable @typescript-eslint/sort-type-constituents */

0 commit comments

Comments
 (0)