Skip to content

Commit a43ac0f

Browse files
committed
refactor: minor improvements
1 parent 462e107 commit a43ac0f

File tree

10 files changed

+206
-175
lines changed

10 files changed

+206
-175
lines changed

apps/website/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"fumadocs-twoslash": "3.1.1",
2121
"fumadocs-typescript": "4.0.3",
2222
"fumadocs-ui": "15.2.15",
23-
"lucide-react": "^0.507.0",
23+
"lucide-react": "^0.508.0",
2424
"next": "^15.3.2",
2525
"next-view-transitions": "^0.3.4",
2626
"react": "^19.1.0",
@@ -44,7 +44,7 @@
4444
"@tsconfig/strictest": "^2.0.5",
4545
"@types/hast": "^3.0.4",
4646
"@types/mdx": "^2.0.13",
47-
"@types/node": "^22.15.14",
47+
"@types/node": "^22.15.16",
4848
"@types/react": "^19.1.3",
4949
"@types/react-dom": "^19.1.3",
5050
"autoprefixer": "^10.4.21",

examples/next-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"@tsconfig/next": "^2.0.3",
2323
"@tsconfig/node22": "^22.0.1",
2424
"@tsconfig/strictest": "^2.0.5",
25-
"@types/node": "^22.15.14",
25+
"@types/node": "^22.15.16",
2626
"@types/react": "^19.1.3",
2727
"@types/react-dom": "^19.1.3",
2828
"eslint": "^9.26.0",

examples/vite-react-dom-js-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"eslint": "^9.26.0",
2525
"eslint-plugin-react-hooks": "^5.2.0",
2626
"eslint-plugin-react-refresh": "^0.4.20",
27-
"globals": "^16.0.0",
27+
"globals": "^16.1.0",
2828
"vite": "^6.3.5"
2929
},
3030
"engines": {

examples/vite-react-dom-js-with-babel-eslint-parser-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"eslint-plugin-react-refresh": "^0.4.20",
3535
"eslint-plugin-react-web-api": "workspace:*",
3636
"eslint-plugin-react-x": "workspace:*",
37-
"globals": "^16.0.0",
37+
"globals": "^16.1.0",
3838
"vite": "^6.3.5"
3939
},
4040
"engines": {

examples/vite-react-dom-with-ts-blank-eslint-parser-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"eslint": "^9.26.0",
3030
"eslint-plugin-react-hooks": "^5.2.0",
3131
"eslint-plugin-react-refresh": "^0.4.20",
32-
"globals": "^16.0.0",
32+
"globals": "^16.1.0",
3333
"ts-blank-eslint-parser": "^0.4.3",
3434
"typescript": "^5.8.3",
3535
"typescript-eslint": "^8.32.0",

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@
5858
"@swc/core": "^1.11.24",
5959
"@tsconfig/node22": "^22.0.1",
6060
"@tsconfig/strictest": "^2.0.5",
61-
"@types/node": "^22.15.14",
61+
"@types/node": "^22.15.16",
6262
"@types/react": "^19.1.3",
6363
"@types/react-dom": "^19.1.3",
6464
"@typescript-eslint/parser": "^8.32.0",
6565
"@typescript-eslint/rule-tester": "^8.32.0",
6666
"@typescript-eslint/types": "^8.32.0",
6767
"ansis": "^3.17.0",
68-
"cspell": "^9.0.0",
68+
"cspell": "^9.0.1",
6969
"dedent": "^1.6.0",
7070
"dprint": "^0.49.1",
7171
"esbuild": "^0.25.4",
@@ -112,7 +112,7 @@
112112
"@types/react-dom": "^19.1.3",
113113
"cross-spawn": "^7.0.6",
114114
"esbuild": "^0.25.4",
115-
"lucide-react": "^0.507.0",
115+
"lucide-react": "^0.508.0",
116116
"next": "^15.3.2",
117117
"react": "^19.1.0",
118118
"react-dom": "^19.1.0",

packages/plugins/eslint-plugin-react-x/src/rules/jsx-key-before-spread.spec.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,33 @@ ruleTester.run(RULE_NAME, rule, {
3838
{ messageId: "jsxKeyBeforeSpread" },
3939
],
4040
},
41+
{
42+
code: tsx`
43+
44+
const App = (props) => {
45+
return [
46+
<div key="1" {...props} key="2" {...props}>1</div>,
47+
]
48+
};
49+
`,
50+
errors: [
51+
{ messageId: "jsxKeyBeforeSpread" },
52+
],
53+
},
54+
{
55+
code: tsx`
56+
57+
const App = (props) => {
58+
return [
59+
<div {...props} key="1" key="2" {...props}>1</div>,
60+
]
61+
};
62+
`,
63+
errors: [
64+
{ messageId: "jsxKeyBeforeSpread" },
65+
{ messageId: "jsxKeyBeforeSpread" },
66+
],
67+
},
4168
],
4269
valid: [
4370
...allValid,

packages/plugins/eslint-plugin-react-x/src/rules/jsx-key-before-spread.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ export function create(context: RuleContext<MessageID, []>): RuleListener {
3939
firstSpreadAttributeIndex ??= index;
4040
continue;
4141
}
42-
if (attr.name.name === "key" && firstSpreadAttributeIndex != null && index > firstSpreadAttributeIndex) {
42+
if (firstSpreadAttributeIndex == null) {
43+
continue;
44+
}
45+
if (attr.name.name === "key" && index > firstSpreadAttributeIndex) {
4346
context.report({
4447
messageId: "jsxKeyBeforeSpread",
4548
node: attr,

packages/plugins/eslint-plugin-react-x/src/rules/no-implicit-key.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export default createRule<[], MessageID>({
3434
defaultOptions: [],
3535
});
3636

37+
// TODO: Rewrite the rule to use type checking
3738
export function create(context: RuleContext<MessageID, []>): RuleListener {
3839
return {
3940
JSXOpeningElement(node: TSESTree.JSXOpeningElement) {

0 commit comments

Comments
 (0)