Gelio / tslint-react-hooks

TSLint rule for detecting invalid uses of React Hooks
MIT License
218 stars 10 forks source link

New option: ignoredFunctions #25

Closed karfau closed 5 years ago

karfau commented 5 years ago

Adds a new option to configure function names that should not be treated as hooks. Helpful with functions that have been created before hooks existed, so al the benefits of the rule apply ignoring those until they have been renamed.

Still untested, wanted to first know if this goes into the right direction before adding extensive testing.

I would like to get first feedback about this idea and the way I attempted to implement it:

karfau commented 5 years ago

I agree and in the meantime I also tried to rename the offending functions in our code base, so we solved the issue by a refactoring. (Which might not have happened if the option would have been available.) I think this is also the way for people to go if they want to have this tslint rule.

Also since tslint is going to ~dy~be deprecated I have a hard time motivating myself to invest more time into anything that is not related to moving away from it...

Thx for the feedback, hope to collaborate some time in the future :smile:

Gelio commented 5 years ago

Sure, no problem, thanks for contributing and an intellectual exchange of opinions 😄