chore: lint custom ts/no-arrow-parameter-types#1438
chore: lint custom ts/no-arrow-parameter-types#1438Shinigami92 wants to merge 2 commits intomainfrom
Conversation
|
@bradzacher @JoshuaKGoldberg Hey typescript-lint maintainers. I'm currently working again with many trainees in my company work. There I have the issue that they write a lot code like e.g.: const someElements = getElements()
// ^? = any[]
someElements.filter((element: Element) => element.needed)
// ~~~~~~~~~ <- I don't want these arrow-parameter typesThis is all over the codebase in multiple projects. (I'm new in that company) e.g. function getElements(): Element[] { return [] }
// or
const someElements: Element[] = getElements()
someElements.filter((element) => element.needed)
// ~~~~~~~ <- now gets inferred as Element 🎉 So my question to you typescript-lint maintainers is: Are you interested in such a rule proposal? |
I'd say in general the right next step would be to file an issue asking this in typescript-eslint. Even if the idea isn't something that lands in core, that'd give it more visibility. If you end up writing your own custom plugin that'd be a good place to mention it. Though...
This seems like the root problem, no? That folks are having Also: typescript-eslint/typescript-eslint#2673 is another example of why these kinds of rules can be surprisingly difficult to write. |
ecec39e to
42fe865
Compare
42fe865 to
e8140f3
Compare
fa37ccd to
a9b74f9
Compare
a9b74f9 to
9d2bb6c
Compare
No description provided.