Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Dec 30, 2023
Merged

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

merged 2 commits into from
Dec 30, 2023

Conversation

ulrichstark
Copy link
Contributor

@ulrichstark ulrichstark commented Dec 26, 2023

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 (jsx-eslint/jsx-ast-utils#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
Copy link
Collaborator

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
Copy link
Contributor Author

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

@joshwilsonvu joshwilsonvu merged commit 1e8dcf0 into solidjs-community:main Dec 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dependency tree is bloated because of jsx-ast-utils
2 participants