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

Undefined StyleSheet not showing as error

Open xahon opened this issue 7 years ago • 6 comments

If you use StyleSheet.create({}) without StyleSheet import it causes no error

xahon avatar Jul 25 '17 15:07 xahon

Thanks for reporting this request. Currently, this is not covered by any existing lint rules by the plugin. A new one would be an option. If it is something you encounter often, can you make a PR that covers this case?

Intellicode avatar Aug 10 '17 22:08 Intellicode

No, i just randomly found that. If i will have enough time i'll try

xahon avatar Aug 11 '17 10:08 xahon

@xahon, could it be that you have "browser": true in your eslint env property? Cause I believe browsers have a global "StyleSheet" variable

agarcia17 avatar Sep 06 '17 04:09 agarcia17

@agarcia17 yes, browser is set to true

xahon avatar Sep 06 '17 04:09 xahon

@xahon, try setting it to false and restart VS Code and see if the issue still persist

agarcia17 avatar Sep 06 '17 04:09 agarcia17

@agarcia17 I'm not using vs code, but vim. I'll check it later

xahon avatar Sep 06 '17 04:09 xahon