Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
fix: missing placeholders in violation messages forno-unnecessary-type-constraint
andno-unsafe-argument
(and enableeslint-plugin/recommended
rules internally)#5453
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
6243463
c4265a7
2ec6bb8
ab5d4d5
ec3fb4b
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -15,6 +15,7 @@ module.exports = { | ||
}, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:eslint-plugin/recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:@typescript-eslint/recommended-requiring-type-checking', | ||
], | ||
@@ -194,7 +195,7 @@ module.exports = { | ||
'@typescript-eslint/no-unsafe-call': 'off', | ||
'@typescript-eslint/no-unsafe-member-access': 'off', | ||
'@typescript-eslint/no-unsafe-return': 'off', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This rule is now included in the | ||
'eslint-plugin/consistent-output': 'off', // Might eventually be removed from `eslint-plugin/recommended`: https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/issues/284 | ||
'jest/no-disabled-tests': 'warn', | ||
'jest/no-focused-tests': 'error', | ||
'jest/no-alias-methods': 'error', | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -9,7 +9,7 @@ export default util.createRule({ | ||
description: 'Disallow duplicate enum member values', | ||
recommended: 'strict', | ||
}, | ||
hasSuggestions:false, | ||
ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Many of these rules indicated they had suggestions but do not actually provide suggestions. Caught by theeslint-plugin/require-meta-has-suggestions rule. | ||
messages: { | ||
duplicateValue: 'Duplicate enum member value {{value}}.', | ||
}, | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -15,10 +15,9 @@ export default util.createRule<Options, MessageIds>({ | ||
docs: { | ||
description: 'Disallow the declaration of empty interfaces', | ||
recommended: 'error', | ||
ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This | ||
}, | ||
fixable: 'code', | ||
hasSuggestions: true, // eslint-disable-line eslint-plugin/require-meta-has-suggestions -- https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/issues/272 | ||
messages: { | ||
noEmpty: 'An empty interface is equivalent to `{}`.', | ||
noEmptyWithSuper: | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -31,7 +31,6 @@ export default util.createRule({ | ||
docs: { | ||
description: 'Disallow unnecessary constraints on generic types', | ||
recommended: 'error', | ||
}, | ||
hasSuggestions: true, | ||
messages: { | ||
@@ -89,6 +88,9 @@ export default util.createRule({ | ||
suggest: [ | ||
{ | ||
messageId: 'removeUnnecessaryConstraint', | ||
data: { | ||
constraint, | ||
ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This is an actual bug. This data was missing for the suggestion message and would thus show as I can extract this bug fix into a separate PR if desired. Caught by theeslint-plugin/no-missing-placeholders andeslint-plugin/no-unused-placeholders rules. | ||
}, | ||
fix(fixer): TSESLint.RuleFix | null { | ||
return fixer.replaceTextRange( | ||
[node.name.range[1], node.constraint.range[1]], | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -142,7 +142,7 @@ export default util.createRule<[], MessageIds>({ | ||
unsafeArgument: | ||
'Unsafe argument of type `{{sender}}` assigned to a parameter of type `{{receiver}}`.', | ||
unsafeTupleSpread: | ||
'Unsafe spread of a tuple type. Theargumentis of type `{{sender}}` and is assigned to a parameter of type `{{receiver}}`.', | ||
ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This is an actual bug. The I can extract this bug fix into a separate PR if desired. Caught by theeslint-plugin/no-missing-placeholders andeslint-plugin/no-unused-placeholders rules. ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This is an actual bug. There is a typo in the I can extract this bug fix into a separate PR if desired. Caught by theeslint-plugin/no-missing-placeholders andeslint-plugin/no-unused-placeholders rules. | ||
unsafeArraySpread: 'Unsafe spread of an `any` array type.', | ||
unsafeSpread: 'Unsafe spread of an `any` type.', | ||
}, | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -20,6 +20,7 @@ export type MessageIds = InferMessageIdsTypeFromRule<typeof baseRule>; | ||
export default createRule<Options, MessageIds>({ | ||
name: 'object-curly-spacing', | ||
// eslint-disable-next-line eslint-plugin/prefer-message-ids,eslint-plugin/require-meta-type,eslint-plugin/require-meta-schema,eslint-plugin/require-meta-fixable -- all in base rule - https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/issues/274 | ||
JoshuaKGoldberg marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
meta: { | ||
...baseRule.meta, | ||
docs: { | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -194,11 +194,7 @@ interface B extends A { | ||
[index: number]: unknown; | ||
} | ||
`, | ||
output: null, | ||
JoshuaKGoldberg marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
errors: [{ messageId: 'preferRecord', line: 2, column: 1 }], | ||
}, | ||
// Readonly interface with generic parameter | ||
Uh oh!
There was an error while loading.Please reload this page.