Repository navigation
Two new rules, a lighter install, and fixes so --fix stops writing 1.x code or changing behavior
under the Solid 2.0 configs. Thanks to @everton-dgn (#227, #236, #238), @dex157 (#232),
@devagrawal09 (#246, #239 report), @brenelz (#248), @ethan-huo (#250 report), and the #249
reporter.
New Rules
solid/validate-jsx-nesting(error inrecommended, so alsotypescript,v2and
v2-strict) (#227 by @everton-dgn, fixes #226). Reports JSX whose nesting the HTML parser
restructures, like<p><div /></p>.validate-html-nestingfilters candidates andparse5
confirms that the parser really moves the pair, which is the same check the 2.0 compiler uses.
SVG and MathML are parsed in their own namespace. Children inserted through an expression
(<p>{ok && <div />}</p>) get their own message, because the client inserts them as written and
only server-rendered HTML and hydration break. Only the direct parent is checked. No autofix.solid/action-yield-after-await(off in every preset; opt in) (#236 by @everton-dgn, fixes
#229). Requires a bareyieldafter eachawaitin an async generator passed toaction(),
so later writes resume inside the action's transaction.yield until(await x)is reported,
because its operand runs before the generator re-enters. Simple statements autofix by inserting
yield;.solid/no-unassigned-vars(#232 by @dex157, fixes #231). ESLint 10'sno-unassigned-vars,
except thatref={el}counts as an assignment, since the compiler assignsel.
recommendedturns the core rule off in its favour.ref={[el]}is still reported, because
arrays are not assigned.
Fixes
solid/removed-api:createDeferredandfromare no longer reported (#246 by
@devagrawal09). Both exist in Solid 2.0. The guidance foronError,catchError,
ErrorBoundaryandSuspenseListnow points to<Errored>,<Reveal>and the error option of
createEffectinstead of the internalcreateErrorBoundaryandcreateRevealOrder.solid/removed-api: no unattended rewrites that change behavior (#252, fixes #249).
onMount→onSettled,batch→flush,mergeProps→mergeandunwrap→snapshot
are still reported, but--fixno longer applies them. The message names the behavior
difference, and the rename is offered as an editor suggestion.equalFn→isEqualand
getListener→getObserverare still auto-fixed. Thesolid-js/storemove message for
createStoreandreconcilenow notes that the setter andreconcile's signature changed.solid/no-destructure: 2.0 helpers and imports (#253, fixes #239). Under
settings.solid.version: 2, the autofix writesmerge(...)for defaults and
omit(props, ...keys)for rest instead of the removedmergeProps/splitProps. It now adds
the helpers to the file'ssolid-jsimport, or adds the import, in both modes. The defaults +
rest line ends with a newline again. Note thatmergelets an explicitundefinedoverride a
default, which destructuring defaults did not.solid/prefer-for(#253). Under 2.0 the index-list message suggests<For keyed={false}>
instead of the removed<Index>.solid/reactivity:dynamicComponentsources are tracked scopes (#238 by @everton-dgn,
fixes #237), likedynamic. Reads after the firstawaitare still reported.solid/reactivity: two false positives (#251, fixes #250). A helper closure declared as a
statement in a block-bodied memo no longer counts as returned (staleCapture), and the map
function ofArray.from(iterable, mapFn)is treated as a synchronous callback.
Packaging
- No runtime dependency on
@typescript-eslint/utils(#248 by @brenelz, landed via #255,
fixes #247). TypeScript 7 installs no longer report an unmet peer, and thetypescriptpeer
dependency is removed. The rules use a localcreateRulewith the same option merging. - ESLint is an optional peer (#248). Oxlint users can install the plugin without ESLint.
@eslint-community/eslint-utilsis bundled intodist, and its license ships in
THIRD_PARTY_LICENSES.md. - New runtime dependencies:
parse5andvalidate-html-nestingforvalidate-jsx-nesting, and
eslint-visitor-keys(#248).