diff --git a/.changeset/solid-2-effect-and-ref-rules.md b/.changeset/solid-2-effect-and-ref-rules.md deleted file mode 100644 index f965737..0000000 --- a/.changeset/solid-2-effect-and-ref-rules.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -"@murky-web/oxlint-plugin-solid": minor ---- - -Add two rules for Solid 2.0's split effects and unowned ref callbacks, and -repair two existing ones. - -`solid/no-untracked-effect-read` reports a reactive read in the apply phase of a -two-argument `createEffect`. That phase runs untracked, so -`createEffect(() => roomId(), (id) => connect(id, theme()))` never re-runs when -`theme` changes. Nothing reported this: `reactivity` marks the apply phase as a -tracked scope, and its model has no state for "matches, but does not subscribe". - -`solid/no-owned-primitives-in-ref` reports `createEffect`, `onCleanup` and -related primitives inside a ref callback. Solid 2.0 ref callbacks are unowned — -`getOwner()` returns null — so the effect is never disposed and the cleanup -never runs. Directive factories, which create these primitives while they still -have an owner, are unaffected. - -`solid/no-setter-in-effect` now also reports an async apply phase that awaits and -writes the result back into a signal. Its existing check requires every -statement to be a setter call, which an `await` breaks. - -`solid/prefer-class-object` matched only the lowercase `classlist`. JSX prop -names are case-sensitive and the Solid 1 prop is `classList`, so the migration -rule missed every real call site. - -`solid/imports` now knows `createLoadingBoundary`, `createErrorBoundary` and -`createRevealOrder`, so importing one from the wrong module is reported like -every neighbouring primitive. - -`solid/jsx-no-duplicate-props` recommended `classList`, which Solid 2.0 removed -and the neighbouring rule reports. It now points at the object and array forms -of `class`. diff --git a/.changeset/typebuddy-oxlint-autofix-repairs.md b/.changeset/typebuddy-oxlint-autofix-repairs.md deleted file mode 100644 index e501b20..0000000 --- a/.changeset/typebuddy-oxlint-autofix-repairs.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -"@murky-web/typebuddy": minor ---- - -Repair the oxlint autofixes and close the rules' blind spots. - -Two fixes were producing broken code. `prefer-maybe-promise` inserted -`return err()` directly before a catch block's closing brace, so -`catch { log("boom") }` became `catch { log("boom") return err(); }`, which does -not parse. `require-try-catch` rebuilt the function body line by line and -stripped leading whitespace from every line — including lines inside template -literals, silently changing string values. It now wraps the body with two -zero-width insertions and leaves it byte for byte intact. - -Six blind spots closed: - -- The catch branch settles on `err()`. It was fed to the same code path as the - try block, so a catch return got two reports with opposite fixes (`ok(value)` - and `err()`), and `--fix` appended an unreachable `return err()` after an - existing return. Returns that hand back a value are now reported without a - fix — rewriting them to `err()` would drop the author's fallback, and where - the default belongs is the author's decision. -- Returns nested inside an `if`, loop or `switch` in a try block are wrapped. - Only the try block's direct children were, so `try { if (flag) return "early"; - return "late"; }` wrapped just `"late"`. -- `Promise` in a type-level signature is reported. `TSDeclareFunction`, - `TSFunctionType` and `TSMethodSignature` were routed through a check for - `async`, which a type signature can never carry, so all three visitors were - unreachable. Ambient `declare` context stays exempt: rewriting a third-party - callback shape would misdescribe that API. -- `MaybePromise` and `AsyncResult` count as awaited return types. Matching only - `Promise` meant a bare `return;` in a `MaybePromise` function was left - alone while its `Promise` twin was fixed — the rule went blind on - already-migrated code, and on the spelling the package recommends. -- Expression-bodied async arrows are reported and fixed. `async () => fetch(url)` - has no block for the try/catch to live in and escaped entirely. -- `null | undefined` is left alone instead of being rewritten to the - equivalent-but-longer `Optional`. - -Also fixed: an inserted helper import landed glued to the following statement in -any file that starts with a comment. Whether to append after an existing import -was inferred from the anchor's byte offset, which only answers that question in -a file whose first statement begins at byte zero. diff --git a/packages/oxlint-plugin-solid/CHANGELOG.md b/packages/oxlint-plugin-solid/CHANGELOG.md index 5b0f9be..5ca1cbb 100644 --- a/packages/oxlint-plugin-solid/CHANGELOG.md +++ b/packages/oxlint-plugin-solid/CHANGELOG.md @@ -1,5 +1,40 @@ # @murky-web/oxlint-plugin-solid +## 1.2.0 + +### Minor Changes + +- 8fdeefb: Add two rules for Solid 2.0's split effects and unowned ref callbacks, and + repair two existing ones. + + `solid/no-untracked-effect-read` reports a reactive read in the apply phase of a + two-argument `createEffect`. That phase runs untracked, so + `createEffect(() => roomId(), (id) => connect(id, theme()))` never re-runs when + `theme` changes. Nothing reported this: `reactivity` marks the apply phase as a + tracked scope, and its model has no state for "matches, but does not subscribe". + + `solid/no-owned-primitives-in-ref` reports `createEffect`, `onCleanup` and + related primitives inside a ref callback. Solid 2.0 ref callbacks are unowned — + `getOwner()` returns null — so the effect is never disposed and the cleanup + never runs. Directive factories, which create these primitives while they still + have an owner, are unaffected. + + `solid/no-setter-in-effect` now also reports an async apply phase that awaits and + writes the result back into a signal. Its existing check requires every + statement to be a setter call, which an `await` breaks. + + `solid/prefer-class-object` matched only the lowercase `classlist`. JSX prop + names are case-sensitive and the Solid 1 prop is `classList`, so the migration + rule missed every real call site. + + `solid/imports` now knows `createLoadingBoundary`, `createErrorBoundary` and + `createRevealOrder`, so importing one from the wrong module is reported like + every neighbouring primitive. + + `solid/jsx-no-duplicate-props` recommended `classList`, which Solid 2.0 removed + and the neighbouring rule reports. It now points at the object and array forms + of `class`. + ## 1.1.0 ### Minor Changes diff --git a/packages/oxlint-plugin-solid/package.json b/packages/oxlint-plugin-solid/package.json index a53f5ce..fb94756 100644 --- a/packages/oxlint-plugin-solid/package.json +++ b/packages/oxlint-plugin-solid/package.json @@ -1,6 +1,6 @@ { "name": "@murky-web/oxlint-plugin-solid", - "version": "1.1.0", + "version": "1.2.0", "description": "Local Oxlint JS plugin port for Solid rules plus Murky-specific Solid conventions.", "license": "MIT", "private": false, diff --git a/packages/typebuddy/CHANGELOG.md b/packages/typebuddy/CHANGELOG.md index 7b94325..fc55eb2 100644 --- a/packages/typebuddy/CHANGELOG.md +++ b/packages/typebuddy/CHANGELOG.md @@ -1,5 +1,49 @@ # @murky-web/typebuddy +## 1.4.0 + +### Minor Changes + +- 6c30131: Repair the oxlint autofixes and close the rules' blind spots. + + Two fixes were producing broken code. `prefer-maybe-promise` inserted + `return err()` directly before a catch block's closing brace, so + `catch { log("boom") }` became `catch { log("boom") return err(); }`, which does + not parse. `require-try-catch` rebuilt the function body line by line and + stripped leading whitespace from every line — including lines inside template + literals, silently changing string values. It now wraps the body with two + zero-width insertions and leaves it byte for byte intact. + + Six blind spots closed: + + - The catch branch settles on `err()`. It was fed to the same code path as the + try block, so a catch return got two reports with opposite fixes (`ok(value)` + and `err()`), and `--fix` appended an unreachable `return err()` after an + existing return. Returns that hand back a value are now reported without a + fix — rewriting them to `err()` would drop the author's fallback, and where + the default belongs is the author's decision. + - Returns nested inside an `if`, loop or `switch` in a try block are wrapped. + Only the try block's direct children were, so `try { if (flag) return "early"; +return "late"; }` wrapped just `"late"`. + - `Promise` in a type-level signature is reported. `TSDeclareFunction`, + `TSFunctionType` and `TSMethodSignature` were routed through a check for + `async`, which a type signature can never carry, so all three visitors were + unreachable. Ambient `declare` context stays exempt: rewriting a third-party + callback shape would misdescribe that API. + - `MaybePromise` and `AsyncResult` count as awaited return types. Matching only + `Promise` meant a bare `return;` in a `MaybePromise` function was left + alone while its `Promise` twin was fixed — the rule went blind on + already-migrated code, and on the spelling the package recommends. + - Expression-bodied async arrows are reported and fixed. `async () => fetch(url)` + has no block for the try/catch to live in and escaped entirely. + - `null | undefined` is left alone instead of being rewritten to the + equivalent-but-longer `Optional`. + + Also fixed: an inserted helper import landed glued to the following statement in + any file that starts with a comment. Whether to append after an existing import + was inferred from the anchor's byte offset, which only answers that question in + a file whose first statement begins at byte zero. + ## 1.3.0 ### Minor Changes diff --git a/packages/typebuddy/jsr.json b/packages/typebuddy/jsr.json index 55fe327..4b06de9 100644 --- a/packages/typebuddy/jsr.json +++ b/packages/typebuddy/jsr.json @@ -1,7 +1,7 @@ { "$schema": "https://jsr.io/schema/config-file.v1.json", "name": "@murky-web/typebuddy", - "version": "1.3.0", + "version": "1.4.0", "license": "ISC", "exports": { ".": "./src/index.ts", diff --git a/packages/typebuddy/package.json b/packages/typebuddy/package.json index 9824bfa..bdab489 100644 --- a/packages/typebuddy/package.json +++ b/packages/typebuddy/package.json @@ -1,6 +1,6 @@ { "name": "@murky-web/typebuddy", - "version": "1.3.0", + "version": "1.4.0", "description": "Your new best friend for simple typescript guards every project needs.", "private": false, "main": "./dist/index.js",