Skip to content

Commit c145a5c

Browse files
authored
fix: export 'react-x/no-forbidden-props' rule and add it to rules overview page (#1169)
1 parent 4fdbc9a commit c145a5c

File tree

12 files changed

+23
-59
lines changed

12 files changed

+23
-59
lines changed

.pkgs/configs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@stylistic/eslint-plugin": "^5.2.3",
2424
"eslint-plugin-de-morgan": "^1.3.1",
2525
"eslint-plugin-function": "^0.0.22",
26-
"eslint-plugin-jsdoc": "^53.0.1",
26+
"eslint-plugin-jsdoc": "^54.0.0",
2727
"eslint-plugin-perfectionist": "^4.15.0",
2828
"eslint-plugin-regexp": "^2.10.0",
2929
"eslint-plugin-unicorn": "^60.0.0",

.pkgs/eslint-plugin-local/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@typescript-eslint/types": "^8.39.1",
3434
"@typescript-eslint/utils": "^8.39.1",
3535
"eslint-plugin-de-morgan": "^1.3.1",
36-
"eslint-plugin-jsdoc": "^53.0.1",
36+
"eslint-plugin-jsdoc": "^54.0.0",
3737
"eslint-plugin-perfectionist": "^4.15.0",
3838
"eslint-plugin-regexp": "^2.10.0",
3939
"eslint-plugin-unicorn": "^60.0.0",

apps/website/content/docs/rules/meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"no-direct-set-state-in-use-effect",
3232
"no-direct-set-state-in-use-layout-effect",
3333
"no-duplicate-key",
34+
"no-forbidden-props",
3435
"no-forward-ref",
3536
"no-implicit-key",
3637
"no-leaked-conditional-rendering",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ The `jsx-*` rules check for issues exclusive to JSX syntax, which are absent fro
5858
| [`no-default-props`](./no-default-props) | 2️⃣ | | Disallow `defaultProps` property in favor of ES6 default parameters | |
5959
| [`no-direct-mutation-state`](./no-direct-mutation-state) | 2️⃣ | | Disallow direct mutation of `this.state` | |
6060
| [`no-duplicate-key`](./no-duplicate-key) | 2️⃣ | | Disallow duplicate `key` on elements in the same array or a list of `children` | |
61+
| [`no-forbidden-props`](./no-forbidden-props) | 1️⃣ | `🔧` | Disallow certain props on components | |
6162
| [`no-forward-ref`](./no-forward-ref) | 1️⃣ | `🔄` | Replaces usages of `forwardRef` with passing `ref` as a prop | >=19.0.0 |
6263
| [`no-implicit-key`](./no-implicit-key) | 1️⃣ | `🧪` | Prevents `key` from not being explicitly specified (e.g. spreading `key` from objects) | |
6364
| [`no-leaked-conditional-rendering`](./no-leaked-conditional-rendering) | 1️⃣ | `💭` | Prevents problematic leaked values from being rendered | |

examples/rspeedy-react-lynx-app/lynx.config.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ import { pluginQRCode } from "@lynx-js/qrcode-rsbuild-plugin";
22
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
33
import { defineConfig } from "@lynx-js/rspeedy";
44
import { pluginTypeCheck } from "@rsbuild/plugin-type-check";
5-
import { pluginTailwindCSS } from "rsbuild-plugin-tailwindcss";
65

76
export default defineConfig({
87
plugins: [
98
pluginReactLynx(),
109
pluginQRCode(),
11-
pluginTailwindCSS(),
1210
pluginTypeCheck(),
1311
],
1412
environments: {

examples/rspeedy-react-lynx-app/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"devDependencies": {
2121
"@eslint/config-inspector": "^1.1.0",
2222
"@eslint/js": "^9.33.0",
23-
"@lynx-contrib/tailwind-preset": "^0.0.2",
2423
"@lynx-js/qrcode-rsbuild-plugin": "^0.4.0",
2524
"@lynx-js/react-rsbuild-plugin": "^0.10.11",
2625
"@lynx-js/rspeedy": "^0.10.6",
@@ -29,7 +28,6 @@
2928
"@rsbuild/plugin-type-check": "^1.2.4",
3029
"@types/react": "^19.1.10",
3130
"eslint-plugin-react-hooks": "^5.2.0",
32-
"eslint-plugin-react-x": "workspace:*",
33-
"rsbuild-plugin-tailwindcss": "^0.2.3"
31+
"eslint-plugin-react-x": "workspace:*"
3432
}
3533
}
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
@tailwind base;
2-
@tailwind components;
3-
@tailwind utilities;

examples/rspeedy-react-lynx-app/src/App.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,25 @@ export function App() {
77

88
return (
99
<page>
10-
<view className="flex flex-col justify-center items-center min-h-screen text-center">
11-
<text className="text-6xl font-bold leading-normal underline">
10+
<view>
11+
<text>
1212
ReactLynx + TailwindCSS
1313
</text>
14-
<text className="text-lg font-normal text-gray-500 leading-normal">
14+
<text>
1515
Start building amazing things with ReactLynx.
1616
</text>
1717
<view
18-
className="flex flex-row p-20 rounded-full"
1918
style={{
2019
backgroundColor: "rgba(255, 255, 255, 0.5)",
2120
padding: "40px",
2221
margin: "10px",
2322
}}
2423
>
25-
<text className="text-4xl font-bold text-gray-800">
24+
<text>
2625
Count: {count}
2726
</text>
2827
</view>
29-
<view className="grid grid-cols-3 gap-4">
28+
<view>
3029
<text>01</text>
3130
<text>02</text>
3231
<text>03</text>

examples/rspeedy-react-lynx-app/tailwind.config.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/plugins/eslint-plugin-react-x/src/plugin.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import noCreateRef from "./rules/no-create-ref";
2727
import noDefaultProps from "./rules/no-default-props";
2828
import noDirectMutationState from "./rules/no-direct-mutation-state";
2929
import noDuplicateKey from "./rules/no-duplicate-key";
30+
import noForbiddenProps from "./rules/no-forbidden-props";
3031
import noForwardRef from "./rules/no-forward-ref";
3132
import noImplicitKey from "./rules/no-implicit-key";
3233
import noLeakedConditionalRendering from "./rules/no-leaked-conditional-rendering";
@@ -104,6 +105,7 @@ export const plugin = {
104105
"no-default-props": noDefaultProps,
105106
"no-direct-mutation-state": noDirectMutationState,
106107
"no-duplicate-key": noDuplicateKey,
108+
"no-forbidden-props": noForbiddenProps,
107109
"no-forward-ref": noForwardRef,
108110
"no-implicit-key": noImplicitKey,
109111
"no-leaked-conditional-rendering": noLeakedConditionalRendering,

0 commit comments

Comments
 (0)