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
2 changes: 1 addition & 1 deletion .pkgs/configs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@stylistic/eslint-plugin": "^5.2.3",
"eslint-plugin-de-morgan": "^1.3.1",
"eslint-plugin-function": "^0.0.22",
"eslint-plugin-jsdoc": "^53.0.1",
"eslint-plugin-jsdoc": "^54.0.0",
"eslint-plugin-perfectionist": "^4.15.0",
"eslint-plugin-regexp": "^2.10.0",
"eslint-plugin-unicorn": "^60.0.0",
Expand Down
2 changes: 1 addition & 1 deletion .pkgs/eslint-plugin-local/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@typescript-eslint/types": "^8.39.1",
"@typescript-eslint/utils": "^8.39.1",
"eslint-plugin-de-morgan": "^1.3.1",
"eslint-plugin-jsdoc": "^53.0.1",
"eslint-plugin-jsdoc": "^54.0.0",
"eslint-plugin-perfectionist": "^4.15.0",
"eslint-plugin-regexp": "^2.10.0",
"eslint-plugin-unicorn": "^60.0.0",
Expand Down
1 change: 1 addition & 0 deletions apps/website/content/docs/rules/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"no-direct-set-state-in-use-effect",
"no-direct-set-state-in-use-layout-effect",
"no-duplicate-key",
"no-forbidden-props",
"no-forward-ref",
"no-implicit-key",
"no-leaked-conditional-rendering",
Expand Down
1 change: 1 addition & 0 deletions apps/website/content/docs/rules/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ The `jsx-*` rules check for issues exclusive to JSX syntax, which are absent fro
| [`no-default-props`](./no-default-props) | 2️⃣ | | Disallow `defaultProps` property in favor of ES6 default parameters | |
| [`no-direct-mutation-state`](./no-direct-mutation-state) | 2️⃣ | | Disallow direct mutation of `this.state` | |
| [`no-duplicate-key`](./no-duplicate-key) | 2️⃣ | | Disallow duplicate `key` on elements in the same array or a list of `children` | |
| [`no-forbidden-props`](./no-forbidden-props) | 1️⃣ | `🔧` | Disallow certain props on components | |
| [`no-forward-ref`](./no-forward-ref) | 1️⃣ | `🔄` | Replaces usages of `forwardRef` with passing `ref` as a prop | >=19.0.0 |
| [`no-implicit-key`](./no-implicit-key) | 1️⃣ | `🧪` | Prevents `key` from not being explicitly specified (e.g. spreading `key` from objects) | |
| [`no-leaked-conditional-rendering`](./no-leaked-conditional-rendering) | 1️⃣ | `💭` | Prevents problematic leaked values from being rendered | |
Expand Down
2 changes: 0 additions & 2 deletions examples/rspeedy-react-lynx-app/lynx.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ import { pluginQRCode } from "@lynx-js/qrcode-rsbuild-plugin";
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
import { defineConfig } from "@lynx-js/rspeedy";
import { pluginTypeCheck } from "@rsbuild/plugin-type-check";
import { pluginTailwindCSS } from "rsbuild-plugin-tailwindcss";

export default defineConfig({
plugins: [
pluginReactLynx(),
pluginQRCode(),
pluginTailwindCSS(),
pluginTypeCheck(),
],
environments: {
Expand Down
4 changes: 1 addition & 3 deletions examples/rspeedy-react-lynx-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"devDependencies": {
"@eslint/config-inspector": "^1.1.0",
"@eslint/js": "^9.33.0",
"@lynx-contrib/tailwind-preset": "^0.0.2",
"@lynx-js/qrcode-rsbuild-plugin": "^0.4.0",
"@lynx-js/react-rsbuild-plugin": "^0.10.11",
"@lynx-js/rspeedy": "^0.10.6",
Expand All @@ -29,7 +28,6 @@
"@rsbuild/plugin-type-check": "^1.2.4",
"@types/react": "^19.1.10",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-x": "workspace:*",
"rsbuild-plugin-tailwindcss": "^0.2.3"
"eslint-plugin-react-x": "workspace:*"
}
}
3 changes: 0 additions & 3 deletions examples/rspeedy-react-lynx-app/src/App.css
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
11 changes: 5 additions & 6 deletions examples/rspeedy-react-lynx-app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,25 @@ export function App() {

return (
<page>
<view className="flex flex-col justify-center items-center min-h-screen text-center">
<text className="text-6xl font-bold leading-normal underline">
<view>
<text>
ReactLynx + TailwindCSS
</text>
<text className="text-lg font-normal text-gray-500 leading-normal">
<text>
Start building amazing things with ReactLynx.
</text>
<view
className="flex flex-row p-20 rounded-full"
style={{
backgroundColor: "rgba(255, 255, 255, 0.5)",
padding: "40px",
margin: "10px",
}}
>
<text className="text-4xl font-bold text-gray-800">
<text>
Count: {count}
</text>
</view>
<view className="grid grid-cols-3 gap-4">
<view>
<text>01</text>
<text>02</text>
<text>03</text>
Expand Down
7 changes: 0 additions & 7 deletions examples/rspeedy-react-lynx-app/tailwind.config.js

This file was deleted.

2 changes: 2 additions & 0 deletions packages/plugins/eslint-plugin-react-x/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import noCreateRef from "./rules/no-create-ref";
import noDefaultProps from "./rules/no-default-props";
import noDirectMutationState from "./rules/no-direct-mutation-state";
import noDuplicateKey from "./rules/no-duplicate-key";
import noForbiddenProps from "./rules/no-forbidden-props";
import noForwardRef from "./rules/no-forward-ref";
import noImplicitKey from "./rules/no-implicit-key";
import noLeakedConditionalRendering from "./rules/no-leaked-conditional-rendering";
Expand Down Expand Up @@ -104,6 +105,7 @@ export const plugin = {
"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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RuleListener } from "@typescript-eslint/utils/ts-eslint";
import { type RuleContext, type RuleFeature, RegExp } from "@eslint-react/kit";
import { RegExp as RE, type RuleContext, type RuleFeature } from "@eslint-react/kit";

import { AST_NODE_TYPES as T } from "@typescript-eslint/types";
import { camelCase, type CamelCase } from "string-ts";
Expand All @@ -8,7 +8,9 @@ import { createRule } from "../utils";
export const RULE_NAME = "no-forbidden-props";

export const RULE_FEATURES = ["CFG"] as const satisfies RuleFeature[];

export type MessageID = CamelCase<typeof RULE_NAME>;

const messageId = camelCase(RULE_NAME);

type Options = readonly [
Expand Down Expand Up @@ -113,15 +115,14 @@ export function create(context: RuleContext<MessageID, Options>, [option]: Optio
}
const forbiddenProp = typeof forbiddenPropItem === "string" ? forbiddenPropItem : forbiddenPropItem.prop;

const forbiddenPropRegExp = RegExp.toRegExp(forbiddenProp);
const forbiddenPropRegExp = RE.toRegExp(forbiddenProp);
if (forbiddenPropRegExp.test(name)) {
context.report({
messageId,
node: attr,
data: { name },
});
}

}
}
},
Expand Down
40 changes: 7 additions & 33 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading