-
Notifications
You must be signed in to change notification settings - Fork 188
chore: lint custom ts/no-arrow-parameter-types #1438
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
base: main
Are you sure you want to change the base?
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
No description provided.