diff --git a/packages/eslint-plugin/src/configs/recommended-type-checked.ts b/packages/eslint-plugin/src/configs/recommended-type-checked.ts index 6be755c48e7..ab0f5039461 100644 --- a/packages/eslint-plugin/src/configs/recommended-type-checked.ts +++ b/packages/eslint-plugin/src/configs/recommended-type-checked.ts @@ -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', diff --git a/packages/eslint-plugin/src/configs/recommended.ts b/packages/eslint-plugin/src/configs/recommended.ts index 0f817d7681b..d8654cd45e0 100644 --- a/packages/eslint-plugin/src/configs/recommended.ts +++ b/packages/eslint-plugin/src/configs/recommended.ts @@ -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', diff --git a/packages/eslint-plugin/src/configs/strict-type-checked.ts b/packages/eslint-plugin/src/configs/strict-type-checked.ts index b666e4f1cb6..dfba0b81c7f 100644 --- a/packages/eslint-plugin/src/configs/strict-type-checked.ts +++ b/packages/eslint-plugin/src/configs/strict-type-checked.ts @@ -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', diff --git a/packages/eslint-plugin/src/configs/stylistic-type-checked.ts b/packages/eslint-plugin/src/configs/stylistic-type-checked.ts index ed9e23dae4a..5c73ae3845b 100644 --- a/packages/eslint-plugin/src/configs/stylistic-type-checked.ts +++ b/packages/eslint-plugin/src/configs/stylistic-type-checked.ts @@ -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', @@ -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', }, }; diff --git a/packages/eslint-plugin/src/configs/stylistic.ts b/packages/eslint-plugin/src/configs/stylistic.ts index ed5ce3ded8c..fd95427bef4 100644 --- a/packages/eslint-plugin/src/configs/stylistic.ts +++ b/packages/eslint-plugin/src/configs/stylistic.ts @@ -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', }, }; diff --git a/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts b/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts index ab6f08c1bb5..66ac9e28c51 100644 --- a/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts +++ b/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts @@ -28,7 +28,7 @@ export default util.createRule({ docs: { description: 'Require expressions of type void to appear in statement position', - recommended: 'stylistic', + recommended: 'strict', requiresTypeChecking: true, }, messages: { diff --git a/packages/eslint-plugin/src/rules/no-explicit-any.ts b/packages/eslint-plugin/src/rules/no-explicit-any.ts index 3e92039827d..fd2ddeefbe2 100644 --- a/packages/eslint-plugin/src/rules/no-explicit-any.ts +++ b/packages/eslint-plugin/src/rules/no-explicit-any.ts @@ -17,7 +17,7 @@ export default util.createRule({ type: 'suggestion', docs: { description: 'Disallow the `any` type', - recommended: 'strict', + recommended: 'recommended', }, fixable: 'code', hasSuggestions: true, diff --git a/packages/eslint-plugin/src/rules/sort-type-constituents.ts b/packages/eslint-plugin/src/rules/sort-type-constituents.ts index ec54153e988..fd975d42073 100644 --- a/packages/eslint-plugin/src/rules/sort-type-constituents.ts +++ b/packages/eslint-plugin/src/rules/sort-type-constituents.ts @@ -112,7 +112,6 @@ export default util.createRule({ docs: { description: 'Enforce constituents of a type union/intersection to be sorted alphabetically', - recommended: 'stylistic', }, fixable: 'code', hasSuggestions: true, diff --git a/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts b/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts index 3e0d60d48ce..6ea73c6e299 100644 --- a/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts +++ b/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts @@ -145,7 +145,7 @@ export default util.createRule({ allowNullableBoolean: false, allowNullableString: false, allowNullableNumber: false, - allowNullableEnum: true, + allowNullableEnum: false, allowAny: false, allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false, }, diff --git a/packages/integration-tests/fixtures/recommended-does-not-require-program/index.ts b/packages/integration-tests/fixtures/recommended-does-not-require-program/index.ts index cf187492f17..5c59896bad3 100644 --- a/packages/integration-tests/fixtures/recommended-does-not-require-program/index.ts +++ b/packages/integration-tests/fixtures/recommended-does-not-require-program/index.ts @@ -1 +1 @@ -var foo: any = true; +var foo: unknown = true; diff --git a/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap b/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap index db6b4a80644..83a2f0129c9 100644 --- a/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap +++ b/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap @@ -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.", @@ -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": [], diff --git a/packages/typescript-estree/src/ts-estree/ts-nodes.ts b/packages/typescript-estree/src/ts-estree/ts-nodes.ts index 27d89b0f4f6..ceb3ab17ed6 100644 --- a/packages/typescript-estree/src/ts-estree/ts-nodes.ts +++ b/packages/typescript-estree/src/ts-estree/ts-nodes.ts @@ -21,7 +21,6 @@ declare module 'typescript' { export type TSToken = ts.Token; -/* eslint-disable @typescript-eslint/sort-type-constituents */ export type TSNode = | ts.AssertClause | ts.AssertEntry @@ -216,4 +215,3 @@ export type TSNode = | ts.JSDocOptionalType | ts.JSDocVariadicType | ts.JSDocAuthorTag; -/* eslint-enable @typescript-eslint/sort-type-constituents */