@thomaflette/eslint-plugin-solid-2 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -3
- package/dist/index.cjs +810 -468
- package/dist/index.d.cts +79 -63
- package/dist/index.d.mts +79 -63
- package/dist/index.mjs +810 -468
- package/docs/README.md +24 -0
- package/docs/adr/0001-only-false-positive-free-rules.md +65 -0
- package/docs/adr/0002-sound-component-detection.md +66 -0
- package/docs/adr/0003-require-solid-binding.md +50 -0
- package/docs/adr/0004-correctness-guard-not-migration-tool.md +48 -0
- package/docs/adr/0005-recommended-type-checked-config.md +27 -0
- package/docs/adr/0006-merge-leaf-owner-rules.md +42 -0
- package/docs/adr/0007-typescript-audience.md +35 -0
- package/docs/components-return-once.md +89 -0
- package/docs/dev-diagnostic-coverage.md +29 -0
- package/docs/jsx-no-duplicate-props.md +34 -0
- package/docs/no-destructure.md +92 -0
- package/docs/no-leaf-owner-operations.md +90 -0
- package/docs/no-owned-scope-writes.md +117 -0
- package/docs/no-reactive-read-after-await.md +87 -0
- package/docs/no-stale-props-alias.md +157 -0
- package/docs/no-untracked-read-in-effect-apply.md +97 -0
- package/docs/prefer-for.md +81 -0
- package/docs/prefer-show.md +59 -0
- package/docs/self-closing-comp.md +42 -0
- package/package.json +7 -5
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# `solid/self-closing-comp`
|
|
2
|
+
|
|
3
|
+
Prefer self-closing syntax for empty JSX elements when allowed by the rule options.
|
|
4
|
+
|
|
5
|
+
This is a formatting/layout rule. It reports empty JSX elements that should be written as self-closing, or self-closing elements that should keep explicit closing tags based on the configured `html` and `component` options.
|
|
6
|
+
|
|
7
|
+
## Bad
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
<div></div>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
<Button></Button>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Good
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
<div />
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
<Button />
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
<div> </div>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Notes
|
|
32
|
+
|
|
33
|
+
- **Why a stylistic rule lives in a correctness plugin:** this is the one deliberate scope
|
|
34
|
+
exception. It survives because it is _semantically inert_ (the report and both autofix
|
|
35
|
+
directions cannot change behavior, so the zero-FP/zero-corrupting-autofix bars are trivially
|
|
36
|
+
met), no formatter in the toolchain performs this normalization, and it was carried forward from
|
|
37
|
+
the original `eslint-plugin-solid` where users expect it. It is held to the same bars as every
|
|
38
|
+
other rule; it just guards style rather than correctness.
|
|
39
|
+
- `component` controls Solid/JSX components: `"all"` or `"none"`.
|
|
40
|
+
- `html` controls DOM elements: `"all"`, `"void"`, or `"none"`.
|
|
41
|
+
- Whitespace-only multiline children are treated as empty and can still be self-closed.
|
|
42
|
+
- Non-breaking spaces and explicit space expressions are treated as real children and are not self-closed.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thomaflette/eslint-plugin-solid-2",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Sound ESLint rules for Solid 2 reactivity and idiomatic control flow.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"url": "git+https://github.com/yumemi-thomas/eslint-plugin-solid-2.git"
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
|
-
"dist"
|
|
24
|
+
"dist",
|
|
25
|
+
"docs"
|
|
25
26
|
],
|
|
26
27
|
"type": "module",
|
|
27
28
|
"main": "./dist/index.cjs",
|
|
@@ -38,15 +39,15 @@
|
|
|
38
39
|
"access": "public"
|
|
39
40
|
},
|
|
40
41
|
"dependencies": {
|
|
41
|
-
"@typescript-eslint/utils": "^8.
|
|
42
|
+
"@typescript-eslint/utils": "^8.63.0"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
45
|
"@types/node": "^25.6.0",
|
|
45
|
-
"@typescript-eslint/parser": "^8.
|
|
46
|
+
"@typescript-eslint/parser": "^8.63.0",
|
|
46
47
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
47
48
|
"@typescript/native-preview": "7.0.0-dev.20260502.1",
|
|
48
49
|
"bumpp": "^11.0.1",
|
|
49
|
-
"eslint": "
|
|
50
|
+
"eslint": "10.7.0",
|
|
50
51
|
"solid-js": "2.0.0-beta.17",
|
|
51
52
|
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
52
53
|
"vite-plus": "^0.1.20"
|
|
@@ -60,6 +61,7 @@
|
|
|
60
61
|
},
|
|
61
62
|
"scripts": {
|
|
62
63
|
"build": "vp pack",
|
|
64
|
+
"bench": "vp test bench",
|
|
63
65
|
"dev": "vp pack --watch",
|
|
64
66
|
"test": "vp test",
|
|
65
67
|
"check": "vp check"
|