eslint-plugin-react-native
eslint-plugin-react-native copied to clipboard
React Native plugin for ESLint
I love not allowing inline styles but it becomes a little frustrating when all you have are a bunch of`style={{ flex: 1 }}` views. Is there a way to allow...
`Namespace.Type` should be a `JSXMemberExpression` ![image](https://user-images.githubusercontent.com/13860611/69508131-bd4dcb00-0f6f-11ea-9ccf-7c158a66937f.png)
Version: 3.2.1 I have noticed that rules like `no-unused-styles` and `no-color-literals` don't work if styles are defined as ``` let styles; export default SomeComponent() { ... } styles = StyleSheet.create({...
The following example works well: ```javascript 'react-native/no-inline-styles': 2 ``` And ignore this option is not work ```javascript 'react-native/no-inline-styles': [2, { ignore: [ '/src/utils/utils.js' ] }] ```
Hi! According to the React Native Extended StyleSheet [documentation](https://github.com/vitalets/react-native-extended-stylesheet#global-variables), styles variables can be strings. This PR fixes `no-color-literals` rule that will no longer report an error for colors declared as...
This PR adds support for identifying unused styles when `StyleSheet` isn't imported separately, but instead used through the `react-native` default import, for example in ```javascript import RN from 'react-native'; const...
Our project conventions prefer namespaced imports of libraries, meaning that we import React Native with `import RN from 'react-native';` instead of `import {Long, List, Of, Things} from 'react-native';`. Unfortunately for...
Notice how the error message includes `undefined` (in this case, I had two rules defined as `"link.primary"` and `"link.secondary"`.
Sometimes the imports are namespaced: ``` import RN from 'react-native'; ``` This merge allows use of ```RN.StyleSheet.create({...})``` and possibility to declare these namespaces via ```react-native/react-native-namespaces``` setting.
I have the following file name for a jest test file: `permissions.android.spec.js`. This file imports `PermissionsAndroid` in it in order to mock the request function. This is triggering the linter...