-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Open
Labels
enhancement: new plugin ruleNew rule request for eslint-pluginNew rule request for eslint-pluginpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugintriageWaiting for team members to take a lookWaiting for team members to take a look
Description
Before You File a Proposal Please Confirm You Have Done The Following...
- I have searched for related issues and found none that match my proposal.
- I have searched the current rule list and found no rules that match my proposal.
- I have read the FAQ and my problem is not listed.
My proposal is suitable for this project
- My proposal specifically checks TypeScript syntax, or it proposes a check that requires type information to be accurate.
- My proposal is not a "formatting rule"; meaning it does not just enforce how code is formatted (whitespace, brace placement, etc).
- I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).
Description
Hello.
I see from time to time people add types to array methods callback arguments manually, e.g.:
items.forEach((item: Item) => {})I think this is pretty much redundant, because TS knows the type of item.
I'm not sure if this should be a new rule, or an update to an exisiting one (couldn't figure out which one would suit best though).
Fail Cases
items.forEach((item: Item) => {
console.log(item.foo);
})
items.filter((item: Item) => item.foo === 'bar')Pass Cases
items.forEach((item) => {
console.log(item.foo);
})
items.filter((item) => item.foo === 'bar')Additional Info
No response
Metadata
Metadata
Assignees
Labels
enhancement: new plugin ruleNew rule request for eslint-pluginNew rule request for eslint-pluginpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugintriageWaiting for team members to take a lookWaiting for team members to take a look