v0.5.0
One new rule and small improvements to solid/reactivity
.
New Rule: solid/event-handlers
Some folks found a possibly confusing behavior in the way Solid compiles event handlers and discussed it in Discord and in #23. The new solid/event-handlers
rule will make sure that there is no ambiguity in whether or not Solid treats a prop on a native element as an event handler or as a regular attribute. The main idea is to use onFoo
(capital third letter) for event handlers and attr:onfoo
for plain attributes whenever the prop starts with on
, and the lint rule will make this as unobtrusive as possible.
Other changes
- There was a subtle bug in how
solid/reactivity
handled synchronous callbacks likeArray#forEach
when analyzing scopes that's now fixed. solid/reactivity
now treats Solid'sonCleanup
andonError
primitives in the same way asonMount
, reducing potentially confusing and incorrect warnings.untrack
is now treated as a proper "tracking scope", which turned out to be the right call as the rule gained more usage.- Named functions containing props or signal accesses can now be passed directly to an event handler without the need to wrap in yet another function for
solid/reactivity
. solid/no-unknown-namespaces
now warns on namespaced props on function components, because they have no effect. (this is uncommon)
Full Changelog: v0.4.7...v0.5.0