Skip to content

Commit 602a8fd

Browse files
committed
Merge branch 'master' of github.com:Intellicode/eslint-plugin-react-native
2 parents c7934c2 + a15fc27 commit 602a8fd

File tree

1 file changed

+64
-1
lines changed

1 file changed

+64
-1
lines changed

README.md

+64-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,64 @@
1-
# eslint-plugin-react-native
1+
2+
ESLint plugin for React Native
3+
==============================
4+
5+
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).
6+
7+
# Installation
8+
9+
Install [ESLint](https://www.github.com/eslint/eslint) either locally or globally.
10+
11+
```sh
12+
$ npm install eslint
13+
```
14+
15+
To make most use of this plugin, its recommended to install [eslint-plugin-react](http://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.
16+
17+
```sh
18+
$ npm install eslint-plugin-react
19+
```
20+
21+
Similarly, install eslint-plugin-react-native
22+
23+
24+
```sh
25+
$ npm install eslint-plugin-react-native
26+
```
27+
28+
# Configuration
29+
30+
Add `plugins` section and specify ESLint-plugin-React (optional) and ESLint-plugin-react-native as a plugin.
31+
32+
```json
33+
{
34+
"plugins": [
35+
"react",
36+
"react-native"
37+
]
38+
}
39+
```
40+
41+
If it is not already the case you must also configure `ESLint` to support JSX.
42+
43+
```json
44+
{
45+
"ecmaFeatures": {
46+
"jsx": true
47+
}
48+
}
49+
```
50+
51+
Finally, enable all of the rules that you would like to use.
52+
53+
```json
54+
{
55+
"rules": {
56+
"react/no-unused-styles": 1,
57+
}
58+
}
59+
```
60+
61+
# List of supported rules
62+
63+
* [no-unused-styles](TODO: docs): Detect `StyleSheet` rules which are not used in your React components
64+

0 commit comments

Comments
 (0)