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
[feature] simplify transformation and introduce selector
#902
Comments
This would be great and just what I've been looking for. I use selectors in eslint rules which uses esquery css style selectors. There's also grasp which uses esquery and css style selectors to search ast and replace JS. But grasp isn't maintained and doesn't support modern JS. Also saw this the other day https://github.com/confused-Techie/selector-tree-sitter . Would the plan be to support searching with css style selectors? |
@mrloop I didn't support selector at first because they tend to produce long, unreadable selector text. I need more feedback from users. Please leave your insights here (if you can share the post). Or give the issue a thumb-up! |
FYI I recently found this other tool Grit where they also have their own DSL which I think is quite interesting as well |
Thanks for mentioning @junyi Compared to a full fledged DSL I would prefer something easier to learn. That said, I still see users don't know how to write YAML. The learning curve is a critical decision for a new project. |
⭐ Suggestion
Currently transformation and relational rules are pretty verbose.
For example:
transformation
and
We can refer to CSS syntax to simplify them.
💻 Use Cases
For relational rule, we can simplify using CSS selector syntax. https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_selectors
For transformation, we can refer to CSS function https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Functions
The text was updated successfully, but these errors were encountered: