Repository navigation
v0.16.0
The complete Solid 2.0 lint surface: version-aware rules, new v2 / v2-strict configs, and a
full set of 2.0-specific rules, all vetted against the official Solid 2.0 templates (which lint
clean with zero errors and zero warnings under the v2 config).
Features
settings.solid.version. Rules can now read the targeted Solid major version from ESLint
settings (settings: { solid: { version: 2 } }). Unset means the permissive dual-version
behavior from 0.15. The new configs preset it; any custom config can opt in with one line.- New
v2config (eslint-plugin-solid/configs/v2, alsosolid.configs.v2): what the
official Solid 2.0 templates ship. Sets the version setting, switches existing rules to strict
2.0 semantics, and enables the new 2.0 rules — errors are reserved for near-certain bugs,
heuristics stay warnings. - New
v2-strictconfig (eslint-plugin-solid/configs/v2-strict): everything inv2plus
the plugin's strongest opinions (see below). - New rule
solid/removed-api(error inv2): flags removed/renamed 1.x APIs with
autofixes where mechanical (onMount→onSettled,batch→flush,mergeProps→merge,
unwrap→snapshot,equalFn→isEqual,getListener→getObserver,
classList={{...}}→class={{...}},"solid-js/web"→"@solidjs/web",
"solid-js/store"→"solid-js") and prescriptive migration messages otherwise
(createResource,on,Suspense→Loading,Index→<For keyed={false}>,produce, etc.).
Lists verified against the Solid 2.0 RC source. - New rule
solid/no-single-arg-create-effect(error inv2): Solid 2.0 requires the split
createEffect(compute, effect)form. The single-argument 1.x form produces no TS compile error
on a bare statement call and only throws at runtime in dev mode; this rule is the build-time
hard stop for the most commonly reproduced AI mistake. - New rule
solid/no-accessor-as-prop(error inv2):<div title={count} />silently
renders a stringified function. Fires on any expression that statically resolves to a function
in a value-typed DOM attribute, with a message that states the fix (count→count()).
Event handlers,ref,children, namespaced attributes, components, and custom elements are
exempt. - New rule
solid/prefer-structured-class(warning inv2, error inv2-strict): nudges
manually-built class strings (concatenation with conditionals, conditional template literals,
.join(" ")) toward the structured array/objectClassValueforms that Solid 2.0 accepts
natively. Static strings and plain interpolation are untouched. - New rule
solid/no-module-scope-reactive-primitive(error inv2-strictonly): reactive
state at module scope is shared across SSR requests.createRoot-wrapped module state is the
deliberate escape hatch and is not flagged. - New rule
solid/prefer-onSettled-for-side-effects(warning inv2-strictonly): flags
side-effectful setup (timers, global listeners, observers) in component bodies, where it also
runs during SSR; suggestsonSettled. Never flagsonCleanupitself. - New rule
solid/no-restated-default-options(error inv2-strictonly, autofixable):
removes restated defaults like<For keyed={true}>and<Show keyed={false}>. - Version-2 behavior in existing rules (active when
settings.solid.versionis 2):solid/no-unknown-namespacesinverts its premise: namespaces are no longer reserved in 2.0,
so any colon-name is a legal literal attribute — but the formerly-special prefixesuse:,
attr:,bool:,on:, andoncapture:are flagged as near-certain 1.x migration bugs with
per-prefix guidance.prop:remains the only special namespace.solid/event-handlersgraduates from style to correctness: only camelCaseonClickis an
event handler in 2.0; a lowercaseonclickwith a function value is a listener that will
never fire (autofixed to camelCase for known DOM events). Lowercase names with static string
values are legitimate literal attributes and are no longer flagged.onDoubleClick(which
lowercases to a nonexistent DOM event) is autofixed toonDblClick.solid/importsrequires the 2.0 export locations: store exports from core"solid-js", web
exports from"@solidjs/web". The legacysolid-js/store/solid-js/websubpaths are
solid/removed-api's territory, avoiding double reports.solid/jsx-no-undefauto-imports the 2.0 control-flow components (For,Repeat,Show,
Switch,Match,Errored,Loading,Reveal);Indexis no longer suggested.solid/reactivitydelegates its uncalled-signal-in-DOM-attribute case to
solid/no-accessor-as-propso a node never gets two reports.solid/no-react-depsself-gates off (a dependency array in the second argument is already a
type and runtime error in 2.0).
- Template vetting. A fixture test runs the
v2config over sources copied from the official
Solid 2.0 templates in CI, andtest/lint-templates.mjssweeps a localsolidjs/templates
checkout. All elevensolid-v2/*templates lint clean.