Skip to content

Commit eb3f3d6

Browse files
bmishljharb
authored andcommitted
[Docs] Add config notice to rule docs
1 parent 6207a04 commit eb3f3d6

File tree

99 files changed

+226
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+226
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
4141
* [Docs] Standardize deprecated rule notice ([#3364][] @bmish)
4242
* [Docs] Fix typos ([#3366][] @bmish)
4343
* [Docs] Add markdownlint for documentation formatting consistency ([#3367][] @bmish)
44+
* [Docs] Add config notice to rule docs ([#3362][] @bmish)
4445

4546
[#3367]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3367
4647
[#3366]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3366
4748
[#3365]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3365
4849
[#3364]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3364
50+
[#3362]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3362
4951
[#3361]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3361
5052
[#3359]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3359
5153
[#3355]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3355

docs/rules/boolean-prop-naming.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Enforces consistent naming for boolean props (react/boolean-prop-naming)
22

3+
💼 This rule is enabled in the following [configs](https://github.com/jsx-eslint/eslint-plugin-react#shareable-configurations): `all`.
4+
35
Allows you to enforce a consistent naming pattern for props which expect a boolean value.
46

57
> **Note**: You can provide types in runtime types using [PropTypes] and/or

docs/rules/button-has-type.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Disallow usage of `button` elements without an explicit `type` attribute (react/button-has-type)
22

3+
💼 This rule is enabled in the following [configs](https://github.com/jsx-eslint/eslint-plugin-react#shareable-configurations): `all`.
4+
35
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.
46
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"`).
57

docs/rules/default-props-match-prop-types.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Enforce all defaultProps have a corresponding non-required PropType (react/default-props-match-prop-types)
22

3+
💼 This rule is enabled in the following [configs](https://github.com/jsx-eslint/eslint-plugin-react#shareable-configurations): `all`.
4+
35
This rule aims to ensure that any prop in `defaultProps` has a non-required type
46
definition.
57

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 enabled in the following [configs](https://github.com/jsx-eslint/eslint-plugin-react#shareable-configurations): `all`.
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
Rule can be set to either of `always` or `never`;

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 enabled in the following [configs](https://github.com/jsx-eslint/eslint-plugin-react#shareable-configurations): `all`, `recommended`.
4+
35
DisplayName allows you to name your component. This name is used by React in debugging messages.
46

57
## Rule Details

docs/rules/forbid-component-props.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Disallow certain props on components (react/forbid-component-props)
22

3+
💼 This rule is enabled in the following [configs](https://github.com/jsx-eslint/eslint-plugin-react#shareable-configurations): `all`.
4+
35
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.
46

57
## Rule Details

docs/rules/forbid-dom-props.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Disallow certain props on DOM Nodes (react/forbid-dom-props)
22

3+
💼 This rule is enabled in the following [configs](https://github.com/jsx-eslint/eslint-plugin-react#shareable-configurations): `all`.
4+
35
This rule prevents passing of props to elements. This rule only applies to DOM Nodes (e.g. `<div />`) and not Components (e.g. `<Component />`).
46
The list of forbidden props can be customized with the `forbid` option.
57

docs/rules/forbid-elements.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Disallow certain elements (react/forbid-elements)
22

3+
💼 This rule is enabled in the following [configs](https://github.com/jsx-eslint/eslint-plugin-react#shareable-configurations): `all`.
4+
35
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.
46

57
## Rule Details

docs/rules/forbid-foreign-prop-types.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Disallow using another component's propTypes (react/forbid-foreign-prop-types)
22

3+
💼 This rule is enabled in the following [configs](https://github.com/jsx-eslint/eslint-plugin-react#shareable-configurations): `all`.
4+
35
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.
46

57
In order to ensure that imports are explicitly exported it is recommended to use the ["named" rule in eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import/blob/HEAD/docs/rules/named.md) in conjunction with this rule.

0 commit comments

Comments
 (0)