solidjs-community / eslint-plugin-solid

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

inline methods of jsx-ast-utils to simplify dependency tree #114

Closed ulrichstark closed 6 months ago

ulrichstark commented 6 months ago

This is my attempt to simplify the dependency tree when using eslint-plugin-solid. eslint-plugin-solid uses three methods from jsx-ast-utils: propName, getProp and hasProp. The dependency tree of jsx-ast-utils is bloated as you can see in the changes in pnpm-lock.yaml, because it depends on all kinds of other packages to be backwards compatible with Node 4 and has no plan to change this (https://github.com/jsx-eslint/jsx-ast-utils/pull/114). Removing jsx-ast-utils as dependency by inlining used methods would save users from installing up to 50 packages.

All tests are green and I'm open for discussion/further work on this change.

Fixes #115

joshwilsonvu commented 6 months ago

This is fantastic! I appreciate the help with node_modules bloat, wouldn't have thought this package's deps would be so heavy.

The only thing I'm concerned about is losing jsx-ast-utils's checks for props on object literals spread in, like <div {...{ foo: 'bar' }} >. But looking at their implementation, it doesn't look too hard to add. I'm going to push that change to your branch, and then this should be good to go!

ulrichstark commented 6 months ago

Awesome! I'm glad I could help. Thanks for your work and happy New Year 🎉