Skip to content

Commit

Permalink
feat(eslint-plugin): final final config changes for v6 (#7157)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
JoshuaKGoldberg committed Jul 4, 2023
1 parent 42fe29f commit e35c5c1
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 12 deletions.
Expand Up @@ -16,6 +16,7 @@ export = {
'@typescript-eslint/no-base-to-string': 'error',
'@typescript-eslint/no-duplicate-enum-values': 'error',
'@typescript-eslint/no-duplicate-type-constituents': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-extra-non-null-assertion': 'error',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-for-in-array': 'error',
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-plugin/src/configs/recommended.ts
Expand Up @@ -13,6 +13,7 @@ export = {
'no-array-constructor': 'off',
'@typescript-eslint/no-array-constructor': 'error',
'@typescript-eslint/no-duplicate-enum-values': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-extra-non-null-assertion': 'error',
'no-loss-of-precision': 'off',
'@typescript-eslint/no-loss-of-precision': 'error',
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-plugin/src/configs/strict-type-checked.ts
Expand Up @@ -14,6 +14,7 @@ export = {
'no-array-constructor': 'off',
'@typescript-eslint/no-array-constructor': 'error',
'@typescript-eslint/no-base-to-string': 'error',
'@typescript-eslint/no-confusing-void-expression': 'error',
'@typescript-eslint/no-duplicate-enum-values': 'error',
'@typescript-eslint/no-duplicate-type-constituents': 'error',
'@typescript-eslint/no-dynamic-delete': 'error',
Expand Down
2 changes: 0 additions & 2 deletions packages/eslint-plugin/src/configs/stylistic-type-checked.ts
Expand Up @@ -19,7 +19,6 @@ export = {
'dot-notation': 'off',
'@typescript-eslint/dot-notation': 'error',
'@typescript-eslint/no-confusing-non-null-assertion': 'error',
'@typescript-eslint/no-confusing-void-expression': 'error',
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': 'error',
'@typescript-eslint/no-empty-interface': 'error',
Expand All @@ -31,6 +30,5 @@ export = {
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
'@typescript-eslint/sort-type-constituents': 'error',
},
};
1 change: 0 additions & 1 deletion packages/eslint-plugin/src/configs/stylistic.ts
Expand Up @@ -25,6 +25,5 @@ export = {
'@typescript-eslint/prefer-function-type': 'error',
'@typescript-eslint/prefer-namespace-keyword': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/sort-type-constituents': 'error',
},
};
Expand Up @@ -28,7 +28,7 @@ export default util.createRule<Options, MessageId>({
docs: {
description:
'Require expressions of type void to appear in statement position',
recommended: 'stylistic',
recommended: 'strict',
requiresTypeChecking: true,
},
messages: {
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/rules/no-explicit-any.ts
Expand Up @@ -17,7 +17,7 @@ export default util.createRule<Options, MessageIds>({
type: 'suggestion',
docs: {
description: 'Disallow the `any` type',
recommended: 'strict',
recommended: 'recommended',
},
fixable: 'code',
hasSuggestions: true,
Expand Down
1 change: 0 additions & 1 deletion packages/eslint-plugin/src/rules/sort-type-constituents.ts
Expand Up @@ -112,7 +112,6 @@ export default util.createRule<Options, MessageIds>({
docs: {
description:
'Enforce constituents of a type union/intersection to be sorted alphabetically',
recommended: 'stylistic',
},
fixable: 'code',
hasSuggestions: true,
Expand Down
Expand Up @@ -145,7 +145,7 @@ export default util.createRule<Options, MessageId>({
allowNullableBoolean: false,
allowNullableString: false,
allowNullableNumber: false,
allowNullableEnum: true,
allowNullableEnum: false,
allowAny: false,
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,
},
Expand Down
@@ -1 +1 @@
var foo: any = true;
var foo: unknown = true;
Expand Up @@ -11,7 +11,7 @@ exports[`recommended-does-not-require-program should lint successfully 1`] = `
"messages": [
{
"column": 7,
"endColumn": 15,
"endColumn": 19,
"endLine": 1,
"line": 1,
"message": "'foo' is assigned a value but never used.",
Expand All @@ -21,7 +21,7 @@ exports[`recommended-does-not-require-program should lint successfully 1`] = `
"severity": 2,
},
],
"output": "const foo: any = true;
"output": "const foo: unknown = true;
",
"suppressedMessages": [],
"usedDeprecatedRules": [],
Expand Down
2 changes: 0 additions & 2 deletions packages/typescript-estree/src/ts-estree/ts-nodes.ts
Expand Up @@ -21,7 +21,6 @@ declare module 'typescript' {

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

/* eslint-disable @typescript-eslint/sort-type-constituents */
export type TSNode =
| ts.AssertClause
| ts.AssertEntry
Expand Down Expand Up @@ -216,4 +215,3 @@ export type TSNode =
| ts.JSDocOptionalType
| ts.JSDocVariadicType
| ts.JSDocAuthorTag;
/* eslint-enable @typescript-eslint/sort-type-constituents */

0 comments on commit e35c5c1

Please sign in to comment.