1.5.0 • Published 1 year ago

esquery v1.5.0

Weekly downloads
14,266,235
License
BSD-3-Clause
Repository
github
Last release
1 year 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-parser@huyhpham/rn-lineeasy-select-rnreact-native-bluetooth2killi8n-react-native-fast-imagepipihome@icanpm/api-mastereslint-4-fix@arisageha/react-lazyload@arisageha/react-lazyload-fix@oneplanetcrowd/developers@almeidaa/msreact-native-template-rfbaseairscanairscan-examplebb-chatreact-native-esc-pos-sahaab@borisovart/atol-kkt-moduledeneme323112@ntt_app/react-native-custom-notificationagreestudioeslintreact-native-covid-sdkgql_din_modmutasi-bca@jttechnic/interpreter@saeon/quick-formcthpb-plugin-social@iobroker-community-adapters/iobroker.device-watchermysql-formatreact-native-printer-brothers@belko.tech/belko-multi-wallet-sdk@newhorizon-tech/dd-npm-package-templatereact-native-shekhar-bridge-testcogoportutilsukor-remasteruncoded-connect@reversodev/oceanic-fleetwilscanner@khalitovadel/abstract-repository@oiti/documentoscopy-react-native@respondea/cordova-plugin-v-inappbrowserquoc-testreact-native-slider-kfplginexpand-react-bridgeopea-bootstraapluminos-ui-coresklif-ui-kitsklif-apits-handy@everything-registry/sub-chunk-1616jawwy-sdkjawwy_gamification_release@deepakorg/test@deepak757/testreact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgp149-tablesklif-uimachinebeemrcapsreact-native-jawwy_sampleswiftallyelvy@geeky-apo/react-native-advanced-clipboardkrondoleletherego932letsgoobraderlib-errorlintspelljshermes-transformhexyun.helpershooks-dep-tracehot-zone-vuehoteakarvickytea93klosokdu-eslint-parserkhaled-salem-custom-componentskintilidin15kolibri-toolsgogency-test-2gogencygoogle-remakelaoitdev-core-pluginslembah1leonardsinggihtea46ip_address_infoidlxihza32jamuskalimjonbitco12joalvonsoanonsjohncarlonice21jp-gedenjordy-frijters-test-libminatonamikaze63
1.4.2

1 year ago

1.5.0

1 year ago

1.4.1

1 year ago

1.4.0

3 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.1

6 years ago

1.0.0

7 years ago

0.4.0

9 years ago

0.3.0

10 years ago

0.2.0

11 years ago

0.1.0

11 years ago

0.0.1

11 years ago