Releases: solidjs-community/eslint-plugin-solid
v0.7.2
This release adds support for common reactivity patterns (i.e. solid-styled-components) using tagged template literals. Details in #29
Under the hood, there's been a lot of groundwork done for bringing eslint-plugin-solid to the Solid Playground—more to come soon.
Full Changelog: v0.7.1...v0.7.2
v0.7.1
Small release! Docs and rule improvements.
- Added missing descriptions and defaults for rule options. Details in #27
- Improved and added tests for
solid/prefer-show. Note that it's"off"by default insolid/recommended. solid/reactivitywill now catch several new cases where signals need to be called but aren't. Details in #28
Full Changelog: v0.7.0...v0.7.1
v0.7.0
Little quality of life updates ✨
New Features
Added solid/jsx-no-duplicate-props, solid/jsx-no-script-url, and solid/self-closing-comp, ported from eslint-plugin-react with some adaptations.
Changes
solid/no-react-specific-props now warns on and removes key props on DOM elements, to migrate React code.
Full Changelog: v0.6.1...v0.7.0
v0.6.1
Changes
- Fixes
solid/components-return-onceto warn when returning a conditional expression with an&&operator, ex.return props.cond && <p>Text</p>;. - Fixes
solid/event-handlersto correct the case of common event handlers, even when the event name ("click" inonClick) begins with an uppercase letter. Resolves #26.
Full Changelog: v0.6.0...v0.6.1
v0.6.0
New Rule: solid/components-return-once
Warns on React-like early returns or returned ternary expressions, because Solid components run once. This was a point of confusion on Twitter and a rule seems like the sort of thing to sort that out.
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/reactivityhandled synchronous callbacks likeArray#forEachwhen analyzing scopes that's now fixed. solid/reactivitynow treats Solid'sonCleanupandonErrorprimitives in the same way asonMount, reducing potentially confusing and incorrect warnings.untrackis 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-namespacesnow warns on namespaced props on function components, because they have no effect. (this is uncommon)
Full Changelog: v0.4.7...v0.5.0
v0.4.7
What's Changed
- Allow reactivity inside of IIFEs when the enclosing scope allows reactivity. Now, the body of an IIFE will work just like
Array#forEachand other function calls that run function expressions immediately in the enclosing scope. Details: #17 - Allow use of reactive variables in getters in an object passed to
createStore, as is idiomatic usage. Since these getters will become part of the store, and property accesses on stores are reactive, it makes sense to make these getters tracked scopes. Details: #18
Thanks @otonashixav for opening these issues.
Full Changelog: v0.4.6...v0.4.7
v0.4.6
What's Changed
- Relax
solid/style-prop"CSS property values should be strings only, but ___ is a number" warnings to only apply on properties containingwidth,height,margin,padding,border-width, orfont-size. When the property values are given as numbers, React automatically appends a"px"unit, where Solid does not. Now leaves properties such asflex-growalone. Details: #15 - Bump minimist from 1.2.5 to 1.2.6 by @dependabot in #14
- Bump ansi-regex from 4.1.0 to 4.1.1 by @dependabot in #13
Full Changelog: v0.4.5...v0.4.6
v0.4.5
Quality-of-life improvements to solid/reactivity.
What's Changed
- Make
addEventHandlerlisteners consistent with other event handlers, suppressing some nuisance warnings. Details: #11 - Don't warn when using props prefixed with "initial", like
props.initialCount. Thanks @JoshuaHall for giving this example. Details: #12 - Better error messages.
- Fix typo in reactivity.md by @youssefm in #9
- Fix typo in README.md by @liaodehui1 in #10
New Contributors
- @youssefm made their first contribution in #9
- @liaodehui1 made their first contribution in #10
Full Changelog: v0.4.4...v0.4.5
v0.4.4
This release fixes two issues:
solid/reactivitynow keeps track of which reactive primitives are imported from Solid and acts on those. This means you canimport { createSignal as makeMeASignal }and the rule will still work correctly, and imports from other libraries with conflicting names will be ignored. #6solid/reactivitynow doesn't automatically warn when passing reactive variables to custom hooks. This decision puts a certain amount of trust in the programmer, as it is still a mistake to pass a reactive variable to a custom hook if the custom hook doesn't use it in a tracking scope. Rule of thumb: if you move the custom hook inline and it warns, there's a problem; if not, it's probably okay. #8
Full Changelog: v0.4.3...v0.4.4