Skip to content

Commit

Permalink
docs: update eslint-doc-generator to 0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
bmish committed Oct 21, 2022
1 parent 8b0f8a9 commit 2325184
Show file tree
Hide file tree
Showing 103 changed files with 162 additions and 152 deletions.
49 changes: 24 additions & 25 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/rules/boolean-prop-naming.md
@@ -1,6 +1,6 @@
# Enforces consistent naming for boolean props (`react/boolean-prop-naming`)

<!-- end rule header -->
<!-- end auto-generated rule header -->

Allows you to enforce a consistent naming pattern for props which expect a boolean value.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/button-has-type.md
@@ -1,6 +1,6 @@
# Disallow usage of `button` elements without an explicit `type` attribute (`react/button-has-type`)

<!-- end rule header -->
<!-- end auto-generated rule header -->

The default value of `type` attribute for `button` HTML element is `"submit"` which is often not the desired behavior and may lead to unexpected page reloads.
This rules enforces an explicit `type` attribute for all the `button` elements and checks that its value is valid per spec (i.e., is one of `"button"`, `"submit"`, and `"reset"`).
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/default-props-match-prop-types.md
@@ -1,6 +1,6 @@
# Enforce all defaultProps have a corresponding non-required PropType (`react/default-props-match-prop-types`)

<!-- end rule header -->
<!-- end auto-generated rule header -->

This rule aims to ensure that any prop in `defaultProps` has a non-required type
definition.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/destructuring-assignment.md
Expand Up @@ -2,7 +2,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->

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

Expand Down
4 changes: 2 additions & 2 deletions docs/rules/display-name.md
@@ -1,8 +1,8 @@
# Disallow missing displayName in a React component definition (`react/display-name`)

This rule is enabled in the `recommended` [config](https://github.com/jsx-eslint/eslint-plugin-react/#shareable-configs).
💼 This rule is enabled in the `recommended` [config](https://github.com/jsx-eslint/eslint-plugin-react/#shareable-configs).

<!-- end rule header -->
<!-- end auto-generated rule header -->

DisplayName allows you to name your component. This name is used by React in debugging messages.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/forbid-component-props.md
@@ -1,6 +1,6 @@
# Disallow certain props on components (`react/forbid-component-props`)

<!-- end rule header -->
<!-- end auto-generated rule header -->

By default this rule prevents passing of [props that add lots of complexity](https://medium.com/brigade-engineering/don-t-pass-css-classes-between-components-e9f7ab192785) (`className`, `style`) to Components. This rule only applies to Components (e.g. `<Foo />`) and not DOM nodes (e.g. `<div />`). The list of forbidden props can be customized with the `forbid` option.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/forbid-dom-props.md
@@ -1,6 +1,6 @@
# Disallow certain props on DOM Nodes (`react/forbid-dom-props`)

<!-- end rule header -->
<!-- end auto-generated rule header -->

This rule prevents passing of props to elements. This rule only applies to DOM Nodes (e.g. `<div />`) and not Components (e.g. `<Component />`).
The list of forbidden props can be customized with the `forbid` option.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/forbid-elements.md
@@ -1,6 +1,6 @@
# Disallow certain elements (`react/forbid-elements`)

<!-- end rule header -->
<!-- end auto-generated rule header -->

You may want to forbid usage of certain elements in favor of others, (e.g. forbid all `<div />` and use `<Box />` instead). This rule allows you to configure a list of forbidden elements and to specify their desired replacements.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/forbid-foreign-prop-types.md
@@ -1,6 +1,6 @@
# Disallow using another component's propTypes (`react/forbid-foreign-prop-types`)

<!-- end rule header -->
<!-- end auto-generated rule header -->

This rule forbids using another component's prop types unless they are explicitly imported/exported. This allows people who want to use [babel-plugin-transform-react-remove-prop-types](https://github.com/oliviertassinari/babel-plugin-transform-react-remove-prop-types) to remove propTypes from their components in production builds, to do so safely.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/forbid-prop-types.md
@@ -1,6 +1,6 @@
# Disallow certain propTypes (`react/forbid-prop-types`)

<!-- end rule header -->
<!-- end auto-generated rule header -->

By default this rule prevents vague prop types with more specific alternatives available (`any`, `array`, `object`), but any prop type can be disabled if desired. The defaults are chosen because they have obvious replacements. `any` should be replaced with, well, anything. `array` and `object` can be replaced with `arrayOf` and `shape`, respectively.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/function-component-definition.md
Expand Up @@ -2,7 +2,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->

This option enforces a specific function type for function components.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/hook-use-state.md
Expand Up @@ -2,7 +2,7 @@

💡 This rule is manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).

<!-- end rule header -->
<!-- end auto-generated rule header -->

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/iframe-missing-sandbox.md
@@ -1,6 +1,6 @@
# Enforce sandbox attribute on iframe elements (`react/iframe-missing-sandbox`)

<!-- end rule header -->
<!-- end auto-generated rule header -->

The sandbox attribute enables an extra set of restrictions for the content in the iframe. Using sandbox attribute is considered a good security practice.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-boolean-value.md
Expand Up @@ -2,7 +2,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-child-element-spacing.md
@@ -1,6 +1,6 @@
# Enforce or disallow spaces inside of curly braces in JSX attributes and expressions (`react/jsx-child-element-spacing`)

<!-- end rule header -->
<!-- end auto-generated rule header -->

## Rule Details

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-closing-bracket-location.md
Expand Up @@ -2,7 +2,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->

Enforce the closing bracket location for JSX multiline elements.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-closing-tag-location.md
Expand Up @@ -2,7 +2,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->

Enforce the closing tag location for multiline JSX elements.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-curly-brace-presence.md
Expand Up @@ -2,7 +2,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-curly-newline.md
Expand Up @@ -2,7 +2,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-curly-spacing.md
Expand Up @@ -2,7 +2,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-equals-spacing.md
Expand Up @@ -2,7 +2,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->

Some style guides require or disallow spaces around equal signs.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-filename-extension.md
@@ -1,6 +1,6 @@
# Disallow file extensions that may contain JSX (`react/jsx-filename-extension`)

<!-- end rule header -->
<!-- end auto-generated rule header -->

## Rule Details

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-first-prop-new-line.md
Expand Up @@ -2,7 +2,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->

Ensure correct position of the first property.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-fragments.md
Expand Up @@ -2,7 +2,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->

In JSX, a React [fragment] is created either with `<React.Fragment>...</React.Fragment>`, or, using the shorthand syntax, `<>...</>`.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-handler-names.md
@@ -1,6 +1,6 @@
# Enforce event handler naming conventions in JSX (`react/jsx-handler-names`)

<!-- end rule header -->
<!-- end auto-generated rule header -->

Ensures that any component or prop methods used to handle events are correctly prefixed.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-indent-props.md
Expand Up @@ -2,7 +2,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->

This option validates a specific indentation style for props.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-indent.md
Expand Up @@ -2,7 +2,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->

This option validates a specific indentation style for JSX.

Expand Down
4 changes: 2 additions & 2 deletions docs/rules/jsx-key.md
@@ -1,8 +1,8 @@
# Disallow missing `key` props in iterators/collection literals (`react/jsx-key`)

This rule is enabled in the `recommended` [config](https://github.com/jsx-eslint/eslint-plugin-react/#shareable-configs).
💼 This rule is enabled in the `recommended` [config](https://github.com/jsx-eslint/eslint-plugin-react/#shareable-configs).

<!-- end rule header -->
<!-- end auto-generated rule header -->

Warn if an element that likely requires a `key` prop--namely, one present in an
array literal or an arrow function expression.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-max-depth.md
@@ -1,6 +1,6 @@
# Enforce JSX maximum depth (`react/jsx-max-depth`)

<!-- end rule header -->
<!-- end auto-generated rule header -->

This option validates a specific depth for JSX.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-max-props-per-line.md
Expand Up @@ -2,7 +2,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-newline.md
Expand Up @@ -2,7 +2,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->

## Rule Details

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-no-bind.md
@@ -1,6 +1,6 @@
# Disallow `.bind()` or arrow functions in JSX props (`react/jsx-no-bind`)

<!-- end rule header -->
<!-- end auto-generated rule header -->

A `bind` call or [arrow function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions) in a JSX prop will create a brand new function on every single render. This is bad for performance, as it may cause unnecessary re-renders if a brand new function is passed as a prop to a component that uses reference equality check on the prop to determine if it should update.

Expand Down
4 changes: 2 additions & 2 deletions docs/rules/jsx-no-comment-textnodes.md
@@ -1,8 +1,8 @@
# Disallow comments from being inserted as text nodes (`react/jsx-no-comment-textnodes`)

This rule is enabled in the `recommended` [config](https://github.com/jsx-eslint/eslint-plugin-react/#shareable-configs).
💼 This rule is enabled in the `recommended` [config](https://github.com/jsx-eslint/eslint-plugin-react/#shareable-configs).

<!-- end rule header -->
<!-- end auto-generated rule header -->

This rule prevents comment strings (e.g. beginning with `//` or `/*`) from being accidentally
injected as a text node in JSX statements.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-no-constructed-context-values.md
@@ -1,6 +1,6 @@
# Disallows JSX context provider values from taking values that will cause needless rerenders (`react/jsx-no-constructed-context-values`)

<!-- end rule header -->
<!-- end auto-generated rule header -->

This rule prevents non-stable values (i.e. object identities) from being used as a value for `Context.Provider`.

Expand Down
4 changes: 2 additions & 2 deletions docs/rules/jsx-no-duplicate-props.md
@@ -1,8 +1,8 @@
# Disallow duplicate properties in JSX (`react/jsx-no-duplicate-props`)

This rule is enabled in the `recommended` [config](https://github.com/jsx-eslint/eslint-plugin-react/#shareable-configs).
💼 This rule is enabled in the `recommended` [config](https://github.com/jsx-eslint/eslint-plugin-react/#shareable-configs).

<!-- end rule header -->
<!-- end auto-generated rule header -->

Creating JSX elements with duplicate props can cause unexpected behavior in your application.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-no-leaked-render.md
Expand Up @@ -2,7 +2,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-no-literals.md
@@ -1,6 +1,6 @@
# Disallow usage of string literals in JSX (`react/jsx-no-literals`)

<!-- end rule header -->
<!-- end auto-generated rule header -->

There are a few scenarios where you want to avoid string literals in JSX. You may want to enforce consistency, reduce syntax highlighting issues, or ensure that strings are part of a translation system.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-no-script-url.md
@@ -1,6 +1,6 @@
# Disallow usage of `javascript:` URLs (`react/jsx-no-script-url`)

<!-- end rule header -->
<!-- end auto-generated rule header -->

**In React 16.9** any URLs starting with `javascript:` [scheme](https://wiki.whatwg.org/wiki/URL_schemes#javascript:_URLs) log a warning.
React considers the pattern as a dangerous attack surface, see [details](https://reactjs.org/blog/2019/08/08/react-v16.9.0.html#deprecating-javascript-urls).
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/jsx-no-target-blank.md
@@ -1,10 +1,10 @@
# Disallow `target="_blank"` attribute without `rel="noreferrer"` (`react/jsx-no-target-blank`)

This rule is enabled in the `recommended` [config](https://github.com/jsx-eslint/eslint-plugin-react/#shareable-configs).
💼 This rule is enabled in the `recommended` [config](https://github.com/jsx-eslint/eslint-plugin-react/#shareable-configs).

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->

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)
This rules requires that you accompany `target='_blank'` attributes with `rel='noreferrer'`.
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/jsx-no-undef.md
@@ -1,8 +1,8 @@
# Disallow undeclared variables in JSX (`react/jsx-no-undef`)

This rule is enabled in the `recommended` [config](https://github.com/jsx-eslint/eslint-plugin-react/#shareable-configs).
💼 This rule is enabled in the `recommended` [config](https://github.com/jsx-eslint/eslint-plugin-react/#shareable-configs).

<!-- end rule header -->
<!-- end auto-generated rule header -->

This rule helps locate potential ReferenceErrors resulting from misspellings or missing components.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-no-useless-fragment.md
Expand Up @@ -2,7 +2,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-one-expression-per-line.md
Expand Up @@ -2,7 +2,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-pascal-case.md
@@ -1,6 +1,6 @@
# Enforce PascalCase for user-defined JSX components (`react/jsx-pascal-case`)

<!-- end rule header -->
<!-- end auto-generated rule header -->

Enforces coding style that user-defined JSX components are defined and referenced in PascalCase.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-props-no-multi-spaces.md
Expand Up @@ -2,7 +2,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->

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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/jsx-props-no-spreading.md
@@ -1,6 +1,6 @@
# Disallow JSX prop spreading (`react/jsx-props-no-spreading`)

<!-- end rule header -->
<!-- end auto-generated rule header -->

Enforces that there is no spreading for any JSX attribute. This enhances readability of code by being more explicit about what props are received by the component. It is also good for maintainability by avoiding passing unintentional extra props and allowing react to emit warnings when invalid HTML props are passed to HTML elements.

Expand Down

0 comments on commit 2325184

Please sign in to comment.