@thomaflette/eslint-plugin-solid-2 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Thomas Guehenneux
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,87 @@
1
+ # @thomaflette/eslint-plugin-solid-2
2
+
3
+ Sound ESLint rules for [Solid 2](https://github.com/solidjs/solid/tree/next) reactivity and idiomatic control flow.
4
+
5
+ Solid 2 changes how effects, ownership, async computations, and control-flow callbacks behave. This plugin catches the mistakes that TypeScript cannot express, while deliberately avoiding diagnostics that `tsc` already provides.
6
+
7
+ > Solid 2 is currently beta. This package tracks `solid-js@2.0.0-beta.17`.
8
+
9
+ ## Install
10
+
11
+ ```sh
12
+ pnpm add -D @thomaflette/eslint-plugin-solid-2 eslint typescript @typescript-eslint/parser
13
+ ```
14
+
15
+ ## Configure
16
+
17
+ Use the base config when your linter runs without TypeScript program information:
18
+
19
+ ```js
20
+ // eslint.config.js
21
+ import solid from "@thomaflette/eslint-plugin-solid-2";
22
+
23
+ export default [solid.configs.recommended];
24
+ ```
25
+
26
+ For a TypeScript project, prefer the type-checked config. It adds cross-file component detection and enables `prefer-for` only when the receiver is proven to be an array:
27
+
28
+ ```js
29
+ // eslint.config.js
30
+ import solid from "@thomaflette/eslint-plugin-solid-2";
31
+ import tsParser from "@typescript-eslint/parser";
32
+
33
+ export default [
34
+ {
35
+ ...solid.configs["recommended-type-checked"],
36
+ languageOptions: {
37
+ parser: tsParser,
38
+ parserOptions: {
39
+ projectService: true,
40
+ },
41
+ },
42
+ },
43
+ ];
44
+ ```
45
+
46
+ The `flat/recommended` and `flat/recommended-type-checked` names are aliases for tools that expect that convention.
47
+
48
+ ## Rules
49
+
50
+ | Rule | What it protects |
51
+ | ----------------------------------- | -------------------------------------------------------------------------------------------------------- |
52
+ | `components-return-once` | Reactive conditional and early returns that freeze component structure. |
53
+ | `jsx-no-duplicate-props` | Competing host-element content sources such as `children`, JSX children, `innerHTML`, and `textContent`. |
54
+ | `no-destructure` | Destructuring component props, which performs untracked reads. |
55
+ | `no-leaf-owner-operations` | Invalid cleanup, flush, and child-owner work inside leaf owners. |
56
+ | `no-owned-scope-writes` | State writes and action calls from component or compute scopes. |
57
+ | `no-reactive-read-after-await` | Accessor reads after an `await` in a reactive computation. |
58
+ | `no-stale-props-alias` | Top-level aliases of reactive prop reads. |
59
+ | `no-untracked-read-in-effect-apply` | Signal and store reads in an effect apply callback. |
60
+ | `prefer-for` | Uses `<For>` for reactive array rendering when type information proves `Array#map`. |
61
+ | `prefer-show` | Uses `<Show>` for idiomatic reactive JSX conditionals. |
62
+ | `self-closing-comp` | Keeps empty JSX elements consistently self-closing. |
63
+
64
+ Every rule has focused documentation in [docs](./docs).
65
+
66
+ ## Design principles
67
+
68
+ - TypeScript owns type errors. The plugin does not duplicate diagnostics for invalid JSX names, duplicate attributes, accessor/value mismatches, or other type-checkable mistakes.
69
+ - Correct code should stay quiet. When a rule cannot prove a problem, it prefers a false negative to a false positive.
70
+ - Autofixes must preserve behavior. Ambiguous cases are reported without a fix or left for an explicit editor suggestion.
71
+
72
+ The reasoning behind these choices is recorded in the [architecture decision records](./docs/adr).
73
+
74
+ ## Development
75
+
76
+ This repository uses [Vite+](https://viteplus.dev/).
77
+
78
+ ```sh
79
+ vp install
80
+ vp check
81
+ vp test
82
+ vp run build
83
+ ```
84
+
85
+ ## License
86
+
87
+ [MIT](./LICENSE)