eslint-plugin-react-memo
eslint-plugin-react-memo copied to clipboard
False positives for all functions inside of .tsx/.jsx files that are not react components
I would love to use this lint rule, but its false positive rate is way to high currently. It seems any function within a jsx/tsx file is considered to be a component regardless of whether it is or not.
If possible, I would use the typescript compiler to check if a function can be considered to be of type FunctionComponent
. Doing so, you can safely filter out all false positives.
That being said, I have no idea if the typescript compiler API has such a hook
+1 on this, also seeing the same issue
Components always start with a capital letter. I haven't extensively looked at the plugin, though such a filter might work.
If not putting your logic in .ts files might be cleaner.