eslint-plugin-react-native
eslint-plugin-react-native copied to clipboard
Undefined StyleSheet not showing as error
If you use StyleSheet.create({})
without StyleSheet
import it causes no error
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?
No, i just randomly found that. If i will have enough time i'll try
@xahon, could it be that you have "browser": true in your eslint env property? Cause I believe browsers have a global "StyleSheet" variable
@agarcia17 yes, browser is set to true
@xahon, try setting it to false and restart VS Code and see if the issue still persist
@agarcia17 I'm not using vs code, but vim. I'll check it later