eslint-plugin-react-native icon indicating copy to clipboard operation
eslint-plugin-react-native copied to clipboard

no-unused-styles works only with React class components

Open henrikra opened this issue 6 years ago • 4 comments

Here is example component where no-unused-styles works: image

But if the same component is refactored to functional component the validation is not working anymore

image

Also the docs https://github.com/Intellicode/eslint-plugin-react-native/blob/master/docs/rules/no-unused-styles.md don't say anything that this validation should work only on classes so I think this is a bug then.

Does anybody have a clue how to fix this? I can help if needed 👍

henrikra avatar Aug 30 '19 10:08 henrikra

Good point, I suppose it should be flagged, maybe you can make a PR to add this case? :)

Intellicode avatar Sep 12 '19 20:09 Intellicode

Maybe if you point to some lines where the problem might lie because I am not yet familiar with the codebase :)

henrikra avatar Sep 13 '19 07:09 henrikra

I can't reproduce this issue. I'm using v3.8.1. Am I missing something? 🤔

Class component

image

Function component

image

acostalima avatar Jun 24 '20 11:06 acostalima

I've just found the root cause. It lies on #258.

acostalima avatar Jun 24 '20 11:06 acostalima