estree-util-attach-comments:将评论附加到 estree 节点

时间:2021-08-04 13:41:01
【文件属性】:
文件名称:estree-util-attach-comments:将评论附加到 estree 节点
文件大小:9KB
文件格式:ZIP
更新时间:2021-08-04 13:41:01
javascript ecmascript ast estree JavaScript estree-util-attach-comments 将半标准的注释节点(例如来自带有几行代码的附加到该树中的节点。 这很有用,因为某些 estree 解析器为您提供一个数组(espree 和 acorn),而其他 estree 工具希望将注释嵌入到树中的节点上。 这个包使用一个comments数组,其中每个评论都有leading和trailing字段。 请注意,espree 使用略有不同的非标准注释。 安装 此包仅适用于 ESM:需要 Node 12+ 才能使用它,并且必须使用import ed 而不是require d。 : npm install estree-util-attach-comments 采用 假设我们有这个奇怪的code : /* 1 */ function /* 2 */ a /* 3 */ ( /* 4 */ b ) /* 5 */ { /* 6
【文件预览】:
estree-util-attach-comments-main
----index.js(3KB)
----test.js(5KB)
----package.json(2KB)
----readme.md(4KB)
----.github()
--------workflows()
----.prettierignore(15B)
----license(1KB)
----tsconfig.json(369B)
----.gitignore(57B)
----.npmrc(19B)
----.editorconfig(147B)

网友评论