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
+21-30Lines changed: 21 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,10 @@
1
-
2
-
ESLint plugin for React Native
3
-
==============================
4
-
5
-
# Project update
6
-
7
-
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).
7
+
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 +32,7 @@ Add `plugins` section and specify ESLint-plugin-React (optional) and ESLint-plug
39
32
40
33
```json
41
34
{
42
-
"plugins": [
43
-
"react",
44
-
"react-native"
45
-
]
35
+
"plugins": ["react", "react-native"]
46
36
}
47
37
```
48
38
@@ -51,14 +41,14 @@ If it is not already the case you must also configure `ESLint` to support JSX.
51
41
```json
52
42
{
53
43
"parserOptions": {
54
-
"ecmaFeatures": {
55
-
"jsx": true
56
-
}
44
+
"ecmaFeatures": {
45
+
"jsx": true
46
+
}
57
47
}
58
48
}
59
49
```
60
50
61
-
In order to whitelist all *browser-like* globals, add `react-native/react-native` to your config.
51
+
In order to whitelist all _browser-like_ globals, add `react-native/react-native` to your config.
62
52
63
53
```json
64
54
{
@@ -86,35 +76,32 @@ Finally, enable all of the rules that you would like to use.
86
76
"react-native/no-inline-styles": 2,
87
77
"react-native/no-color-literals": 2,
88
78
"react-native/no-raw-text": 2,
89
-
"react-native/no-single-element-style-arrays": 2,
79
+
"react-native/no-single-element-style-arrays": 2
90
80
}
91
81
}
92
82
```
93
83
94
84
# List of supported rules
95
85
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}]}/>`
86
+
-[no-unused-styles](docs/rules/no-unused-styles.md): Detect `StyleSheet` rules which are not used in your React components
87
+
-[sort-styles](docs/rules/sort-styles.md): Require style definitions to be sorted alphabetically
88
+
-[split-platform-components](docs/rules/split-platform-components.md): Enforce using platform specific filenames when necessary
89
+
-[no-inline-styles](docs/rules/no-inline-styles.md): Detect JSX components with inline styles that contain literal values
90
+
-[no-color-literals](docs/rules/no-color-literals.md): Detect `StyleSheet` rules and inline styles containing color literals instead of variables
91
+
-[no-raw-text](docs/rules/no-raw-text.md): Detect raw text outside of `Text` component
92
+
-[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}]}/>`
@@ -132,3 +119,7 @@ This plugin also exports an `all` configuration that includes every available ru
132
119
```
133
120
134
121
**Note**: These configurations will import `eslint-plugin-react-native` and enable JSX in [parser options](http://eslint.org/docs/user-guide/configuring#specifying-parser-options).
122
+
123
+
## Thanks
124
+
125
+
Thanks to [@intellicode](https://github.com/Intellicode/eslint-plugin-react-native) for creating and maintaining this after all these years
0 commit comments