diff --git a/package.json b/package.json index 1274cb9..e5e6733 100644 --- a/package.json +++ b/package.json @@ -49,9 +49,9 @@ }, "dependencies": { "@textlint/ast-node-types": "^13.0.5", + "neotraverse": "^0.6.15", "rehype-parse": "^8.0.4", "structured-source": "^4.0.0", - "traverse": "^0.6.7", "unified": "^10.1.2" }, "devDependencies": { @@ -62,7 +62,6 @@ "@types/glob": "^8.0.1", "@types/mocha": "^10.0.1", "@types/node": "^18.11.18", - "@types/traverse": "^0.6.32", "glob": "^8.1.0", "mocha": "^10.2.0", "textlint": "^13.0.5", diff --git a/src/html-to-ast.ts b/src/html-to-ast.ts index ca58642..f4076e1 100644 --- a/src/html-to-ast.ts +++ b/src/html-to-ast.ts @@ -25,7 +25,7 @@ import type { } from "@textlint/ast-node-types"; import { unified } from 'unified' import rehypeParse from 'rehype-parse' -import traverse, { TraverseContext } from "traverse"; +import traverse, { TraverseContext } from "neotraverse"; import { StructuredSource } from "structured-source"; import type { Element, RootContent } from "hast"; import { nodeTypes, tagNameToType } from "./mapping.js"; @@ -179,4 +179,3 @@ export function parse(html: string, options?: ParseOptions) { }); return ast as any as TxtParentNode; } - diff --git a/yarn.lock b/yarn.lock index 6bb836e..6c9f1db 100644 --- a/yarn.lock +++ b/yarn.lock @@ -261,11 +261,6 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.18.tgz#8dfb97f0da23c2293e554c5a50d61ef134d7697f" integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA== -"@types/traverse@^0.6.32": - version "0.6.32" - resolved "https://registry.yarnpkg.com/@types/traverse/-/traverse-0.6.32.tgz#f9fdfa40cd4898deaa975a14511aec731de8235e" - integrity sha512-RBz2uRZVCXuMg93WD//aTS5B120QlT4lR/gL+935QtGsKHLS6sCtZBaKfWjIfk7ZXv/r8mtGbwjVIee6/3XTow== - "@types/unist@*", "@types/unist@^2.0.0", "@types/unist@^2.0.2": version "2.0.6" resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.6.tgz#250a7b16c3b91f672a24552ec64678eeb1d3a08d" @@ -1240,6 +1235,11 @@ nanoid@3.3.3: resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.3.tgz#fd8e8b7aa761fe807dba2d1b98fb7241bb724a25" integrity sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w== +neotraverse@^0.6.15: + version "0.6.15" + resolved "https://registry.yarnpkg.com/neotraverse/-/neotraverse-0.6.15.tgz#dc4abb64700c52440f13bc53635b559862420360" + integrity sha512-HZpdkco+JeXq0G+WWpMJ4NsX3pqb5O7eR9uGz3FfoFt+LYzU8iRWp49nJtud6hsDoywM8tIrDo3gjgmOqJA8LA== + normalize-package-data@^2.3.2: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8"