diff --git a/package.json b/package.json index da63cc86..a4c926f9 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ ], "devDependencies": { "@types/node": "^20.0.0", - "c8": "^8.0.0", + "c8": "^9.0.0", "hast-util-assert": "^4.0.0", "prettier": "^3.0.0", "remark-cli": "^11.0.0", @@ -28,7 +28,7 @@ "unified": "^11.0.0", "unist-util-remove-position": "^5.0.0", "vfile": "^6.0.0", - "xo": "^0.56.0" + "xo": "^0.57.0" }, "scripts": { "build": "tsc --build --clean && tsc --build && type-coverage", diff --git a/packages/rehype-cli/cli.js b/packages/rehype-cli/cli.js index ba10b6e9..3389866c 100755 --- a/packages/rehype-cli/cli.js +++ b/packages/rehype-cli/cli.js @@ -17,7 +17,7 @@ import {rehype} from 'rehype' import {args} from 'unified-args' /** @type {Pack} */ -const proc = JSON.parse( +const rehypePackage = JSON.parse( String( await fs.readFile( new URL('package.json', resolve('rehype', import.meta.url)) @@ -26,21 +26,21 @@ const proc = JSON.parse( ) /** @type {Pack} */ -const cli = JSON.parse( +const cliPackage = JSON.parse( String(await fs.readFile(new URL('package.json', import.meta.url))) ) args({ - description: cli.description, + description: cliPackage.description, extensions: ['html', 'htm', 'xht', 'xhtml'], - ignoreName: '.' + proc.name + 'ignore', - name: proc.name, - packageField: proc.name, - pluginPrefix: proc.name, + ignoreName: '.' + rehypePackage.name + 'ignore', + name: rehypePackage.name, + packageField: rehypePackage.name, + pluginPrefix: rehypePackage.name, processor: rehype, - rcName: '.' + proc.name + 'rc', + rcName: '.' + rehypePackage.name + 'rc', version: [ - proc.name + ': ' + proc.version, - cli.name + ': ' + cli.version + rehypePackage.name + ': ' + rehypePackage.version, + cliPackage.name + ': ' + cliPackage.version ].join(', ') }) diff --git a/packages/rehype-cli/package.json b/packages/rehype-cli/package.json index 2473e7a4..ba4a4d5f 100644 --- a/packages/rehype-cli/package.json +++ b/packages/rehype-cli/package.json @@ -29,12 +29,11 @@ "cli.js" ], "dependencies": { - "import-meta-resolve": "^3.0.0", + "import-meta-resolve": "^4.0.0", "rehype": "^13.0.0", "unified-args": "^11.0.0" }, "scripts": {}, - "xo": false, "typeCoverage": { "atLeast": 100, "detail": true, diff --git a/packages/rehype-parse/lib/index.js b/packages/rehype-parse/lib/index.js index 926b4b50..9e651a82 100644 --- a/packages/rehype-parse/lib/index.js +++ b/packages/rehype-parse/lib/index.js @@ -45,8 +45,8 @@ export default function rehypeParse(options) { /** * @type {Parser} */ - function parser(doc, file) { - return fromHtml(doc, { + function parser(document, file) { + return fromHtml(document, { ...settings, onerror: emitParseErrors ? function (message) { diff --git a/packages/rehype-parse/package.json b/packages/rehype-parse/package.json index f25f32c8..e5bb7521 100644 --- a/packages/rehype-parse/package.json +++ b/packages/rehype-parse/package.json @@ -40,7 +40,6 @@ "unified": "^11.0.0" }, "scripts": {}, - "xo": false, "typeCoverage": { "atLeast": 100, "detail": true, diff --git a/packages/rehype-stringify/package.json b/packages/rehype-stringify/package.json index c64b4042..e49e3bc9 100644 --- a/packages/rehype-stringify/package.json +++ b/packages/rehype-stringify/package.json @@ -42,7 +42,6 @@ "unified": "^11.0.0" }, "scripts": {}, - "xo": false, "typeCoverage": { "atLeast": 100, "detail": true, diff --git a/packages/rehype/package.json b/packages/rehype/package.json index 6f579127..fb340e76 100644 --- a/packages/rehype/package.json +++ b/packages/rehype/package.json @@ -41,7 +41,6 @@ "index.js" ], "scripts": {}, - "xo": false, "typeCoverage": { "atLeast": 100, "detail": true, diff --git a/test/cli.js b/test/cli.js index 07c15f3d..23658d9f 100644 --- a/test/cli.js +++ b/test/cli.js @@ -7,12 +7,12 @@ import {fileURLToPath} from 'node:url' const exec = promisify(childProcess.exec) test('rehype-cli', async function (t) { - const bin = fileURLToPath( + const binary = fileURLToPath( new URL('../packages/rehype-cli/cli.js', import.meta.url) ) await t.test('should show help on `--help`', async function () { - const result = await exec(bin + ' --help') + const result = await exec(binary + ' --help') assert.equal( result.stdout, @@ -66,7 +66,7 @@ test('rehype-cli', async function (t) { }) await t.test('should show version on `--version`', async function () { - const result = await exec(bin + ' --version') + const result = await exec(binary + ' --version') assert.match(result.stdout, /rehype: \d+\.\d+\.\d+/) assert.match(result.stdout, /rehype-cli: \d+\.\d+\.\d+/)