Skip to content

Releases: solidjs-community/eslint-plugin-solid

v0.7.2

12 Sep 02:56
Compare
Choose a tag to compare

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

10 Jul 19:45
Compare
Choose a tag to compare

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 in solid/recommended.
  • solid/reactivity will 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

14 Jun 02:12
Compare
Choose a tag to compare

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

02 Jun 23:51
Compare
Choose a tag to compare

Changes

  • Fixes solid/components-return-once to warn when returning a conditional expression with an && operator, ex. return props.cond && <p>Text</p>;.
  • Fixes solid/event-handlers to correct the case of common event handlers, even when the event name ("click" in onClick) begins with an uppercase letter. Resolves #26.

Full Changelog: v0.6.0...v0.6.1

v0.6.0

01 Jun 01:19
Compare
Choose a tag to compare

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

22 May 23:53
Compare
Choose a tag to compare

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 like Array#forEach when analyzing scopes that's now fixed.
  • solid/reactivity now treats Solid's onCleanup and onError primitives in the same way as onMount, 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

v0.4.7

14 Apr 02:23
Compare
Choose a tag to compare

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#forEach and 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

01 Apr 00:02
Compare
Choose a tag to compare

What's Changed

  • Relax solid/style-prop "CSS property values should be strings only, but ___ is a number" warnings to only apply on properties containing width, height, margin, padding, border-width, or font-size. When the property values are given as numbers, React automatically appends a "px" unit, where Solid does not. Now leaves properties such as flex-grow alone. 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

25 Mar 23:48
Compare
Choose a tag to compare

Quality-of-life improvements to solid/reactivity.

What's Changed

  • Make addEventHandler listeners 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

Full Changelog: v0.4.4...v0.4.5

v0.4.4

01 Feb 04:37
Compare
Choose a tag to compare

This release fixes two issues:

  1. solid/reactivity now keeps track of which reactive primitives are imported from Solid and acts on those. This means you can import { createSignal as makeMeASignal } and the rule will still work correctly, and imports from other libraries with conflicting names will be ignored. #6
  2. solid/reactivity now 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