Comments (4)
Seems relevant
Thank you for your answer.
Actually, it turns out you can directly test on ASTExplorer an ESLint rule!
If you click on "Transform" above then ESLint you'll see the code for your rule and you can put your ESQuery there.
So, problem solved and nothing needs to be done
Thank you!
from esquery.
I personally really like this idea. However, I think it might be better to get esquery filtering supported in ASTExplorer itself, as that already has robust options and display (I mentioned this in an offhand comment at fkling/astexplorer#483 already, but deserves its own issue I think).
from esquery.
Thanks for the tip @pierpo ! Although I couldn't copy out of the screenshot so easily
Here's a new snippet based off of the technique in the screenshot for anyone else who wants to copy + paste into AST explorer:
export default function (context) {
return {
"JSXElement[openingElement.name.name='p'] > JSXElement[openingElement.name.name=/^span$/]": (
node
) => {
context.report({
node,
message: "Found"
});
}
};
}
On AST explorer: https://astexplorer.net/#/gist/4699a2ceadc890386cbd0727734c3ca5/c9250ace00e2686b4d95879dff67341ce35d9018
from esquery.
I should note that if that is ESLint v 4, then it is a different and I believe forked version of esquery, even while it may remain mostly the same.
from esquery.
Related Issues (20)
- Request to update the dependence `estraverse` to latest
- Do not bundle estraverse dependency? HOT 1
- Support back-references with wildcards
- Crash on optional chaining HOT 3
- Feature Request: Add support for custom visitor keys. HOT 2
- Change match order to avoid inefficient comparisons HOT 1
- Question: How can I match a specific child of a parent? HOT 1
- Proposal: Support check types HOT 3
- `:has(selector)` matches nodes matched by `selector` HOT 1
- TypeError: esquery.parse is not a function
- Attribute value doesn't support empty array ([]) HOT 1
- Feature Request: Add `:is` as alias for `:matches`
- Building esquery using sample code
- Array selector HOT 7
- Python port
- :has(> child) is not supported HOT 4
- eslint crash when upgrading to 1.4.1 HOT 13
- how to use esquery with ts-morph? HOT 2
- Help with array null child selector HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esquery.