These examples of the eslint no-restricted-syntax
rule that demonstrate how you can use ESQuery to pin down structural code problems. While these examples are written for modern ESLint 8+ Flat Configuration, they are easily adapted to the older eslintrc format.
I hope to keep this updated as I develop more rules.
Some helpful tools for developing your own selectors for no-restricted-syntax:
- typescript-eslint playground (test selectors with TS/JS/TSX/JSX)
- AST Explorer inspect AST from practically any language and parser