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
React Native specific linting rules for ESLint. This repository is structured like (and contains code from) the excellent [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react).
10
10
@@ -13,20 +13,20 @@ React Native specific linting rules for ESLint. This repository is structured li
13
13
Install [ESLint](https://www.github.com/eslint/eslint) either locally or globally.
14
14
15
15
```sh
16
-
$ npm install eslint
16
+
$ npm install --save-dev eslint
17
17
```
18
18
19
19
To make most use of this plugin, its recommended to install [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) in addition to [ESLint](https://www.github.com/eslint/eslint). If you installed `ESLint` globally, you have to install eslint-plugin-react globally too. Otherwise, install it locally.
It's like [sort-keys](https://eslint.org/docs/rules/sort-keys), but just for React Native styles.
3
+
4
+
Keeping your style definitions sorted is a common convention that helps with readability. This rule lets you enforce an ascending (default) or descending alphabetical order for both "class names" and style properties.
5
+
6
+
## Rule Details
7
+
8
+
The following patterns are considered warnings:
9
+
10
+
```js
11
+
conststyles=StyleSheet.create({
12
+
button: {
13
+
width:100,
14
+
color:'green',
15
+
},
16
+
});
17
+
```
18
+
19
+
```js
20
+
conststyles=StyleSheet.create({
21
+
button: {},
22
+
anchor: {},
23
+
});
24
+
```
25
+
26
+
The following patterns are not considered warnings:
0 commit comments