Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/website/content/docs/removed.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ full: true
| `react-x/jsx-no-duplicate-props` | [`react-x/jsx-no-duplicate-props`](/docs/rules/jsx-no-duplicate-props) | 2.0.0 | renamed |
| `react-x/no-comment-textnodes` | [`react-x/jsx-no-comment-textnodes`](/docs/rules/jsx-no-comment-textnodes) | 2.0.0 | renamed |
| `react-x/no-complicated-conditional-rendering` | | 2.0.0 | discontinued |
| `react-x/no-forbidden-props` | | 2.3.1 | deprecated |
| `react-x/no-nested-components` | [`react-x/no-nested-component-definitions`](/docs/rules/no-nested-component-definitions) | 2.0.0 | renamed |
| `react-x/prefer-react-namespace-import` | [`react-x/prefer-namespace-import`](/docs/rules/prefer-namespace-import) | 2.0.0 | renamed |
| `react-x/prefer-shorthand-boolean` | [`react-x/jsx-shorthand-boolean`](/docs/rules/jsx-shorthand-boolean) | 2.0.0 | consolidated |
Expand Down
1 change: 0 additions & 1 deletion apps/website/content/docs/rules/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ full: true
| [`no-default-props`](./no-default-props) | 2️⃣ 2️⃣ | | Disallow `defaultProps` property in favor of ES6 default parameters | |
| [`no-direct-mutation-state`](./no-direct-mutation-state) | 2️⃣ 2️⃣ | | Disallow direct mutation of `this.state` | |
| [`no-duplicate-key`](./no-duplicate-key) | 2️⃣ 2️⃣ | | Disallow duplicate `key` on elements in the same array or a list of `children` | |
| [`no-forbidden-props`](./no-forbidden-props) | 1️⃣ 1️⃣ | `🔧` | Disallow certain props on components | |
| [`no-forward-ref`](./no-forward-ref) | 1️⃣ 1️⃣ | `🔄` | Replaces usages of `forwardRef` with passing `ref` as a prop | >=19.0.0 |
| [`no-implicit-key`](./no-implicit-key) | 1️⃣ 1️⃣ | `🧪` | Prevents `key` from not being explicitly specified (e.g. spreading `key` from objects) | |
| [`no-leaked-conditional-rendering`](./no-leaked-conditional-rendering) | 1️⃣ 1️⃣ | `💭` | Prevents problematic leaked values from being rendered | |
Expand Down
6 changes: 5 additions & 1 deletion packages/plugins/eslint-plugin-react-x/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ export const plugin: CompatiblePlugin = {
"no-default-props": noDefaultProps,
"no-direct-mutation-state": noDirectMutationState,
"no-duplicate-key": noDuplicateKey,
"no-forbidden-props": noForbiddenProps,
"no-forward-ref": noForwardRef,
"no-implicit-key": noImplicitKey,
"no-leaked-conditional-rendering": noLeakedConditionalRendering,
Expand Down Expand Up @@ -135,5 +134,10 @@ export const plugin: CompatiblePlugin = {
"prefer-namespace-import": preferNamespaceImport,
"prefer-read-only-props": preferReadOnlyProps,
"prefer-use-state-lazy-initialization": preferUseStateLazyInitialization,

/**
* @deprecated Use no-restricted-syntax or type checking instead.
*/
"no-forbidden-props": noForbiddenProps,
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ react-x/no-forbidden-props

`🔧` `🧪`

<Callout type="warning" title="Deprecated">
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.
</Callout>

## Description

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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export default createRule<Options, MessageID>({
meta: {
type: "problem",
defaultOptions: [...defaultOptions],
deprecated: true,
docs: {
description: "Disallow certain props on components.",
},
Expand Down