File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
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 >
You can’t perform that action at this time.
0 commit comments