1.4.0 • Published 4 months ago

esquery v1.4.0

Weekly downloads
14,266,235
License
BSD-3-Clause
Repository
github
Last release
4 months ago

ESQuery is a library for querying the AST output by Esprima for patterns of syntax using a CSS style selector system. Check out the demo:

demo

The following selectors are supported:

  • AST node type: ForStatement
  • wildcard: *
  • attribute existence: [attr]
  • attribute value: [attr="foo"] or [attr=123]
  • attribute regex: [attr=/foo.*/] or (with flags) [attr=/foo.*/is]
  • attribute conditions: [attr!="foo"], [attr>2], [attr<3], [attr>=2], or [attr<=3]
  • nested attribute: [attr.level2="foo"]
  • field: FunctionDeclaration > Identifier.id
  • First or last child: :first-child or :last-child
  • nth-child (no ax+b support): :nth-child(2)
  • nth-last-child (no ax+b support): :nth-last-child(1)
  • descendant: ancestor descendant
  • child: parent > child
  • following sibling: node ~ sibling
  • adjacent sibling: node + adjacent
  • negation: :not(ForStatement)
  • has: :has(ForStatement)
  • matches-any: :matches([attr] > :first-child, :last-child)
  • subject indicator: !IfStatement > [name="foo"]
  • class of AST node: :statement, :expression, :declaration, :function, or :pattern

Build Status

eslintvue-eslint-parserreact-native-bluetooth2killi8n-react-native-fast-imagepipihome@icanpm/api-mastereslint-4-fix@arisageha/react-lazyload@arisageha/react-lazyload-fix@oneplanetcrowd/developers@almeidaa/mssimple-axiosreact-native-template-rfbaseairscanairscan-examplebb-chatreact-native-esc-pos-sahaab@borisovart/atol-kkt-moduledeneme323112react-native-dsphoto-modulekolibri-toolslintspelljsminty@amraneze/react-instagram-loginnative-google-loginnative-apple-loginnative-kakao-login@apardellass/react-native-audio-stream@architect/hydratenuxtjs-argonp5-global2instance@seculum/vue-dev-clone@scion-scxml/eslint@hawkingnetwork/react-native-tab-view@sung/subsequence@jretts/modified-sveltejs@jarrodldavis/eslint-plugin-tailwindcsstestnpm_lmn@fangdh/typescript-esbuild-2021@es-joy/jsdoc-eslint-parser@es-joy/jsdoccomment@f-list/vue-eslint-parser@oriduk/ckeditor5-rebuild-musicanote@oriduk/ckeditor5-rebuild-oriduk@openpolitica/matomo-nextstnenopmoc-iu@respondea/cordova-plugin-v-inappbrowser@sailshq/eslintsvavatar@geeky-apo/react-native-advanced-clipboard@garage11/vue-eslint-parsertechfox-icontechfox-react-feather@ibrahimcesar/middy-idempotentmpx-es-checkmpx-eslint-parsermpxml-eslint-parsern-build-dev@arielapaula/components@arielapaula/testnmvnode-module-compile-transform-asttractor-plugin-page-objectstractor-plugin-step-definitionstractor-file-javascripttractor-js-file-transformertractor-plugin-cucumber-step-definitions@bebopskull/lotide@rhpass/vuemaker@hemith/react-native-tnktailwind-vector-effect@eliteswap/token-lists@phenomnomnominal/tsquery@phenomnomnominal/debugsolregex2@ericmcornelius/ease@torswap/tor-token-lists@buxlabs/testgen@buxlabs/amd-inline@buxlabs/ast@tractor/file-javascript@tractor-plugins/page-objects@tractor-plugins/step-definitions@tractor-plugins/mocha-specs@astro-my/sign-request@b-mo/injectorreact-native-template-nascam-templatereact-native-template-vifereact-native-test-module-hhhplaykit-js-hls-sondqrookie-core@mattduffield/eslint4b@maujzs/branch-releaserubahhelperrollup-plugin-auto-named-exports@mblode/react-native-feathersan-eslint-parserreact-native-contact-listreact-native-plugpag-wrapperreact-native-pulsator-native
1.4.0

4 months ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.1

3 years ago

1.0.0

4 years ago

0.4.0

6 years ago

0.3.0

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago

0.0.1

8 years ago