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
Removed ESLint 1.x config information as it's probably used by very, very few people. Restructured config section to focus on quick set-up with defaults over more time consuming individual rule selection. No need to specify the plugin configuration as it works without it so it seems to be noise?
Add `plugins` section and specify ESLint-plugin-React as a plugin.
24
+
Use [our preset](#recommended) to get reasonable defaults:
25
25
26
26
```json
27
-
{
28
-
"plugins": [
29
-
"react"
27
+
"extends": [
28
+
"eslint:recommended",
29
+
"plugin:react/recommended"
30
30
]
31
-
}
32
31
```
33
32
34
-
You can also specify some settings that will be shared across all the plugin rules.
33
+
You should also specify settings that will be shared across all the plugin rules.
35
34
36
35
```json5
37
36
{
38
37
"settings": {
39
38
"react": {
40
-
"createClass":"createReactClass", // Regex for Component Factory to use, default to "createReactClass"
39
+
"createClass":"createReactClass", // Regex for Component Factory to use,
40
+
// default to "createReactClass"
41
41
"pragma":"React", // Pragma to use, default to "React"
42
42
"version":"15.0", // React version, default to the latest React stable release
43
43
"flowVersion":"0.53"// Flow version
44
44
},
45
-
"propWrapperFunctions": [ "forbidExtraProps" ] // The names of any functions used to wrap the propTypes object, such as `forbidExtraProps`. If this isn't set, any propTypes wrapped in a function will be skipped.
45
+
"propWrapperFunctions": [ "forbidExtraProps" ] // The names of any functions used to wrap the
46
+
// propTypes object, e.g. `forbidExtraProps`.
47
+
// If this isn't set, any propTypes wrapped in
48
+
// a function will be skipped.
46
49
}
47
50
}
48
51
```
49
52
50
-
If it is not already the case you must also configure `ESLint` to support JSX.
53
+
If you do not use a preset you will need to specify individual rules and add extra configuration.
51
54
52
-
With ESLint 1.x.x:
55
+
Add "react" to the plugins section.
53
56
54
57
```json
55
58
{
56
-
"ecmaFeatures": {
57
-
"jsx": true
58
-
}
59
+
"plugins": [
60
+
"react"
61
+
]
59
62
}
60
63
```
61
64
62
-
With ESLint 2.x.x or 3.x.x:
65
+
Enable JSX support.
66
+
67
+
With ESLint 2+
63
68
64
69
```json
65
70
{
@@ -71,7 +76,7 @@ With ESLint 2.x.x or 3.x.x:
71
76
}
72
77
```
73
78
74
-
Finally, enable all of the rules that you would like to use. Use [our preset](#recommended) to get reasonable defaults quickly, and/or choose your own:
0 commit comments