esquery
esquery copied to clipboard
No way to compare fields?
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 a minimal example and doesn't seem to make sense but believe me my full case does make sense 😅)
How would you do something like this with a CSS selector?
CSS selectors can't do it but ESTree is not CSS. Esquery just uses a syntax inspired by css selectors. Entire esquery parsing logic is written in here so there isn't any external dependency or requirement that makes it impossible.
RegExp as possible value for attribute selector also does not exist in CSS, yet it's a valid syntax here.