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
+66-61Lines changed: 66 additions & 61 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,60 +68,65 @@ With ESLint 2.x.x:
68
68
}
69
69
```
70
70
71
-
Finally, enable all of the rules that you would like to use.
71
+
Finally, enable all of the rules that you would like to use. Use [our preset](#user-content-recommended-configuration) to get reasonable defaults quickly, and/or choose your own:
72
72
73
-
The plugin has a [recommended configuration](#user-content-recommended-configuration) that enforces React good practices.
73
+
```json
74
+
"rules": {
75
+
"react/jsx-uses-react": "error",
76
+
"react/jsx-uses-vars": "error",
77
+
}
78
+
```
74
79
75
80
# List of supported rules
76
81
77
-
*[display-name](docs/rules/display-name.md): Prevent missing `displayName` in a React component definition
78
-
*[forbid-prop-types](docs/rules/forbid-prop-types.md): Forbid certain propTypes
79
-
*[no-danger](docs/rules/no-danger.md): Prevent usage of dangerous JSX properties
80
-
*[no-deprecated](docs/rules/no-deprecated.md): Prevent usage of deprecated methods
81
-
*[no-did-mount-set-state](docs/rules/no-did-mount-set-state.md): Prevent usage of `setState` in `componentDidMount`
82
-
*[no-did-update-set-state](docs/rules/no-did-update-set-state.md): Prevent usage of `setState` in `componentDidUpdate`
83
-
*[no-direct-mutation-state](docs/rules/no-direct-mutation-state.md): Prevent direct mutation of `this.state`
84
-
*[no-is-mounted](docs/rules/no-is-mounted.md): Prevent usage of `isMounted`
85
-
*[no-multi-comp](docs/rules/no-multi-comp.md): Prevent multiple component definition per file
86
-
*[no-render-return-value](docs/rules/no-render-return-value.md): Prevent usage of the return value of `React.render`
87
-
*[no-set-state](docs/rules/no-set-state.md): Prevent usage of `setState`
88
-
*[no-string-refs](docs/rules/no-string-refs.md): Prevent using string references in `ref` attribute.
89
-
*[no-unknown-property](docs/rules/no-unknown-property.md): Prevent usage of unknown DOM property (fixable)
90
-
*[prefer-es6-class](docs/rules/prefer-es6-class.md): Enforce ES5 or ES6 class for React Components
91
-
*[prefer-stateless-function](docs/rules/prefer-stateless-function.md): Enforce stateless React Components to be written as a pure function
92
-
*[prop-types](docs/rules/prop-types.md): Prevent missing props validation in a React component definition
93
-
*[react-in-jsx-scope](docs/rules/react-in-jsx-scope.md): Prevent missing `React` when using JSX
94
-
*[require-extension](docs/rules/require-extension.md): Restrict file extensions that may be required
95
-
*[require-optimization](docs/rules/require-optimization.md): Enforce React components to have a shouldComponentUpdate method
96
-
*[require-render-return](docs/rules/require-render-return.md): Enforce ES5 or ES6 class for returning value in render function
97
-
*[self-closing-comp](docs/rules/self-closing-comp.md): Prevent extra closing tags for components without children
98
-
*[sort-comp](docs/rules/sort-comp.md): Enforce component methods order
0 commit comments