solidjs-community / eslint-plugin-solid

Solid-specific linting rules for ESLint.
MIT License
209 stars 24 forks source link

Fixes regression where functions could not be passed inline to component event handlers #94

Closed joshwilsonvu closed 1 year ago

joshwilsonvu commented 1 year ago

Code like <Comp onClick={() => props.onClick}> was failing, because of the extra specificity that anonymous functions receive when matching against tracked scopes. This PR simply removes the special treatment and uses the normal tracked scope matching function, which allows tracked scopes marked as expressions.

Component event handlers are now marked as expressions, like other props, because they do rebind. They were previously mistakenly marked as accepting functions only, like native element event handlers.