biome-plugin-solid-router
raw JSON → 0.2.0 verified Fri May 01 auth: no javascript
A Biome GritQL plugin providing lint rules for @solidjs/router, catching common API mistakes from React Router muscle memory at lint time. Current stable version is 0.2.0, released with OIDC trusted publishing. The plugin's five rules (solid-router-no-link-component, solid-router-no-to-prop, solid-router-no-initial-entries, solid-router-no-routes-wrapper, solid-router-no-element-prop) identify wrong imports, props, and usage patterns. Requires Biome >= 2.0.0 and works via GritQL AST matching. Unlike TypeScript- or ESLint-based solutions, it catches mistakes without type information, but for full type-aware linting should be combined with eslint-plugin-solid.
Common errors
error Biome configuration error: Plugin not found: biome-plugin-solid-router ↓
cause Biome version < 2.0.0 does not support GritQL plugins.
fix
Update @biomejs/biome to >= 2.0.0 (npm install -D @biomejs/biome@latest).
error Error: Cannot find module './node_modules/biome-plugin-solid-router/rules/solid-router-no-link-component.grit' ↓
cause Typo in file path or rule file missing (single rule reference mistake).
fix
Verify the file exists in node_modules/biome-plugin-solid-router/rules/ and the path is correct. Use the package name instead: "biome-plugin-solid-router".
Warnings
breaking Plugin requires Biome >= 2.0.0; older Biome versions do not support GritQL plugins. ↓
fix Upgrade Biome to 2.0.0 or later (npm update @biomejs/biome).
gotcha Rules only apply to imports from @solidjs/router; importing Link from other packages (e.g., lucide-solid) is not flagged. ↓
fix No fix needed — intended behavior. But be aware that false negatives can occur if router components are re-exported under a different name.
gotcha GritQL rules cannot detect type-level mistakes (e.g., passing JSX to component= prop, route param mismatches). For those, use eslint-plugin-solid alongside. ↓
fix Add eslint-plugin-solid to your linting setup for full type-aware linting.
deprecated In v0.1.1, referencing the plugin by file path in biome.json still works but the package-name reference (biome-plugin-solid-router) is preferred since v0.2.0. ↓
fix Use { "plugins": ["biome-plugin-solid-router"] } in biome.json.
Install
npm install biome-plugin-solid-router yarn add biome-plugin-solid-router pnpm add biome-plugin-solid-router Imports
- plugin wrong
// Wrong: referencing a file path (use plugin name in biome.json) { "plugins": ["./node_modules/biome-plugin-solid-router/index.grit"] }correct// Add to biome.json: { "plugins": ["biome-plugin-solid-router"] } - individual rule wrong
// Wrong: trying to import via require or import statement const rule = require('biome-plugin-solid-router/rules/solid-router-no-link-component');correct// In biome.json: { "plugins": ["./node_modules/biome-plugin-solid-router/rules/solid-router-no-link-component.grit"] } - all rules wrong
// Wrong: using an import from the package in JS/TS code import 'biome-plugin-solid-router';correct// In biome.json: { "plugins": ["biome-plugin-solid-router"] }
Quickstart
{
"plugins": ["biome-plugin-solid-router"]
}