Skip to content

Commit e0419c0

Browse files
authored
Create setup.md
Root file for the docs directory to help newbies find info on setting up the plugin.
1 parent 82648f3 commit e0419c0

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

docs/setup.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
In order to use the react eslint plugin do the following...
2+
3+
1. At the root of your project type <code>npm install eslint-plugin-react --save-dev</code>
4+
2. Check your package.json 'devDependencies' for the following entries (version numbers may vary)...
5+
<pre>
6+
"devDependencies": {
7+
"eslint": "^3.19.0",
8+
"eslint-plugin-react": "^6.10.3"
9+
}
10+
</pre>
11+
3. In your eslint configuration file (.eslint.rc / package.json etc.) add the following under 'esLintConfig'...
12+
<pre>
13+
"eslintConfig": {
14+
"plugins": [
15+
"react"
16+
]
17+
}
18+
</pre>
19+
4. Configure the rules you want to use according to the [rules docs](/docs/rules). Here's a sample of some of mine...
20+
<pre>
21+
"eslintConfig": {
22+
"rules": {
23+
"no-unused-vars": 2,
24+
"react/jsx-uses-vars": 2,
25+
"react/require-extensions": 0,
26+
"react/jsx-sort-prop-types": 0,
27+
"react/prop-types": [2, {
28+
"ignore": ["children"],
29+
"skipUndeclared": false
30+
}]
31+
}
32+
}
33+
</pre>
34+
35+
<i>You can read more about configuring ESLint plugins at http://eslint.org/docs/user-guide/configuring#configuring-plugins</i>

0 commit comments

Comments
 (0)