Feedback on new rule idea for pure functions #594
blake-regalia
started this conversation in
Ideas
Replies: 1 comment
-
Since ESLint is a tool for static analysis on single files, it might be difficult to perform checks across multiple files. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Wanted to see if there was interest from the community to have a
no-pure-functions
rule which would be for identifying pure functions in the script section of svelte files and suggest moving them to a script file where they can be reused by other components.I've found with larger projects i accidentally end up reimplementing almost the same function in different components. Catching these early so they can be refactored into separate scripts would not only save time on reuse but also cut down on the bloat within each component.
Naturally, i think an option to the rule would be to exclude typed functions that accept an Event/CustomEvent parameter which are usually specific to the component itself.
Beta Was this translation helpful? Give feedback.
All reactions