Skip to content

Commit 054a365

Browse files
committed
Deprecate no-forbidden-props rule
1 parent 9712cbd commit 054a365

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

apps/website/content/docs/removed.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ full: true
1414
| `react-x/jsx-no-duplicate-props` | [`react-x/jsx-no-duplicate-props`](/docs/rules/jsx-no-duplicate-props) | 2.0.0 | renamed |
1515
| `react-x/no-comment-textnodes` | [`react-x/jsx-no-comment-textnodes`](/docs/rules/jsx-no-comment-textnodes) | 2.0.0 | renamed |
1616
| `react-x/no-complicated-conditional-rendering` | | 2.0.0 | discontinued |
17+
| `react-x/no-forbidden-props` | | 2.3.1 | deprecated |
1718
| `react-x/no-nested-components` | [`react-x/no-nested-component-definitions`](/docs/rules/no-nested-component-definitions) | 2.0.0 | renamed |
1819
| `react-x/prefer-react-namespace-import` | [`react-x/prefer-namespace-import`](/docs/rules/prefer-namespace-import) | 2.0.0 | renamed |
1920
| `react-x/prefer-shorthand-boolean` | [`react-x/jsx-shorthand-boolean`](/docs/rules/jsx-shorthand-boolean) | 2.0.0 | consolidated |

apps/website/content/docs/rules/overview.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ full: true
5555
| [`no-default-props`](./no-default-props) | 2️⃣ 2️⃣ | | Disallow `defaultProps` property in favor of ES6 default parameters | |
5656
| [`no-direct-mutation-state`](./no-direct-mutation-state) | 2️⃣ 2️⃣ | | Disallow direct mutation of `this.state` | |
5757
| [`no-duplicate-key`](./no-duplicate-key) | 2️⃣ 2️⃣ | | Disallow duplicate `key` on elements in the same array or a list of `children` | |
58-
| [`no-forbidden-props`](./no-forbidden-props) | 1️⃣ 1️⃣ | `🔧` | Disallow certain props on components | |
5958
| [`no-forward-ref`](./no-forward-ref) | 1️⃣ 1️⃣ | `🔄` | Replaces usages of `forwardRef` with passing `ref` as a prop | >=19.0.0 |
6059
| [`no-implicit-key`](./no-implicit-key) | 1️⃣ 1️⃣ | `🧪` | Prevents `key` from not being explicitly specified (e.g. spreading `key` from objects) | |
6160
| [`no-leaked-conditional-rendering`](./no-leaked-conditional-rendering) | 1️⃣ 1️⃣ | `💭` | Prevents problematic leaked values from being rendered | |

packages/plugins/eslint-plugin-react-x/src/rules/no-forbidden-props.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ react-x/no-forbidden-props
1818

1919
`🔧` `🧪`
2020

21+
<Callout type="warning" title="Deprecated">
22+
This rule is deprecated. AST-based component props restrictions can be easily bypassed and this rule is not significantly more effective than using `no-restricted-syntax` to achieve the same result. For similar prop restriction requirements, we recommend using static type checking instead.
23+
</Callout>
24+
2125
## Description
2226

2327
Disallow certain props on components. This rule helps enforce consistent prop naming conventions and prevents the use of specific props that may be problematic or against your team's coding standards.

packages/plugins/eslint-plugin-react-x/src/rules/no-forbidden-props.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export default createRule<Options, MessageID>({
3333
meta: {
3434
type: "problem",
3535
defaultOptions: [...defaultOptions],
36+
deprecated: true,
3637
docs: {
3738
description: "Disallow certain props on components.",
3839
},

0 commit comments

Comments
 (0)