详细说明: - 添加了V2版本的工作流页面和结果页面 - 更新了Serena记忆文件 - 添加了详细实施计划文档 - 优化了Vite配置 - 更新了项目文档CLAUDE.md - 构建了演示系统的dist版本 - 包含了exhibition-demo的完整依赖
eslint-visitor-keys
Constants and utilities about visitor keys to traverse AST.
💿 Installation
Use npm to install.
$ npm install eslint-visitor-keys
Requirements
- Node.js
^12.22.0,^14.17.0, or>=16.0.0
📖 Usage
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")
evk.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"]
evk.getKeys(node)
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"]
evk.unionWith(additionalKeys)
type:
(additionalKeys: object) => { [type: string]: string[] | undefined }
Make the union set with evk.KEYS and the given keys.
- The order of keys is,
additionalKeysis at first, thenevk.KEYSis concatenated after that. - It removes duplicated keys as keeping the first one.
For example:
console.log(evk.unionWith({
MethodDefinition: ["decorators"]
})) // → { ..., MethodDefinition: ["decorators", "key", "value"], ... }
📰 Change log
See GitHub releases.
🍻 Contributing
Welcome. See ESLint contribution guidelines.
Development commands
npm testruns tests and measures code coverage.npm run lintchecks source codes with ESLint.npm run test:open-coverageopens the code coverage report of the previous test with your default browser.