Skip to content

Commit bb999c2

Browse files
bmishljharb
authored andcommitted
[Docs] document which rules provide suggestions
1 parent 8306a7b commit bb999c2

35 files changed

+219
-150
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
3636
* [Refactor] [`jsx-closing-bracket-location`], [`jsx-no-bind`]: fix eslint issues ([#3351][] @caroline223)
3737
* [Tests] [`function-component-definition`]: add passing test cases ([#3355][] @TildaDares)
3838
* [Docs] [`jsx-no-target-blank`]: Fix link to link-type-noreferrer ([#3319][] @Luccasoli)
39+
* [Docs] document which rules provide suggestions ([#3359][] @bmish)
3940

41+
[#3359]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3359
4042
[#3355]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3355
4143
[#3353]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3353
4244
[#3351]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3351

README.md

Lines changed: 104 additions & 103 deletions
Large diffs are not rendered by default.

docs/rules/destructuring-assignment.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Enforce consistent usage of destructuring assignment of props, state, and context (react/destructuring-assignment)
22

3+
🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line.
4+
35
Rule can be set to either of `always` or `never`;
46
```js
57
"react/destructuring-assignment": [<enabled>, 'always']

docs/rules/function-component-definition.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Enforce a specific function type for function components (react/function-component-definition)
22

3-
This option enforces a specific function type for function components.
3+
🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line.
44

5-
**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.
5+
This option enforces a specific function type for function components.
66

77
## Rule Details
88

docs/rules/hook-use-state.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Ensure destructuring and symmetric naming of useState hook value and setter variables (react/hook-use-state)
22

3+
💡 This rule provides editor [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).
4+
35
## Rule Details
46

57
This rule checks whether the value and setter variables destructured from a `React.useState()` call are named symmetrically.

docs/rules/jsx-boolean-value.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Enforce boolean attributes notation in JSX (react/jsx-boolean-value)
22

3-
[When using a boolean attribute in JSX](https://facebook.github.io/react/docs/jsx-in-depth.html#boolean-attributes), you can set the attribute value to `true` or omit the value. This rule will enforce one or the other to keep consistency in your code.
3+
🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line.
44

5-
**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.
5+
[When using a boolean attribute in JSX](https://facebook.github.io/react/docs/jsx-in-depth.html#boolean-attributes), you can set the attribute value to `true` or omit the value. This rule will enforce one or the other to keep consistency in your code.
66

77
## Rule Details
88

docs/rules/jsx-closing-bracket-location.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Validate closing bracket location in JSX (react/jsx-closing-bracket-location)
22

3-
Enforce the closing bracket location for JSX multiline elements.
3+
🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line.
44

5-
**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.
5+
Enforce the closing bracket location for JSX multiline elements.
66

77
## Rule Details
88

docs/rules/jsx-closing-tag-location.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Validate closing tag location in JSX (react/jsx-closing-tag-location)
22

3-
Enforce the closing tag location for multiline JSX elements.
3+
🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line.
44

5-
**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.
5+
Enforce the closing tag location for multiline JSX elements.
66

77
## Rule Details
88

docs/rules/jsx-curly-brace-presence.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Enforce curly braces or disallow unnecessary curly braces in JSX props and/or children. (react/jsx-curly-brace-presence)
22

3+
🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line.
4+
35
This rule allows you to enforce curly braces or disallow unnecessary curly braces in JSX props and/or children.
46

57
For situations where JSX expressions are unnecessary, please refer to [the React doc](https://facebook.github.io/react/docs/jsx-in-depth.html) and [this page about JSX gotchas](https://github.com/facebook/react/blob/v15.4.0-rc.3/docs/docs/02.3-jsx-gotchas.md#html-entities).
@@ -175,7 +177,7 @@ Examples of **correct** code for this rule, even when configured with `"never"`:
175177
*/
176178
<App>{' '}</App>
177179
<App>{' '}</App>
178-
<App>{/* comment */ <Bpp />}</App> // the comment makes the container necessary
180+
<App>{/* comment */ <Bpp />}</App> // the comment makes the container necessary
179181
```
180182

181183
## When Not To Use It

docs/rules/jsx-curly-newline.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Enforce linebreaks in curly braces in JSX attributes and expressions. (react/jsx-curly-newline)
22

3-
Many style guides require or disallow newlines inside of jsx curly expressions.
3+
🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line.
44

5-
**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.
5+
Many style guides require or disallow newlines inside of jsx curly expressions.
66

77
## Rule Details
88

0 commit comments

Comments
 (0)