You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-29
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,14 @@
1
-
2
-
ESLint plugin for React Native
3
-
==============================
1
+
# ESLint plugin for React Native
4
2
5
3
# Project update
6
4
7
5
Dear users, first of all, thanks for using the plugin! At the moment development activity is low, I've personally not worked with React Native for many years and have little time to continue updating the plugin. I'll do my best to update the plugin to ensure compatibility with new eslint versions, but unfortunately I do not have time to asses new features/pull requests. Thanks for your understanding!
React Native specific linting rules for ESLint. This repository is structured like (and contains code from) the excellent [eslint-plugin-react](http://github.com/yannickcr/eslint-plugin-react).
11
+
React Native specific linting rules for ESLint. This repository is structured like (and contains code from) the excellent [eslint-plugin-react](http://github.com/yannickcr/eslint-plugin-react).
@@ -39,10 +36,7 @@ Add `plugins` section and specify ESLint-plugin-React (optional) and ESLint-plug
39
36
40
37
```json
41
38
{
42
-
"plugins": [
43
-
"react",
44
-
"react-native"
45
-
]
39
+
"plugins": ["react", "react-native"]
46
40
}
47
41
```
48
42
@@ -51,14 +45,14 @@ If it is not already the case you must also configure `ESLint` to support JSX.
51
45
```json
52
46
{
53
47
"parserOptions": {
54
-
"ecmaFeatures": {
55
-
"jsx": true
56
-
}
48
+
"ecmaFeatures": {
49
+
"jsx": true
50
+
}
57
51
}
58
52
}
59
53
```
60
54
61
-
In order to whitelist all *browser-like* globals, add `react-native/react-native` to your config.
55
+
In order to whitelist all _browser-like_ globals, add `react-native/react-native` to your config.
62
56
63
57
```json
64
58
{
@@ -86,35 +80,28 @@ Finally, enable all of the rules that you would like to use.
86
80
"react-native/no-inline-styles": 2,
87
81
"react-native/no-color-literals": 2,
88
82
"react-native/no-raw-text": 2,
89
-
"react-native/no-single-element-style-arrays": 2,
83
+
"react-native/no-single-element-style-arrays": 2
90
84
}
91
85
}
92
86
```
93
87
94
88
# List of supported rules
95
89
96
-
*[no-unused-styles](docs/rules/no-unused-styles.md): Detect `StyleSheet` rules which are not used in your React components
97
-
*[sort-styles](docs/rules/sort-styles.md): Require style definitions to be sorted alphabetically
98
-
*[split-platform-components](docs/rules/split-platform-components.md): Enforce using platform specific filenames when necessary
99
-
*[no-inline-styles](docs/rules/no-inline-styles.md): Detect JSX components with inline styles that contain literal values
100
-
*[no-color-literals](docs/rules/no-color-literals.md): Detect `StyleSheet` rules and inline styles containing color literals instead of variables
101
-
*[no-raw-text](docs/rules/no-raw-text.md): Detect raw text outside of `Text` component
102
-
*[no-single-element-style-arrays](docs/rules/no-single-element-style-arrays.md): No style arrays that have 1 element only `<View style={[{height: 10}]}/>`
90
+
-[no-unused-styles](docs/rules/no-unused-styles.md): Detect `StyleSheet` rules which are not used in your React components
91
+
-[sort-styles](docs/rules/sort-styles.md): Require style definitions to be sorted alphabetically
92
+
-[split-platform-components](docs/rules/split-platform-components.md): Enforce using platform specific filenames when necessary
93
+
-[no-inline-styles](docs/rules/no-inline-styles.md): Detect JSX components with inline styles that contain literal values
94
+
-[no-color-literals](docs/rules/no-color-literals.md): Detect `StyleSheet` rules and inline styles containing color literals instead of variables
95
+
-[no-raw-text](docs/rules/no-raw-text.md): Detect raw text outside of `Text` component
96
+
-[no-single-element-style-arrays](docs/rules/no-single-element-style-arrays.md): No style arrays that have 1 element only `<View style={[{height: 10}]}/>`
0 commit comments