Skip to content

Commit 0307999

Browse files
committed
[Docs] Add recommended notice to rule docs
1 parent 13d23b8 commit 0307999

22 files changed

+48
-0
lines changed

docs/rules/display-name.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Disallow missing displayName in a React component definition (react/display-name)
22

3+
✔️ This rule is part of the [recommended](https://github.com/jsx-eslint/eslint-plugin-react#recommended) config.
4+
35
DisplayName allows you to name your component. This name is used by React in debugging messages.
46

57
## Rule Details

docs/rules/jsx-key.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Disallow missing `key` props in iterators/collection literals (react/jsx-key)
22

3+
✔️ This rule is part of the [recommended](https://github.com/jsx-eslint/eslint-plugin-react#recommended) config.
4+
35
Warn if an element that likely requires a `key` prop--namely, one present in an
46
array literal or an arrow function expression.
57

docs/rules/jsx-no-comment-textnodes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Disallow comments from being inserted as text nodes (react/jsx-no-comment-textnodes)
22

3+
✔️ This rule is part of the [recommended](https://github.com/jsx-eslint/eslint-plugin-react#recommended) config.
4+
35
This rule prevents comment strings (e.g. beginning with `//` or `/*`) from being accidentally
46
injected as a text node in JSX statements.
57

docs/rules/jsx-no-duplicate-props.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Disallow duplicate properties in JSX (react/jsx-no-duplicate-props)
22

3+
✔️ This rule is part of the [recommended](https://github.com/jsx-eslint/eslint-plugin-react#recommended) config.
4+
35
Creating JSX elements with duplicate props can cause unexpected behavior in your application.
46

57
## Rule Details

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Disallow `target="_blank"` attribute without `rel="noreferrer"` (react/jsx-no-target-blank)
22

3+
✔️ This rule is part of the [recommended](https://github.com/jsx-eslint/eslint-plugin-react#recommended) config.
4+
35
🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line.
46

57
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)

docs/rules/jsx-no-undef.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Disallow undeclared variables in JSX (react/jsx-no-undef)
22

3+
✔️ This rule is part of the [recommended](https://github.com/jsx-eslint/eslint-plugin-react#recommended) config.
4+
35
This rule helps locate potential ReferenceErrors resulting from misspellings or missing components.
46

57
## Rule Details

docs/rules/jsx-uses-react.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Disallow React to be incorrectly marked as unused (react/jsx-uses-react)
22

3+
✔️ This rule is part of the [recommended](https://github.com/jsx-eslint/eslint-plugin-react#recommended) config.
4+
35
JSX expands to a call to `React.createElement`, a file which includes `React`
46
but only uses JSX should consider the `React` variable as used.
57

docs/rules/jsx-uses-vars.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Disallow variables used in JSX to be incorrectly marked as unused (react/jsx-uses-vars)
22

3+
✔️ This rule is part of the [recommended](https://github.com/jsx-eslint/eslint-plugin-react#recommended) config.
4+
35
Since 0.17.0 the `eslint` `no-unused-vars` rule does not detect variables used in JSX ([see details](https://eslint.org/blog/2015/03/eslint-0.17.0-released#changes-to-jsxreact-handling)). This rule will find variables used in JSX and mark them as used.
46

57
This rule only has an effect when the `no-unused-vars` rule is enabled.

docs/rules/no-children-prop.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Disallow passing of children as props (react/no-children-prop)
22

3+
✔️ This rule is part of the [recommended](https://github.com/jsx-eslint/eslint-plugin-react#recommended) config.
4+
35
Children should always be actual children, not passed in as a prop.
46

57
When using JSX, the children should be nested between the opening and closing

docs/rules/no-danger-with-children.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Disallow when a DOM element is using both children and dangerouslySetInnerHTML (react/no-danger-with-children)
22

3+
✔️ This rule is part of the [recommended](https://github.com/jsx-eslint/eslint-plugin-react#recommended) config.
4+
35
This rule helps prevent problems caused by using children and the dangerouslySetInnerHTML prop at the same time.
46
React will throw a warning if this rule is ignored.
57

0 commit comments

Comments
 (0)