Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(eslint-plugin): final final config changes for v6 #7157

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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',
},
};
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default util.createRule<Options, MessageIds>({
type: 'suggestion',
docs: {
description: 'Disallow the `any` type',
recommended: 'strict',
recommended: 'recommended',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v happy with this!

},
fixable: 'code',
hasSuggestions: true,
Expand Down
1 change: 0 additions & 1 deletion packages/eslint-plugin/src/rules/sort-type-constituents.ts
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export default util.createRule<Options, MessageId>({
allowNullableBoolean: false,
allowNullableString: false,
allowNullableNumber: false,
allowNullableEnum: true,
allowNullableEnum: false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is much safer so happy to see this!

allowAny: false,
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
var foo: any = true;
var foo: unknown = true;
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 */