Is there a way to prevent `lowercaseevent` names?
From time to time, I have to write such PR reviews to tell the person not to use lower case event names. It is getting repetitive and annoying for everyone involved. Ideally, IDE would tell them this instead or even autofix. Anyone has a solution for this?
4 Replies
we are using typescript, so ideally it would be an actual type error to write it the other way
You could write a custom eslint plugin to do it… but you either have to know every single handler available or accept uniformly erroring on any JSX prop that starts with
on
that isn't followed by a capital letter.
It's likely that you could use jsx-handler-names
from eslint-plugin-react
without any modificationsIf you are using eslint-plugin-solid then: https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/event-handlers.md
GitHub
eslint-plugin-solid/docs/event-handlers.md at main · solidjs-commun...
Solid-specific linting rules for ESLint. Contribute to solidjs-community/eslint-plugin-solid development by creating an account on GitHub.
Perfect, thank you for the suggestions. Will try then out on monday!