solid-doctor
v0.1.0
Published
Static migration and correctness diagnostics for Solid 2.
Maintainers
Readme
solid-doctor
Static migration and correctness diagnostics for Solid 2.
This is an early scaffold focused on high-confidence, static-only findings. It deliberately does not try to replace eslint-plugin-solid, infer every reactive data-flow issue, or trace runtime performance.
Try it
npm install
npm run build
npx solid-doctor@latest /path/to/solid-project
node dist/cli.js /path/to/solid-project
node dist/cli.js /path/to/solid-project --json
node dist/cli.js /path/to/solid-project --diff origin/main...HEAD
node dist/cli.js /path/to/solid-project --write-baseline .solid-doctor-baseline.json
node dist/cli.js /path/to/solid-project --baseline .solid-doctor-baseline.json
node dist/cli.js migrate /path/to/solid-project
node dist/cli.js migrate /path/to/solid-project --apply
npx solid-doctor@latest ci install
npx solid-doctor@latest ci install --dry-runci install creates .github/workflows/solid-doctor.yml for pull-request scans. It refuses to overwrite an existing custom workflow unless --force is passed.
Rules
solid/migrate-legacy-import— replaces removed Solid 1 package exports with their Solid 2 locations. Safe auto-fix.solid/migrate-removed-api— reports removed APIs such ascreateResource,Suspense,batch, andonMount, via named or namespace imports. Unused imports are not reported. These require semantic migration and are not auto-fixed.solid/migrate-legacy-jsx— reports removeduse:,on:,attr:,bool:, andclassListsyntax.solid/config-jsx-runtime— validates explicit Solid 2 JSX configuration.solid/reactive-props-destructure— warns on destructured props in likely Solid components, including body patterns such asconst { count } = props.solid/no-top-level-reactive-read— warns on direct top-level reads of props and known Solid accessors, while ignoring JSX, nested reactive computations, and seed idioms such ascreateSignal(props.open ?? true).solid/no-server-only-in-client— reports imports of server-only modules (e.g.solid-js/server) in files reachable from a client entry. Reachability is computed over the full project graph.
Every rule has a confidence tier and fixability flag. The first semantic rules are intentionally conservative; a false-positive regression should fail the fixture suite before a rule is expanded.
Scanning strategy
Diff-scoped scans (--diff) report only findings in changed files, plus files a changed file imports directly for project-level rules. A change that makes a transitively distant file newly client-reachable is only caught by a full scan, so the recommended setup is:
- Pull requests: diff scan, as installed by
ci install(--diff base.sha...head.sha). - Main branch: full scan without
--diff, so nothing escapes the one-hop policy.
Project direction
Migration warns when migrate detects Solid 1 dependencies because it intentionally targets Solid 2 and may rewrite imports that are valid in Solid 1. Planned additions are deeper store/async rules (optimistic-store writes, hydration discipline) once they can meet the same confidence standard; runtime tracing remains out of scope.
Baselines use exact fingerprints first, then a normalized code-site hash to survive unrelated line shifts. Older baselines containing only findings remain supported; newly written baselines also contain stableFindings.
