|
13 | 13 |
|
14 | 14 | ### Rules in `eslint-plugin-react-x`
|
15 | 15 |
|
16 |
| -| Rule | Description | |
17 |
| -| :------------------------------------- | :--------------------------------------------------------------------------------------------------- | |
18 |
| -| avoid-shorthand-boolean | Enforces the use of shorthand syntax for boolean attributes. | |
19 |
| -| avoid-shorthand-fragment | Enforces the use of shorthand syntax for fragments. | |
20 |
| -| ensure-forward-ref-using-ref | Requires that components wrapped with `forwardRef` must have a `ref` parameter. | |
21 |
| -| no-access-state-in-setstate | Prevents accessing `this.state` inside `setState` calls. | |
22 |
| -| no-array-index-key | Warns when an array `index` is used as a `key` prop. | |
23 |
| -| no-children-count | Prevents usage of `Children.count`. | |
24 |
| -| no-children-for-each | Prevents usage of `Children.forEach`. | |
25 |
| -| no-children-map | Prevents usage of `Children.map`. | |
26 |
| -| no-children-only | Prevents usage of `Children.only`. | |
27 |
| -| no-children-prop | Prevents usage of `children` as a prop. | |
28 |
| -| no-children-to-array | Prevents usage of `Children.toArray`. | |
29 |
| -| no-class-component | Prevents usage of class component. | |
30 |
| -| no-clone-element | Prevents usage of `cloneElement`. | |
31 |
| -| no-comment-textnodes | Prevents comments from being inserted as text nodes. | |
32 |
| -| no-component-will-mount | Prevents usage of `componentWillMount`. | |
33 |
| -| no-component-will-receive-props | Prevents usage of `componentWillReceiveProps`. | |
34 |
| -| no-component-will-update | Prevents usage of `componentWillUpdate`. | |
35 |
| -| no-create-ref | Prevents usage of `createRef`. | |
36 |
| -| no-direct-mutation-state | Prevents direct mutation of `this.state`. | |
37 |
| -| no-duplicate-key | Prevents duplicate `key` props on elements in the same array or a list of `children`. | |
38 |
| -| no-leaked-conditional-rendering | Prevents problematic leaked values from being rendered. | |
39 |
| -| no-missing-component-display-name | Enforces that all components have a `displayName` which can be used in devtools. | |
40 |
| -| no-missing-key | Prevents missing `key` prop on items in list rendering. | |
41 |
| -| no-nested-components | Prevents nesting component definitions inside other components. | |
42 |
| -| no-redundant-should-component-update | Prevents usage of `shouldComponentUpdate` when extending `React.PureComponent`. | |
43 |
| -| no-set-state-in-component-did-mount | Disallows calling `this.setState` in `componentDidMount` outside of functions, such as callbacks. | |
44 |
| -| no-set-state-in-component-did-update | Disallows calling `this.setState` in `componentDidUpdate` outside of functions, such as callbacks. | |
45 |
| -| no-set-state-in-component-will-update | Disallows calling `this.setState` in `componentWillUpdate` outside of functions, such as callbacks. | |
46 |
| -| no-string-refs | Disallows using deprecated string `refs`. | |
47 |
| -| no-unsafe-component-will-mount | Warns usage of `UNSAFE_componentWillMount` in class components. | |
48 |
| -| no-unsafe-component-will-receive-props | Warns usage of `UNSAFE_componentWillReceiveProps` in class components. | |
49 |
| -| no-unsafe-component-will-update | Warns usage of `UNSAFE_componentWillUpdate` in class components. | |
50 |
| -| no-unstable-context-value | Prevents non-stable values (i.e. object literals) from being used as a value for `Context.Provider`. | |
51 |
| -| no-unstable-default-props | Prevents usage of referential-type values as default props in object destructuring. | |
52 |
| -| no-unused-class-component-members | Warns unused class component methods and properties. | |
53 |
| -| no-unused-state | Warns unused class component state. | |
54 |
| -| no-useless-fragment | Prevents the use of useless `fragment` components or `<>` syntax. | |
55 |
| -| prefer-destructuring-assignment | Enforces the use of destructuring assignment over property assignment. | |
56 |
| -| prefer-read-only-props | Enforces that function components props are readonly. | |
57 |
| -| prefer-shorthand-boolean | Enforces the use of shorthand syntax for boolean attributes. | |
58 |
| -| prefer-shorthand-fragment | Enforces the use of shorthand syntax for fragments. | |
| 16 | +| Rule | Description | |
| 17 | +| :--------------------------------------- | :--------------------------------------------------------------------------------------------------- | |
| 18 | +| `avoid-shorthand-boolean` | Enforces the use of shorthand syntax for boolean attributes. | |
| 19 | +| `avoid-shorthand-fragment` | Enforces the use of shorthand syntax for fragments. | |
| 20 | +| `ensure-forward-ref-using-ref` | Requires that components wrapped with `forwardRef` must have a `ref` parameter. | |
| 21 | +| `no-access-state-in-setstate` | Prevents accessing `this.state` inside `setState` calls. | |
| 22 | +| `no-array-index-key` | Warns when an array `index` is used as a `key` prop. | |
| 23 | +| `no-children-count` | Prevents usage of `Children.count`. | |
| 24 | +| `no-children-for-each` | Prevents usage of `Children.forEach`. | |
| 25 | +| `no-children-map` | Prevents usage of `Children.map`. | |
| 26 | +| `no-children-only` | Prevents usage of `Children.only`. | |
| 27 | +| `no-children-prop` | Prevents usage of `children` as a prop. | |
| 28 | +| `no-children-to-array` | Prevents usage of `Children.toArray`. | |
| 29 | +| `no-class-component` | Prevents usage of class component. | |
| 30 | +| `no-clone-element` | Prevents usage of `cloneElement`. | |
| 31 | +| `no-comment-textnodes` | Prevents comments from being inserted as text nodes. | |
| 32 | +| `no-component-will-mount` | Prevents usage of `componentWillMount`. | |
| 33 | +| `no-component-will-receive-props` | Prevents usage of `componentWillReceiveProps`. | |
| 34 | +| `no-component-will-update` | Prevents usage of `componentWillUpdate`. | |
| 35 | +| `no-create-ref` | Prevents usage of `createRef`. | |
| 36 | +| `no-direct-mutation-state` | Prevents direct mutation of `this.state`. | |
| 37 | +| `no-duplicate-key` | Prevents duplicate `key` props on elements in the same array or a list of `children`. | |
| 38 | +| `no-leaked-conditional-rendering` | Prevents problematic leaked values from being rendered. | |
| 39 | +| `no-missing-component-display-name` | Enforces that all components have a `displayName` which can be used in devtools. | |
| 40 | +| `no-missing-key` | Prevents missing `key` prop on items in list rendering. | |
| 41 | +| `no-nested-components` | Prevents nesting component definitions inside other components. | |
| 42 | +| `no-redundant-should-component-update` | Prevents usage of `shouldComponentUpdate` when extending `React.PureComponent`. | |
| 43 | +| `no-set-state-in-component-did-mount` | Disallows calling `this.setState` in `componentDidMount` outside of functions, such as callbacks. | |
| 44 | +| `no-set-state-in-component-did-update` | Disallows calling `this.setState` in `componentDidUpdate` outside of functions, such as callbacks. | |
| 45 | +| `no-set-state-in-component-will-update` | Disallows calling `this.setState` in `componentWillUpdate` outside of functions, such as callbacks. | |
| 46 | +| `no-string-refs` | Disallows using deprecated string `refs`. | |
| 47 | +| `no-unsafe-component-will-mount` | Warns usage of `UNSAFE_componentWillMount` in class components. | |
| 48 | +| `no-unsafe-component-will-receive-props` | Warns usage of `UNSAFE_componentWillReceiveProps` in class components. | |
| 49 | +| `no-unsafe-component-will-update` | Warns usage of `UNSAFE_componentWillUpdate` in class components. | |
| 50 | +| `no-unstable-context-value` | Prevents non-stable values (i.e. object literals) from being used as a value for `Context.Provider`. | |
| 51 | +| `no-unstable-default-props` | Prevents usage of referential-type values as default props in object destructuring. | |
| 52 | +| `no-unused-class-component-members` | Warns unused class component methods and properties. | |
| 53 | +| `no-unused-state` | Warns unused class component state. | |
| 54 | +| `no-useless-fragment` | Prevents the use of useless `fragment` components or `<>` syntax. | |
| 55 | +| `prefer-destructuring-assignment` | Enforces the use of destructuring assignment over property assignment. | |
| 56 | +| `prefer-read-only-props` | Enforces that function components props are readonly. | |
| 57 | +| `prefer-shorthand-boolean` | Enforces the use of shorthand syntax for boolean attributes. | |
| 58 | +| `prefer-shorthand-fragment` | Enforces the use of shorthand syntax for fragments. | |
59 | 59 |
|
60 | 60 | ### Rules in `eslint-plugin-react-dom`
|
61 | 61 |
|
|
0 commit comments