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
Copy file name to clipboardExpand all lines: README.md
+38-48Lines changed: 38 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,52 +69,6 @@ With ESLint 2.x.x:
69
69
70
70
Finally, enable all of the rules that you would like to use.
71
71
72
-
```json
73
-
{
74
-
"rules": {
75
-
"react/display-name": 1,
76
-
"react/forbid-prop-types": 1,
77
-
"react/no-danger": 1,
78
-
"react/no-deprecated": 1,
79
-
"react/no-did-mount-set-state": 1,
80
-
"react/no-did-update-set-state": 1,
81
-
"react/no-direct-mutation-state": 1,
82
-
"react/no-is-mounted": 1,
83
-
"react/no-multi-comp": 1,
84
-
"react/no-set-state": 1,
85
-
"react/no-string-refs": 1,
86
-
"react/no-unknown-property": 1,
87
-
"react/prefer-es6-class": 1,
88
-
"react/prop-types": 1,
89
-
"react/react-in-jsx-scope": 1,
90
-
"react/require-extension": 1,
91
-
"react/self-closing-comp": 1,
92
-
"react/sort-comp": 1,
93
-
"react/wrap-multilines": 1,
94
-
95
-
"react/jsx-boolean-value": 1,
96
-
"react/jsx-closing-bracket-location": 1,
97
-
"react/jsx-curly-spacing": 1,
98
-
"react/jsx-equals-spacing": 1,
99
-
"react/jsx-handler-names": 1,
100
-
"react/jsx-indent-props": 1,
101
-
"react/jsx-indent": 1,
102
-
"react/jsx-key": 1,
103
-
"react/jsx-max-props-per-line": 1,
104
-
"react/jsx-no-bind": 1,
105
-
"react/jsx-no-duplicate-props": 1,
106
-
"react/jsx-no-literals": 1,
107
-
"react/jsx-no-undef": 1,
108
-
"react/jsx-pascal-case": 1,
109
-
"react/jsx-sort-prop-types": 1,
110
-
"react/jsx-sort-props": 1,
111
-
"react/jsx-space-before-closing": 1,
112
-
"react/jsx-uses-react": 1,
113
-
"react/jsx-uses-vars": 1
114
-
}
115
-
}
116
-
```
117
-
118
72
# List of supported rules
119
73
120
74
*[display-name](docs/rules/display-name.md): Prevent missing `displayName` in a React component definition
@@ -137,7 +91,7 @@ Finally, enable all of the rules that you would like to use.
137
91
*[sort-comp](docs/rules/sort-comp.md): Enforce component methods order
138
92
*[wrap-multilines](docs/rules/wrap-multilines.md): Prevent missing parentheses around multilines JSX (fixable)
139
93
140
-
###JSX-specific rules
94
+
## JSX-specific rules
141
95
142
96
*[jsx-boolean-value](docs/rules/jsx-boolean-value.md): Enforce boolean attributes notation in JSX (fixable)
143
97
*[jsx-closing-bracket-location](docs/rules/jsx-closing-bracket-location.md): Validate closing bracket location in JSX
@@ -159,10 +113,46 @@ Finally, enable all of the rules that you would like to use.
159
113
*[jsx-uses-react](docs/rules/jsx-uses-react.md): Prevent React to be incorrectly marked as unused
160
114
*[jsx-uses-vars](docs/rules/jsx-uses-vars.md): Prevent variables used in JSX to be incorrectly marked as unused
161
115
162
-
## React Native
116
+
## React Native rules
163
117
164
118
If you're searching for React Native specific linting rules, check out [eslint-plugin-react-native](https://github.com/Intellicode/eslint-plugin-react-native).
165
119
120
+
# Recommended configuration
121
+
122
+
This plugin export a `recommended` configuration that enforce React good practices.
123
+
124
+
To enable this configuration use the `extends` property in your `.eslintrc` config file:
125
+
126
+
```js
127
+
{
128
+
"plugins": [
129
+
"react"
130
+
],
131
+
"extends":"plugin:react/recommended"
132
+
}
133
+
```
134
+
135
+
See [ESLint documentation](http://eslint.org/docs/user-guide/configuring#extending-configuration-files) for more information about extending configuration files.
0 commit comments