Skip to content

Commit 0b031c7

Browse files
committed
feat(tsl-rules-of-react): implement key prop ordering and implicit spread rules
- Add Rule003: Enforce key prop placement before spread attributes in new JSX transform - Add Rule004: Detect implicit key passing via spread props with non-React.Attributes.key types - Add React/Preact dev dependencies for type checking - Add tsl-shared workspace dependency - Update documentation to remove @todo markers for implemented rules
1 parent 10ea6b3 commit 0b031c7

24 files changed

+480
-294
lines changed

.pkgs/configs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
"@tsconfig/node24": "^24.0.4",
1818
"@tsconfig/strictest": "^2.0.8",
1919
"tsl": "^1.0.29",
20-
"tsl-dx": "workspace:*"
20+
"tsl-dx": "^0.7.0"
2121
}
2222
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"update:version": "tsx ./scripts/update-version.ts"
3232
},
3333
"devDependencies": {
34-
"@effect/platform": "^0.94.4",
34+
"@effect/platform": "^0.94.5",
3535
"@effect/platform-node": "^0.104.1",
3636
"@eslint/compat": "^2.0.2",
3737
"@local/configs": "workspace:*",
@@ -41,7 +41,7 @@
4141
"@types/node": "^25.2.3",
4242
"ansis": "^4.2.0",
4343
"dprint": "^0.51.1",
44-
"effect": "^3.19.16",
44+
"effect": "^3.19.17",
4545
"publint": "^0.3.17",
4646
"skott": "^0.35.7",
4747
"sort-package-json": "^3.6.1",
@@ -51,7 +51,7 @@
5151
"tsl": "^1.0.29",
5252
"tsl-dx": "workspace:*",
5353
"tsx": "latest",
54-
"typedoc": "^0.28.16",
54+
"typedoc": "^0.28.17",
5555
"typedoc-plugin-markdown": "^4.10.0",
5656
"typedoc-plugin-mdn-links": "^5.1.1",
5757
"typescript": "^5.9.3",

packages/tsl-rules-of-react/docs/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
| Variable | Description |
66
| ------ | ------ |
7-
| [rulesOfComponentHookFactories](variables/rulesOfComponentHookFactories.md) | @todo: implement this |
8-
| [rulesOfEffect](variables/rulesOfEffect.md) | @todo: implement this |
9-
| [rulesOfJsx](variables/rulesOfJsx.md) | @todo: implement this |
10-
| [rulesOfKeys](variables/rulesOfKeys.md) | @todo: implement this |
11-
| [rulesOfProps](variables/rulesOfProps.md) | @todo: implement this |
12-
| [rulesOfRefs](variables/rulesOfRefs.md) | @todo: implement this |
13-
| [rulesOfRender](variables/rulesOfRender.md) | @todo: implement this |
14-
| [rulesOfState](variables/rulesOfState.md) | @todo: implement this |
7+
| [rulesOfComponentHookFactories](variables/rulesOfComponentHookFactories.md) | - |
8+
| [rulesOfEffect](variables/rulesOfEffect.md) | - |
9+
| [rulesOfJsx](variables/rulesOfJsx.md) | TS checks for most of the issues described at https://react.dev/learn/writing-markup-with-jsx#the-rules-of-jsx by default, so there isn't much for us to implement. |
10+
| [rulesOfKeys](variables/rulesOfKeys.md) | - |
11+
| [rulesOfProps](variables/rulesOfProps.md) | - |
12+
| [rulesOfRefs](variables/rulesOfRefs.md) | - |
13+
| [rulesOfRender](variables/rulesOfRender.md) | - |
14+
| [rulesOfState](variables/rulesOfState.md) | - |

packages/tsl-rules-of-react/docs/variables/rulesOfComponentHookFactories.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
const rulesOfComponentHookFactories: (options?: "off") => Rule<unknown>;
77
```
88

9-
@todo: implement this
10-
119
## Parameters
1210

1311
| Parameter | Type |
@@ -17,3 +15,7 @@ const rulesOfComponentHookFactories: (options?: "off") => Rule<unknown>;
1715
## Returns
1816

1917
`Rule`\<`unknown`\>
18+
19+
## Todo
20+
21+
implement this

packages/tsl-rules-of-react/docs/variables/rulesOfEffect.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
const rulesOfEffect: (options?: "off") => Rule<unknown>;
77
```
88

9-
@todo: implement this
10-
119
## Parameters
1210

1311
| Parameter | Type |
@@ -17,3 +15,7 @@ const rulesOfEffect: (options?: "off") => Rule<unknown>;
1715
## Returns
1816

1917
`Rule`\<`unknown`\>
18+
19+
## Todo
20+
21+
implement this

packages/tsl-rules-of-react/docs/variables/rulesOfJsx.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
const rulesOfJsx: (options?: "off") => Rule<unknown>;
77
```
88

9-
@todo: implement this
9+
TS checks for most of the issues described at https://react.dev/learn/writing-markup-with-jsx#the-rules-of-jsx
10+
by default, so there isn't much for us to implement.
1011

1112
## Parameters
1213

packages/tsl-rules-of-react/docs/variables/rulesOfKeys.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
const rulesOfKeys: (options?: "off") => Rule<unknown>;
77
```
88

9-
@todo: implement this
10-
119
## Parameters
1210

1311
| Parameter | Type |

packages/tsl-rules-of-react/docs/variables/rulesOfProps.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
const rulesOfProps: (options?: "off") => Rule<unknown>;
77
```
88

9-
@todo: implement this
10-
119
## Parameters
1210

1311
| Parameter | Type |
@@ -17,3 +15,7 @@ const rulesOfProps: (options?: "off") => Rule<unknown>;
1715
## Returns
1816

1917
`Rule`\<`unknown`\>
18+
19+
## Todo
20+
21+
implement this

packages/tsl-rules-of-react/docs/variables/rulesOfRefs.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
const rulesOfRefs: (options?: "off") => Rule<unknown>;
77
```
88

9-
@todo: implement this
10-
119
## Parameters
1210

1311
| Parameter | Type |
@@ -17,3 +15,7 @@ const rulesOfRefs: (options?: "off") => Rule<unknown>;
1715
## Returns
1816

1917
`Rule`\<`unknown`\>
18+
19+
## Todo
20+
21+
implement this

packages/tsl-rules-of-react/docs/variables/rulesOfRender.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
const rulesOfRender: (options?: "off") => Rule<unknown>;
77
```
88

9-
@todo: implement this
10-
119
## Parameters
1210

1311
| Parameter | Type |
@@ -17,3 +15,7 @@ const rulesOfRender: (options?: "off") => Rule<unknown>;
1715
## Returns
1816

1917
`Rule`\<`unknown`\>
18+
19+
## Todo
20+
21+
implement this

0 commit comments

Comments
 (0)