eslint-visitor-keys
Advanced tools
Weekly downloads
Changelog
3.4.1 (2023-05-05)
v3.4.0 - March 27, 2023
e9a070f
fix: remove useless sourcemap url (fixes #43) (#44) (余腾靖)0398109
chore: add triage action (#42) (Milos Djermanovic)bcffbe5
ci: add Node v19 (#41) (Milos Djermanovic)c24f2e4
chore: update github actions and add funding field (#40) (Deepshika S)81c0732
build: add node v18 (#39) (唯然)6ece4bd
feat: add JSXSpreadChild
and tool to build keys out of AST definitions (#36) (Brett Zamir)4beb7a7
docs: update badges (#37) (Milos Djermanovic)v3.3.0 - February 11, 2022
7f10327
feat: Bundle JSDoc-built TypeScript declaration file (#34) (Brett Zamir)v3.2.0 - January 15, 2022
5c53218
feat: add missing JSXOpeningFragment and JSXClosingFragment (#33) (Richard Huang)2a5c9a6
docs: readme add syntax highlighting (#32) (coderaiser)v3.1.0 - November 8, 2021
5e3e687
build: upgrade eslint-release to v3.2.0 to support conventional commits (#31) (Milos Djermanovic)53d3939
Build: add node v17 (#30) (唯然)5f5b232
Update: add StaticBlock (#29) (Milos Djermanovic)e89bff9
Chore: use actions/setup-node@v2 (薛定谔的猫)7b756cd
Docs: Update the minimum Node.js version requirement (#26) (0uep)v3.0.0 - June 24, 2021
701b67d
Breaking: drop node v10/v13/v15 (refs eslint/eslint#14023) (#23) (薛定谔的猫)f584b12
Breaking: Switch to ESM (#24) (Brett Zamir)7279e73
Build: Update branch reference in CI (#25) (Milos Djermanovic)c6846d6
Upgrade: eslint-release (#21) (Nicholas C. Zakas)v2.1.0 - May 3, 2021
908fdf8
Update: add PrivateIdentifier and PropertyDefinition (#20) (Toru Nagashima)2d7be11
Chore: No longer test in Node.js 13 (#17) (Michaël De Boey)b41b509
Docs: Update required Node.js version (#15) (Michaël De Boey)v2.0.0 - August 14, 2020
fb86ca3
Breaking: drop support for Node <10 (#13) (Kai Cataldo)69383b3
Chore: move to GitHub Actions (#14) (Kai Cataldo)v1.3.0 - June 19, 2020
c92dd7f
Update: add ChainExpression
node (#12) (Toru Nagashima)v1.2.0 - June 4, 2020
21f28bf
Update: added exported in exportAllDeclaration key (#10) (Anix)v1.1.0 - August 13, 2019
9331cc0
Update: add ImportExpression (#8) (Toru Nagashima)5967f58
Chore: add supported Node.js versions to CI (#7) (Kai Cataldo)6f7c60f
Upgrade: eslint-release@1.0.0 (#5) (Teddy Katz)v1.0.0 - December 18, 2017
v0.1.0 - November 17, 2017
repository
field in package.json (#3) (Toru Nagashima)Readme
Constants and utilities about visitor keys to traverse AST.
Use npm to install.
$ npm install eslint-visitor-keys
^12.22.0
, ^14.17.0
, or >=16.0.0
To use in an ESM file:
import * as evk from "eslint-visitor-keys"
To use in a CommonJS file:
const evk = require("eslint-visitor-keys")
type:
{ [type: string]: string[] | undefined }
Visitor keys. This keys are frozen.
This is an object. Keys are the type of ESTree nodes. Their values are an array of property names which have child nodes.
For example:
console.log(evk.KEYS.AssignmentExpression) // → ["left", "right"]
type:
(node: object) => string[]
Get the visitor keys of a given AST node.
This is similar to Object.keys(node)
of ES Standard, but some keys are excluded: parent
, leadingComments
, trailingComments
, and names which start with _
.
This will be used to traverse unknown nodes.
For example:
const node = {
type: "AssignmentExpression",
left: { type: "Identifier", name: "foo" },
right: { type: "Literal", value: 0 }
}
console.log(evk.getKeys(node)) // → ["type", "left", "right"]
type:
(additionalKeys: object) => { [type: string]: string[] | undefined }
Make the union set with evk.KEYS
and the given keys.
additionalKeys
is at first, then evk.KEYS
is concatenated after that.For example:
console.log(evk.unionWith({
MethodDefinition: ["decorators"]
})) // → { ..., MethodDefinition: ["decorators", "key", "value"], ... }
See GitHub releases.
Welcome. See ESLint contribution guidelines.
npm test
runs tests and measures code coverage.npm run lint
checks source codes with ESLint.npm run coverage
opens the code coverage report of the previous test with your default browser.npm run release
publishes this package to npm registory.FAQs
Constants and utilities about visitor keys to traverse AST.
The npm package eslint-visitor-keys receives a total of 63,252,245 weekly downloads. As such, eslint-visitor-keys popularity was classified as popular.
We found that eslint-visitor-keys demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.