esquery
esquery copied to clipboard
ECMAScript AST query library.
Based on #133, rebased and updated to handle @michaelficarra’s PR feedback Fixes #132
Add more tests for https://github.com/estools/esquery/pull/145 that show these selectors do not work correctly - `:has(>BlockStatement>ExpressionStatement)` - `:has(>BlockStatement ExpressionStatement)` but there are workarounds: - `:has(>BlockStatement:has(>ExpressionStatement))` - `:has(>BlockStatement:has(ExpressionStatement))`
Re-implements https://github.com/estools/esquery/pull/145 to fix https://github.com/estools/esquery/pull/146 `:has(>BlockStatement>ExpressionStatement)` but this approach isn't extendable to support `:has(~` and I don't know if it has unintended consequences if `>` is used outside `:has(>`
the jsdoc comments have ```ts @param {?external:AST} node ``` around. what does this mean? Where can I find the AST type? I am trying to write a `.ts` version of...
Fixes #68 in support of https://github.com/eslint/eslint/issues/16555. This solution is a kind of hacky workaround based on #68's comments. It "encodes" all backslash-escaped forward slashes (`'\\' + '/'`) with a backslash...
Either I don't know how to do it or it's not possible to do sth like this: ``` CallExpression[arguments.0.value!=arguments.1.value] ``` to catch cases like ``` foo('a', 'b'); ``` (this is...
Given the following minimal example program, ```js import js from "@eslint/js"; ``` the ESQuery expression `Program > ImportDeclaration > Literal` [matches the `Literal` node as expected][selector-1], ```js { type: 'Literal',...