Skip to content

Commit 4ccb5cc

Browse files
committed
docs: tweak rule notices
1 parent a766255 commit 4ccb5cc

31 files changed

+39
-41
lines changed

docs/rules/destructuring-assignment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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 on the command line.
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

55
Rule can be set to either of `always` or `never`;
66
```js

docs/rules/function-component-definition.md

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

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
This option enforces a specific function type for function components.
66

docs/rules/hook-use-state.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ensure destructuring and symmetric naming of useState hook value and setter variables (react/hook-use-state)
22

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

55
## Rule Details
66

docs/rules/jsx-boolean-value.md

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

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
[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

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

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

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
Enforce the closing bracket location for JSX multiline elements.
66

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

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

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
Enforce the closing tag location for multiline JSX elements.
66

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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 on the command line.
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

55
This rule allows you to enforce curly braces or disallow unnecessary curly braces in JSX props and/or children.
66

docs/rules/jsx-curly-newline.md

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

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
Many style guides require or disallow newlines inside of jsx curly expressions.
66

docs/rules/jsx-curly-spacing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Enforce or disallow spaces inside of curly braces in JSX attributes and expressions. (react/jsx-curly-spacing)
22

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
While formatting preferences are very personal, a number of style guides require or disallow spaces between curly braces.
66

docs/rules/jsx-equals-spacing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Enforce or disallow spaces around equal signs in JSX attributes. (react/jsx-equals-spacing)
22

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
Some style guides require or disallow spaces around equal signs.
66

docs/rules/jsx-first-prop-new-line.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Configure the position of the first property (react/jsx-first-prop-new-line)
22

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
Ensure correct position of the first property.
66

7-
Note: The autofixer does not include indentation. Please rerun lint to correct those errors.
7+
Note: The fixer does not include indentation. Please rerun lint to correct those errors.
88

99
## Rule Details
1010

docs/rules/jsx-fragments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Enforce shorthand or standard form for React fragments (react/jsx-fragments)
22

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
In JSX, a React fragment is created either with `<React.Fragment>...</React.Fragment>`, or, using the shorthand syntax, `<>...</>`. This rule allows you to enforce one way or the other.
66

docs/rules/jsx-indent-props.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Validate props indentation in JSX (react/jsx-indent-props)
22

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
This option validates a specific indentation style for props.
66

docs/rules/jsx-indent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Validate JSX indentation (react/jsx-indent)
22

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
This option validates a specific indentation style for JSX.
66

docs/rules/jsx-max-props-per-line.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Limit maximum of props on a single line in JSX (react/jsx-max-props-per-line)
22

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
Limiting the maximum of props on a single line can improve readability.
66

docs/rules/jsx-newline.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Require or prevent a new line after jsx elements and expressions. (react/jsx-newline)
22

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
## Rule Details
66

docs/rules/jsx-no-leaked-render.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Prevent problematic leaked values from being rendered (react/jsx-no-leaked-render)
22

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
Using the `&&` operator to render some element conditionally in JSX can cause unexpected values being rendered, or even crashing the rendering.
66

docs/rules/jsx-no-target-blank.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Prevent usage of unsafe `target='_blank'` (react/jsx-no-target-blank)
22

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
When creating a JSX element that has an `a` tag, it is often desired to have the link open in a new tab using the `target='_blank'` attribute. Using this attribute unaccompanied by `rel='noreferrer'`, however, is a severe security vulnerability (see [noreferrer docs](https://html.spec.whatwg.org/multipage/links.html#link-type-noreferrer) and [noopener docs](https://html.spec.whatwg.org/multipage/links.html#link-type-noopener) for more details)
66
This rules requires that you accompany `target='_blank'` attributes with `rel='noreferrer'`.

docs/rules/jsx-no-useless-fragment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Disallow unnecessary fragments (react/jsx-no-useless-fragment)
22

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a [keyed fragment](https://reactjs.org/docs/fragments.html#keyed-fragments).
66

docs/rules/jsx-one-expression-per-line.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# One JSX Element Per Line (react/jsx-one-expression-per-line)
22

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
This option limits every line in JSX to one expression each.
66

docs/rules/jsx-props-no-multi-spaces.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Disallow multiple spaces between inline JSX props (react/jsx-props-no-multi-spaces)
22

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
Enforces that there is exactly one space between all attributes and after tag name and the first attribute in the same line.
66

docs/rules/jsx-sort-props.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Enforce props alphabetical sorting (react/jsx-sort-props)
22

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
Some developers prefer to sort props names alphabetically to be able to find necessary props easier at the later time. Others feel that it adds complexity and becomes burden to maintain.
66

docs/rules/jsx-space-before-closing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Validate spacing before closing bracket in JSX (react/jsx-space-before-closing)
22

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
**Deprecation notice**: This rule is deprecated. Please use the `"beforeSelfClosing"` option of the [jsx-tag-spacing](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-tag-spacing.md) rule instead.
66

docs/rules/jsx-tag-spacing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Validate whitespace in and around the JSX opening and closing brackets (react/jsx-tag-spacing)
22

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
Enforce or forbid spaces after the opening bracket, before the closing bracket, before the closing bracket of self-closing elements, and between the angle bracket and slash of JSX closing or self-closing elements.
66

docs/rules/jsx-wrap-multilines.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Prevent missing parentheses around multiline JSX (react/jsx-wrap-multilines)
22

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
Wrapping multiline JSX in parentheses can improve readability and/or convenience.
66

docs/rules/no-arrow-function-lifecycle.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Lifecycle methods should be methods on the prototype, not class fields (react/no-arrow-function-lifecycle)
22

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
It is not neccessary to use arrow function for lifecycle methods. This makes things harder to test, conceptually less performant (although in practice, performance will not be affected, since most engines will optimize efficiently), and can break hot reloading patterns.
66

docs/rules/no-invalid-html-attribute.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Prevent usage of invalid attributes (react/no-invalid-html-attribute)
22

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
Some HTML elements have a specific set of valid values for some attributes.
66
For instance the elements: `a`, `area`, `link`, or `form` all have an attribute called `rel`.

docs/rules/no-unknown-property.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Prevent usage of unknown DOM property (react/no-unknown-property)
22

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
In JSX all DOM properties and attributes should be camelCased to be consistent with standard JavaScript style. This can be a possible source of error if you are used to writing plain HTML.
66

docs/rules/prefer-read-only-props.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Enforce that props are read-only (react/prefer-read-only-props)
22

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
Using Flow, one can define types for props. This rule enforces that prop types are read-only (covariant).
66

docs/rules/self-closing-comp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Prevent extra closing tags for components without children (react/self-closing-comp)
22

3-
🔧 This rule is automatically fixable using the `--fix` flag on the command line.
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

55
Components without children can be self-closed to avoid unnecessary extra closing tag.
66

tests/index.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,11 @@ describe('all rule files should be exported by the plugin', () => {
2424

2525
describe('rule documentation files have the correct content', () => {
2626
const MESSAGES = {
27-
fixable:
28-
'🔧 This rule is automatically fixable using the `--fix` flag on the command line.',
29-
hasSuggestions:
30-
'💡 This rule provides [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).',
27+
fixable: '🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line.',
28+
hasSuggestions: '💡 This rule provides editor [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).',
3129
};
3230

33-
for (const ruleFile of ruleFiles) {
31+
ruleFiles.forEach((ruleFile) => {
3432
const ruleName = path.basename(ruleFile, '.js');
3533
const rule = plugin.rules[ruleName];
3634
const documentPath = path.join('docs/rules', `${ruleName}.md`);
@@ -53,17 +51,17 @@ describe('rule documentation files have the correct content', () => {
5351

5452
// Ensure that expected notices are present in the correct order.
5553
let currentLineNumber = 1;
56-
for (const expectedNotice of expectedNotices) {
54+
expectedNotices.forEach((expectedNotice) => {
5755
assert.strictEqual(documentLines[currentLineNumber], '', `${ruleName} includes blank line ahead of ${expectedNotice} notice`);
5856
assert.strictEqual(documentLines[currentLineNumber + 1], MESSAGES[expectedNotice], `${ruleName} includes ${expectedNotice} notice`);
5957
currentLineNumber += 2;
60-
}
58+
});
6159

6260
// Ensure that unexpected notices are not present.
63-
for (const unexpectedNotice of unexpectedNotices) {
61+
unexpectedNotices.forEach((unexpectedNotice) => {
6462
assert.ok(!documentContents.includes(MESSAGES[unexpectedNotice]), `${ruleName} does not include unexpected ${unexpectedNotice} notice`);
65-
}
66-
}
63+
});
64+
});
6765
});
6866

6967
describe('deprecated rules', () => {

0 commit comments

Comments
 (0)