From fafc4056fcd0586815c54b76803409edeb5e9d65 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Wed, 30 Oct 2024 15:23:31 -0700 Subject: [PATCH 1/3] chore!: convert to ESM BREAKING CHANGE: This package is now ESM-only and requires Node.js >= 20.16.0 || >= 22.4.0 --- .github/workflows/test.yml | 5 +- bin/lint-markdown-api-history.ts | 138 ++++---- bin/lint-markdown-links.ts | 64 ++-- bin/lint-markdown-standard.ts | 67 ++-- bin/lint-markdown-ts-check.ts | 69 ++-- lib/markdown.ts | 31 +- package.json | 23 +- tests/helpers.spec.ts | 2 +- .../lint-roller-markdown-api-history.spec.ts | 3 +- tsconfig.json | 6 +- yarn.lock | 314 ++++++++++-------- 11 files changed, 393 insertions(+), 329 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a8dc1c1..b51eee6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,9 +20,8 @@ jobs: strategy: matrix: node-version: - - '22.1' - - '20.10' - - '18.18' + - '22.4' + - '20.16' os: - macos-latest - ubuntu-latest diff --git a/bin/lint-markdown-api-history.ts b/bin/lint-markdown-api-history.ts index 80656bd..179a27d 100644 --- a/bin/lint-markdown-api-history.ts +++ b/bin/lint-markdown-api-history.ts @@ -2,19 +2,20 @@ import { access, constants, readFile } from 'node:fs/promises'; import { resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { parseArgs } from 'node:util'; import Ajv, { ValidateFunction } from 'ajv'; -import type { fromHtml as FromHtmlFunction } from 'hast-util-from-html'; -import type { HTML, Heading } from 'mdast'; -import type { fromMarkdown as FromMarkdownFunction } from 'mdast-util-from-markdown'; -import * as minimist from 'minimist'; -import type { Literal, Node } from 'unist'; -import type { visit as VisitFunction } from 'unist-util-visit'; +import { fromHtml } from 'hast-util-from-html'; +import { fromMarkdown } from 'mdast-util-from-markdown'; +import { visit } from 'unist-util-visit'; import { URI } from 'vscode-uri'; import { parseDocument, visit as yamlVisit } from 'yaml'; -import { dynamicImport } from '../lib/helpers'; -import { DocsWorkspace } from '../lib/markdown'; +import type { HTML, Heading } from 'mdast'; +import type { Literal, Node } from 'unist'; + +import { DocsWorkspace } from '../lib/markdown.js'; // ": " const possibleStringRegex = /^[ \S]+?: *?(\S[ \S]+?)$/gm; @@ -35,19 +36,19 @@ interface ApiHistory { interface Options { // Check if the API history block is preceded by a heading - checkPlacement: boolean; + checkPlacement?: boolean; // Check if the 'breaking-changes-header' heading id's in the API history block exist in the breaking changes file at this filepath - breakingChangesFile: string; + breakingChangesFile?: string; // Check if the API history block contains strings that might cause issues when parsing the YAML - checkStrings: boolean; + checkStrings?: boolean; // Check if the API history block contains descriptions that aren't surrounded by double quotation marks - checkDescriptions: boolean; + checkDescriptions?: boolean; // Check if the API history block contains comments - disallowComments: boolean; + disallowComments?: boolean; // Array of glob patterns to ignore when processing files - ignoreGlobs: string[]; + ignoreGlobs?: string[]; // Check if the API history block's YAML adheres to the JSON schema at this filepath - schema: string; + schema?: string; // TODO: Implement this when GH_TOKEN isn't needed to fetch PR release versions anymore // checkPullRequestLinks: boolean; @@ -65,12 +66,6 @@ function isHTML(node: Node): node is HTML { export async function findPossibleApiHistoryBlocks( content: string, ): Promise { - const { fromMarkdown } = (await dynamicImport('mdast-util-from-markdown')) as { - fromMarkdown: typeof FromMarkdownFunction; - }; - const { visit } = (await dynamicImport('unist-util-visit')) as { - visit: typeof VisitFunction; - }; const tree = fromMarkdown(content); const codeBlocks: PossibleHistoryBlock[] = []; @@ -119,13 +114,6 @@ async function main( let warningCounter = 0; try { - const { fromHtml } = (await dynamicImport('hast-util-from-html')) as { - fromHtml: typeof FromHtmlFunction; - }; - const { fromMarkdown } = (await dynamicImport('mdast-util-from-markdown')) as { - fromMarkdown: typeof FromMarkdownFunction; - }; - const workspace = new DocsWorkspace(workspaceRoot, globs, ignoreGlobs); let validateAgainstSchema: ValidateFunction | null = null; @@ -407,47 +395,71 @@ async function main( } function parseCommandLine() { - const showUsage = (arg?: string): boolean => { - if (!arg || arg.startsWith('-')) { - console.log( - 'Usage: lint-roller-markdown-api-history [--root ] ' + - ' [-h|--help]' + - ' [--check-placement] [--breaking-changes-file ] [--check-strings] [--check-descriptions] [--disallow-comments]' + - ' [--schema ]' + - ' [--ignore ] [--ignore-path ]', - ); - process.exit(1); - } - - return true; + const showUsage = (): never => { + console.log( + 'Usage: lint-roller-markdown-api-history [--root ] ' + + ' [-h|--help]' + + ' [--check-placement] [--breaking-changes-file ] [--check-strings] [--check-descriptions] [--disallow-comments]' + + ' [--schema ]' + + ' [--ignore ] [--ignore-path ]', + ); + process.exit(1); }; - const opts = minimist(process.argv.slice(2), { - boolean: [ - 'help', - 'check-placement', - 'check-strings', - 'check-descriptions', - 'disallow-comments', - ], - string: ['root', 'ignore', 'ignore-path', 'schema', 'breaking-changes-file'], - unknown: showUsage, - default: { - 'check-placement': true, - 'check-strings': true, - 'check-descriptions': true, - 'disallow-comments': true, - }, - }); + try { + const opts = parseArgs({ + allowNegative: true, + allowPositionals: true, + options: { + 'check-placement': { + type: 'boolean', + default: true, + }, + 'check-strings': { + type: 'boolean', + default: true, + }, + 'check-descriptions': { + type: 'boolean', + default: true, + }, + 'disallow-comments': { + type: 'boolean', + default: true, + }, + root: { + type: 'string', + }, + ignore: { + type: 'string', + multiple: true, + }, + 'ignore-path': { + type: 'string', + }, + schema: { + type: 'string', + }, + 'breaking-changes-file': { + type: 'string', + }, + help: { + type: 'boolean', + }, + }, + }); - if (opts.help || !opts._.length) showUsage(); + if (opts.values.help || !opts.positionals.length) return showUsage(); - return opts; + return opts; + } catch { + return showUsage(); + } } async function init() { try { - const opts = parseCommandLine(); + const { values: opts, positionals } = parseCommandLine(); if (!opts.root) { opts.root = '.'; @@ -477,7 +489,7 @@ async function init() { const { historyBlockCounter, documentCounter, errorCounter, warningCounter } = await main( resolve(process.cwd(), opts.root), - opts._, + positionals, { checkPlacement: opts['check-placement'], breakingChangesFile: opts['breaking-changes-file'], @@ -500,7 +512,7 @@ async function init() { } } -if (require.main === module) { +if (process.argv[1] === fileURLToPath(import.meta.url)) { init().catch((error) => { console.error(error); process.exit(1); diff --git a/bin/lint-markdown-links.ts b/bin/lint-markdown-links.ts index 444577f..b804357 100644 --- a/bin/lint-markdown-links.ts +++ b/bin/lint-markdown-links.ts @@ -2,6 +2,8 @@ import * as fs from 'node:fs'; import * as path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { parseArgs } from 'node:util'; import { createLanguageService, @@ -10,11 +12,10 @@ import { ILogger, LogLevel, } from '@dsanders11/vscode-markdown-languageservice'; -import * as minimist from 'minimist'; import { CancellationTokenSource } from 'vscode-languageserver'; import { URI } from 'vscode-uri'; -import { DocsWorkspace, MarkdownLinkComputer, MarkdownParser } from '../lib/markdown'; +import { DocsWorkspace, MarkdownLinkComputer, MarkdownParser } from '../lib/markdown.js'; class NoOpLogger implements ILogger { readonly level = LogLevel.Off; @@ -144,31 +145,50 @@ async function main( } function parseCommandLine() { - const showUsage = (arg?: string): boolean => { - if (!arg || arg.startsWith('-')) { - console.log( - 'Usage: lint-roller-markdown-links [--root ] [-h|--help] [--fetch-external-links] ' + - '[--check-redirects] [--ignore ]', - ); - process.exit(1); - } - - return true; + const showUsage = (): never => { + console.log( + 'Usage: lint-roller-markdown-links [--root ] [-h|--help] [--fetch-external-links] ' + + '[--check-redirects] [--ignore ]', + ); + process.exit(1); }; - const opts = minimist(process.argv.slice(2), { - boolean: ['help', 'fetch-external-links', 'check-redirects'], - string: ['root', 'ignore', 'ignore-path'], - unknown: showUsage, - }); + try { + const opts = parseArgs({ + allowPositionals: true, + options: { + 'fetch-external-links': { + type: 'boolean', + }, + 'check-redirects': { + type: 'boolean', + }, + root: { + type: 'string', + }, + ignore: { + type: 'string', + multiple: true, + }, + 'ignore-path': { + type: 'string', + }, + help: { + type: 'boolean', + }, + }, + }); - if (opts.help || !opts._.length) showUsage(); + if (opts.values.help || !opts.positionals.length) return showUsage(); - return opts; + return opts; + } catch { + return showUsage(); + } } -if (require.main === module) { - const opts = parseCommandLine(); +if (process.argv[1] === fileURLToPath(import.meta.url)) { + const { values: opts, positionals } = parseCommandLine(); if (!opts.root) { opts.root = '.'; @@ -188,7 +208,7 @@ if (require.main === module) { } } - main(path.resolve(process.cwd(), opts.root), opts._, { + main(path.resolve(process.cwd(), opts.root), positionals, { fetchExternalLinks: opts['fetch-external-links'], checkRedirects: opts['check-redirects'], ignoreGlobs: opts.ignore, diff --git a/bin/lint-markdown-standard.ts b/bin/lint-markdown-standard.ts index b064bff..edfa33b 100644 --- a/bin/lint-markdown-standard.ts +++ b/bin/lint-markdown-standard.ts @@ -2,8 +2,8 @@ import * as fs from 'node:fs'; import * as path from 'node:path'; - -import * as minimist from 'minimist'; +import { fileURLToPath } from 'node:url'; +import { parseArgs } from 'node:util'; import { TextDocument, TextEdit, Range } from 'vscode-languageserver-textdocument'; import { URI } from 'vscode-uri'; @@ -12,8 +12,8 @@ import { dynamicImport, removeParensWrappingOrphanedObject, wrapOrphanObjectInParens, -} from '../lib/helpers'; -import { getCodeBlocks, DocsWorkspace } from '../lib/markdown'; +} from '../lib/helpers.js'; +import { getCodeBlocks, DocsWorkspace } from '../lib/markdown.js'; interface Options { fix?: boolean; @@ -167,31 +167,50 @@ async function main( } function parseCommandLine() { - const showUsage = (arg?: string): boolean => { - if (!arg || arg.startsWith('-')) { - console.log( - 'Usage: lint-roller-markdown-standard [--root ] [-h|--help] [--fix]' + - '[--ignore ] [--ignore-path ] [--semi]', - ); - process.exit(1); - } - - return true; + const showUsage = (): never => { + console.log( + 'Usage: lint-roller-markdown-standard [--root ] [-h|--help] [--fix]' + + '[--ignore ] [--ignore-path ] [--semi]', + ); + process.exit(1); }; - const opts = minimist(process.argv.slice(2), { - boolean: ['help', 'fix', 'semi'], - string: ['root', 'ignore', 'ignore-path'], - unknown: showUsage, - }); + try { + const opts = parseArgs({ + allowPositionals: true, + options: { + fix: { + type: 'boolean', + }, + semi: { + type: 'boolean', + }, + root: { + type: 'string', + }, + ignore: { + type: 'string', + multiple: true, + }, + 'ignore-path': { + type: 'string', + }, + help: { + type: 'boolean', + }, + }, + }); - if (opts.help || !opts._.length) showUsage(); + if (opts.values.help || !opts.positionals.length) return showUsage(); - return opts; + return opts; + } catch { + return showUsage(); + } } -if (require.main === module) { - const opts = parseCommandLine(); +if (process.argv[1] === fileURLToPath(import.meta.url)) { + const { values: opts, positionals } = parseCommandLine(); if (!opts.root) { opts.root = '.'; @@ -211,7 +230,7 @@ if (require.main === module) { } } - main(path.resolve(process.cwd(), opts.root), opts._, { + main(path.resolve(process.cwd(), opts.root), positionals, { fix: opts.fix, ignoreGlobs: opts.ignore, semi: opts.semi, diff --git a/bin/lint-markdown-ts-check.ts b/bin/lint-markdown-ts-check.ts index cf00af5..26cc736 100644 --- a/bin/lint-markdown-ts-check.ts +++ b/bin/lint-markdown-ts-check.ts @@ -4,9 +4,9 @@ import * as crypto from 'node:crypto'; import * as fs from 'node:fs'; import * as os from 'node:os'; import * as path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { parseArgs } from 'node:util'; -import * as minimist from 'minimist'; -import { rimraf } from 'rimraf'; import { URI } from 'vscode-uri'; import { @@ -16,8 +16,8 @@ import { spawnAsync, wrapOrphanObjectInParens, LintRollerConfig, -} from '../lib/helpers'; -import { getCodeBlocks, DocsWorkspace } from '../lib/markdown'; +} from '../lib/helpers.js'; +import { getCodeBlocks, DocsWorkspace } from '../lib/markdown.js'; interface Options { config?: LintRollerConfig; @@ -30,7 +30,8 @@ async function typeCheckFiles( filenames: string[], typings: string[], ) { - const tscExec = path.join(require.resolve('typescript'), '..', '..', 'bin', 'tsc'); + const pkgPath = fileURLToPath(import.meta.resolve('typescript')); + const tscExec = path.join(pkgPath, '..', '..', 'bin', 'tsc'); const options = ['--noEmit', '--pretty', '--moduleDetection', 'force']; if (filenames.find((filename) => filename.endsWith('.js'))) { options.push('--checkJs'); @@ -274,36 +275,52 @@ async function main( return errors; } finally { - await rimraf(tempDir); + await fs.promises.rm(tempDir, { force: true, recursive: true }); } } function parseCommandLine() { - const showUsage = (arg?: string): boolean => { - if (!arg || arg.startsWith('-')) { - console.log( - 'Usage: lint-roller-markdown-ts-check [--root ] [-h|--help]' + - '[--ignore ] [--ignore-path ] [--config ]', - ); - process.exit(1); - } - - return true; + const showUsage = (): never => { + console.log( + 'Usage: lint-roller-markdown-ts-check [--root ] [-h|--help]' + + '[--ignore ] [--ignore-path ] [--config ]', + ); + process.exit(1); }; - const opts = minimist(process.argv.slice(2), { - boolean: ['help'], - string: ['config', 'root', 'ignore', 'ignore-path'], - unknown: showUsage, - }); + try { + const opts = parseArgs({ + allowPositionals: true, + options: { + config: { + type: 'string', + }, + root: { + type: 'string', + }, + ignore: { + type: 'string', + multiple: true, + }, + 'ignore-path': { + type: 'string', + }, + help: { + type: 'boolean', + }, + }, + }); - if (opts.help || !opts._.length) showUsage(); + if (opts.values.help || !opts.positionals.length) return showUsage(); - return opts; + return opts; + } catch { + return showUsage(); + } } -if (require.main === module) { - const opts = parseCommandLine(); +if (process.argv[1] === fileURLToPath(import.meta.url)) { + const { values: opts, positionals } = parseCommandLine(); if (!opts.root) { opts.root = '.'; @@ -327,7 +344,7 @@ if (require.main === module) { opts.config ? path.resolve(opts.config) : path.resolve('.lint-roller.json'), ); - main(path.resolve(process.cwd(), opts.root), opts._, { + main(path.resolve(process.cwd(), opts.root), positionals, { config, ignoreGlobs: opts.ignore, }) diff --git a/lib/markdown.ts b/lib/markdown.ts index d1d1910..aba4405 100644 --- a/lib/markdown.ts +++ b/lib/markdown.ts @@ -2,7 +2,7 @@ import * as fs from 'node:fs'; import * as path from 'node:path'; import * as glob from 'glob'; -import * as MarkdownIt from 'markdown-it'; +import MarkdownIt from 'markdown-it'; import { githubSlugifier, resolveInternalDocumentLink, @@ -17,16 +17,14 @@ import { MdLink, MdLinkKind, } from '@dsanders11/vscode-markdown-languageservice'; +import { visit } from 'unist-util-visit'; +import { fromMarkdown } from 'mdast-util-from-markdown'; import { Emitter, Range } from 'vscode-languageserver'; import { TextDocument } from 'vscode-languageserver-textdocument'; import { URI } from 'vscode-uri'; -import { dynamicImport } from './helpers'; - import type { Code, Definition, ImageReference, Link, LinkReference } from 'mdast'; -import type { fromMarkdown as FromMarkdownFunction } from 'mdast-util-from-markdown'; import type { Node, Position } from 'unist'; -import type { visit as VisitFunction } from 'unist-util-visit'; export type { Code }; @@ -186,10 +184,6 @@ export class MarkdownLinkComputer implements IMdLinkComputer { } async getAllLinks(document: ITextDocument): Promise { - const { fromMarkdown } = (await dynamicImport('mdast-util-from-markdown')) as { - fromMarkdown: typeof FromMarkdownFunction; - }; - const tree = fromMarkdown(document.getText()); const links = [ @@ -202,10 +196,6 @@ export class MarkdownLinkComputer implements IMdLinkComputer { } async #getInlineLinks(document: ITextDocument, tree: Node): Promise { - const { visit } = (await dynamicImport('unist-util-visit')) as { - visit: typeof VisitFunction; - }; - const documentUri = URI.parse(document.uri); const links: MdLink[] = []; @@ -246,10 +236,6 @@ export class MarkdownLinkComputer implements IMdLinkComputer { } async #getReferenceLinks(document: ITextDocument, tree: Node): Promise { - const { visit } = (await dynamicImport('unist-util-visit')) as { - visit: typeof VisitFunction; - }; - const links: MdLink[] = []; visit( @@ -287,10 +273,6 @@ export class MarkdownLinkComputer implements IMdLinkComputer { } async #getLinkDefinitions(document: ITextDocument, tree: Node): Promise { - const { visit } = (await dynamicImport('unist-util-visit')) as { - visit: typeof VisitFunction; - }; - const documentUri = URI.parse(document.uri); const links: MdLink[] = []; @@ -336,13 +318,6 @@ export class MarkdownLinkComputer implements IMdLinkComputer { } export async function getCodeBlocks(content: string): Promise { - const { fromMarkdown } = (await dynamicImport('mdast-util-from-markdown')) as { - fromMarkdown: typeof FromMarkdownFunction; - }; - const { visit } = (await dynamicImport('unist-util-visit')) as { - visit: typeof VisitFunction; - }; - const tree = fromMarkdown(content); const codeBlocks: Code[] = []; diff --git a/package.json b/package.json index a1792a9..c52ef72 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,9 @@ "name": "@electron/lint-roller", "version": "0.0.0-development", "description": "Markdown linting helpers for Electron org repos", + "type": "module", "engines": { - "node": ">=18.0.0" + "node": ">=20.16.0 || >=22.4.0" }, "bin": { "lint-roller-markdown-links": "./dist/bin/lint-markdown-links.js", @@ -49,11 +50,10 @@ }, "devDependencies": { "@electron-internal/eslint-config": "^1.0.1", - "@types/balanced-match": "^1.0.3", + "@types/balanced-match": "^3.0.2", "@types/glob": "^8.1.0", - "@types/markdown-it": "^13.0.6", - "@types/minimist": "^1.2.5", - "@types/node": "20.1.2", + "@types/markdown-it": "^14.1.2", + "@types/node": "22.8.7", "esbuild": "^0.21.0", "eslint": "^8.54.0", "eslint-config-prettier": "^9.1.0", @@ -66,18 +66,16 @@ "dependencies": { "@dsanders11/vscode-markdown-languageservice": "^0.3.0", "ajv": "^8.16.0", - "balanced-match": "^2.0.0", - "glob": "^8.1.0", + "balanced-match": "^3.0.1", + "glob": "^10.4.5", "hast-util-from-html": "^2.0.1", - "markdown-it": "^13.0.1", + "markdown-it": "^14.1.0", "mdast-util-from-markdown": "^1.3.0", - "minimist": "^1.2.8", - "rimraf": "^4.4.1", "standard": "^17.0.0", "unist-util-visit": "^4.1.2", "vscode-languageserver": "^8.1.0", "vscode-languageserver-textdocument": "^1.0.8", - "vscode-uri": "^3.0.7", + "vscode-uri": "^3.0.8", "yaml": "^2.4.5" }, "peerDependencies": { @@ -87,8 +85,5 @@ "typescript": { "optional": true } - }, - "resolutions": { - "jackspeak": "2.1.1" } } diff --git a/tests/helpers.spec.ts b/tests/helpers.spec.ts index 317826b..da89e32 100644 --- a/tests/helpers.spec.ts +++ b/tests/helpers.spec.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest'; -import { findCurlyBracedDirectives } from '../lib/helpers'; +import { findCurlyBracedDirectives } from '../lib/helpers.js'; describe('findCurlyBracedDirectives', () => { it('should return an empty array if no matches', () => { diff --git a/tests/lint-roller-markdown-api-history.spec.ts b/tests/lint-roller-markdown-api-history.spec.ts index 3485cde..e3c55c8 100644 --- a/tests/lint-roller-markdown-api-history.spec.ts +++ b/tests/lint-roller-markdown-api-history.spec.ts @@ -501,8 +501,7 @@ describe('lint-roller-markdown-api-history', () => { '--check-placement', '--check-strings', '--check-descriptions', - '--disallow-comments', - 'false', + '--no-disallow-comments', '*.md', ); diff --git a/tsconfig.json b/tsconfig.json index cdfe912..204119c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,10 +1,10 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es2017", + "module": "es2022", + "target": "es2022", "lib": [ "DOM", - "es2017" + "es2022" ], "sourceMap": true, "strict": true, diff --git a/yarn.lock b/yarn.lock index 9c159fa..59e5284 100644 --- a/yarn.lock +++ b/yarn.lock @@ -350,6 +350,18 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz#e5211452df060fa8522b55c7b3c0c4d1981cb044" integrity sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw== +"@isaacs/cliui@^8.0.2": + version "8.0.2" + resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" + integrity sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA== + dependencies: + string-width "^5.1.2" + string-width-cjs "npm:string-width@^4.2.0" + strip-ansi "^7.0.1" + strip-ansi-cjs "npm:strip-ansi@^6.0.1" + wrap-ansi "^8.1.0" + wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" + "@jridgewell/sourcemap-codec@^1.5.0": version "1.5.0" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" @@ -466,10 +478,10 @@ resolved "https://registry.yarnpkg.com/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz#719df7fb41766bc143369eaa0dd56d8dc87c9958" integrity sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg== -"@types/balanced-match@^1.0.3": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@types/balanced-match/-/balanced-match-1.0.3.tgz#14fd1e4175bc45b878ca310739b330d6748f5fd8" - integrity sha512-nBZFt2r4snsIMicyNwgdga4wcoJtGRF39xX4Le3GjA2oSJcQlGAD8XrmlRddYcINFK8dypxJEUS6bVgKBQ7FyA== +"@types/balanced-match@^3.0.2": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@types/balanced-match/-/balanced-match-3.0.2.tgz#e8add173c7b3c682e4ea3572afb7955b447cea53" + integrity sha512-It1j6doJHkoGoxfOj3c7sHVHQXYMHo3c0kpcnPhEO4KfitNE5SqiSGKV0Hx5/cwyYKJfEhin0tZYBmqpjEcavw== "@types/debug@^4.0.0": version "4.1.7" @@ -508,18 +520,18 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== -"@types/linkify-it@*": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@types/linkify-it/-/linkify-it-3.0.2.tgz#fd2cd2edbaa7eaac7e7f3c1748b52a19143846c9" - integrity sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA== +"@types/linkify-it@^5": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@types/linkify-it/-/linkify-it-5.0.0.tgz#21413001973106cda1c3a9b91eedd4ccd5469d76" + integrity sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q== -"@types/markdown-it@^13.0.6": - version "13.0.7" - resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-13.0.7.tgz#4a495115f470075bd4434a0438ac477a49c2e152" - integrity sha512-U/CBi2YUUcTHBt5tjO2r5QV/x0Po6nsYwQU4Y04fBS6vfoImaiZ6f8bi3CjTCxBPQSO1LMyUqkByzi8AidyxfA== +"@types/markdown-it@^14.1.2": + version "14.1.2" + resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-14.1.2.tgz#57f2532a0800067d9b934f3521429a2e8bfb4c61" + integrity sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog== dependencies: - "@types/linkify-it" "*" - "@types/mdurl" "*" + "@types/linkify-it" "^5" + "@types/mdurl" "^2" "@types/mdast@^3.0.0": version "3.0.10" @@ -528,21 +540,16 @@ dependencies: "@types/unist" "*" -"@types/mdurl@*": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@types/mdurl/-/mdurl-1.0.2.tgz#e2ce9d83a613bacf284c7be7d491945e39e1f8e9" - integrity sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA== +"@types/mdurl@^2": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@types/mdurl/-/mdurl-2.0.0.tgz#d43878b5b20222682163ae6f897b20447233bdfd" + integrity sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg== "@types/minimatch@^5.1.2": version "5.1.2" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA== -"@types/minimist@^1.2.5": - version "1.2.5" - resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.5.tgz#ec10755e871497bcd83efe927e43ec46e8c0747e" - integrity sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag== - "@types/ms@*": version "0.7.31" resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.31.tgz#31b7ca6407128a3d2bbc27fe2d21b345397f6197" @@ -553,10 +560,12 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-18.14.0.tgz#94c47b9217bbac49d4a67a967fdcdeed89ebb7d0" integrity sha512-5EWrvLmglK+imbCJY0+INViFWUHg1AHel1sq4ZVSfdcNqGy9Edv3UB9IIzzg+xPaUcAgZYcfVs2fBcwDeZzU0A== -"@types/node@20.1.2": - version "20.1.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.1.2.tgz#8fd63447e3f99aba6c3168fd2ec4580d5b97886f" - integrity sha512-CTO/wa8x+rZU626cL2BlbCDzydgnFNgc19h4YvizpTO88MFQxab8wqisxaofQJ/9bLGugRdWIuX/TbIs6VVF6g== +"@types/node@22.8.7": + version "22.8.7" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.8.7.tgz#04ab7a073d95b4a6ee899f235d43f3c320a976f4" + integrity sha512-LidcG+2UeYIWcMuMUpBKOnryBWG/rnmOHQR5apjn8myTQcx3rinFRn7DcIFhMnS0PPFSC6OafdIKEad0lj6U0Q== + dependencies: + undici-types "~6.19.8" "@types/semver@^7.3.12": version "7.3.13" @@ -766,6 +775,11 @@ ansi-regex@^5.0.1: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== +ansi-regex@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.1.0.tgz#95ec409c69619d6cb1b8b34f14b660ef28ebd654" + integrity sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA== + ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" @@ -773,6 +787,11 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0: dependencies: color-convert "^2.0.1" +ansi-styles@^6.1.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" + integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== + argparse@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" @@ -840,10 +859,10 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== -balanced-match@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-2.0.0.tgz#dc70f920d78db8b858535795867bf48f820633d9" - integrity sha512-1ugUSr8BHXRnK23KfuYS+gVMC3LB8QGH9W1iGtDPsNWoQbgtXSExkBu2aDR4epiGWZOjZsj6lDl/N/AqqTC3UA== +balanced-match@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-3.0.1.tgz#e854b098724b15076384266497392a271f4a26a0" + integrity sha512-vjtV3hiLqYDNRoiAv0zC4QaGAMPomEoq83PRmYIofPswwZurCeWR5LByXm7SyoL0Zh5+2z0+HC7jG8gSZJUh0w== brace-expansion@^1.1.7: version "1.1.11" @@ -921,15 +940,6 @@ check-error@^2.1.1: resolved "https://registry.yarnpkg.com/check-error/-/check-error-2.1.1.tgz#87eb876ae71ee388fa0471fe423f494be1d96ccc" integrity sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw== -cliui@^8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" - integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.1" - wrap-ansi "^7.0.0" - color-convert@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" @@ -952,7 +962,7 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== -cross-spawn@^7.0.2: +cross-spawn@^7.0.0, cross-spawn@^7.0.2: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -1045,21 +1055,26 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" +eastasianwidth@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" + integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== + emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== +emoji-regex@^9.2.2: + version "9.2.2" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" + integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== + entities@^4.4.0: version "4.5.0" resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== -entities@~3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/entities/-/entities-3.0.1.tgz#2b887ca62585e96db3903482d336c1006c3001d4" - integrity sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q== - error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" @@ -1634,6 +1649,14 @@ for-each@^0.3.3: dependencies: is-callable "^1.1.3" +foreground-child@^3.1.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-3.3.0.tgz#0ac8644c06e431439f8561db8ecf29a7b5519c77" + integrity sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg== + dependencies: + cross-spawn "^7.0.0" + signal-exit "^4.0.1" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -1700,6 +1723,18 @@ glob-parent@^6.0.2: dependencies: is-glob "^4.0.3" +glob@^10.4.5: + version "10.4.5" + resolved "https://registry.yarnpkg.com/glob/-/glob-10.4.5.tgz#f4d9f0b90ffdbab09c9d77f5f29b4262517b0956" + integrity sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg== + dependencies: + foreground-child "^3.1.0" + jackspeak "^3.1.2" + minimatch "^9.0.4" + minipass "^7.1.2" + package-json-from-dist "^1.0.0" + path-scurry "^1.11.1" + glob@^7.1.3: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" @@ -1712,27 +1747,6 @@ glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e" - integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^5.0.1" - once "^1.3.0" - -glob@^9.2.0: - version "9.3.5" - resolved "https://registry.yarnpkg.com/glob/-/glob-9.3.5.tgz#ca2ed8ca452781a3009685607fdf025a899dfe21" - integrity sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q== - dependencies: - fs.realpath "^1.0.0" - minimatch "^8.0.2" - minipass "^4.2.4" - path-scurry "^1.6.1" - globals@^13.19.0: version "13.20.0" resolved "https://registry.yarnpkg.com/globals/-/globals-13.20.0.tgz#ea276a1e508ffd4f1612888f9d1bad1e2717bf82" @@ -2062,12 +2076,12 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== -jackspeak@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-2.1.1.tgz#2a42db4cfbb7e55433c28b6f75d8b796af9669cd" - integrity sha512-juf9stUEwUaILepraGOWIJTLwg48bUnBmRqd2ln2Os1sW987zeoj/hzhbvRB95oMuS2ZTpjULmdwHNX4rzZIZw== +jackspeak@^3.1.2: + version "3.4.3" + resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-3.4.3.tgz#8833a9d89ab4acde6188942bd1c53b6390ed5a8a" + integrity sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw== dependencies: - cliui "^8.0.1" + "@isaacs/cliui" "^8.0.2" optionalDependencies: "@pkgjs/parseargs" "^0.11.0" @@ -2141,13 +2155,6 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" -linkify-it@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-4.0.1.tgz#01f1d5e508190d06669982ba31a7d9f56a5751ec" - integrity sha512-C7bfi1UZmoj8+PQx22XyeXCuBlokoyWQL5pWSP+EI6nzRylyThouddufc2c1NDIcP9k5agmN9fLpA7VNJfIiqw== - dependencies: - uc.micro "^1.0.1" - linkify-it@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-5.0.0.tgz#9ef238bfa6dc70bd8e7f9572b52d369af569b421" @@ -2198,6 +2205,11 @@ loupe@^3.1.0, loupe@^3.1.2: resolved "https://registry.yarnpkg.com/loupe/-/loupe-3.1.2.tgz#c86e0696804a02218f2206124c45d8b15291a240" integrity sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg== +lru-cache@^10.2.0: + version "10.4.3" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119" + integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ== + lru-cache@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" @@ -2205,11 +2217,6 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" -lru-cache@^9.1.1: - version "9.1.1" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-9.1.1.tgz#c58a93de58630b688de39ad04ef02ef26f1902f1" - integrity sha512-65/Jky17UwSb0BuB9V+MyDpsOtXKmYwzhyl+cOa9XUiI4uV2Ouy/2voFP3+al0BjZbJgMBD8FojMpAf+Z+qn4A== - magic-string@^0.30.12: version "0.30.12" resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.12.tgz#9eb11c9d072b9bcb4940a5b2c2e1a217e4ee1a60" @@ -2217,7 +2224,7 @@ magic-string@^0.30.12: dependencies: "@jridgewell/sourcemap-codec" "^1.5.0" -markdown-it@14.1.0: +markdown-it@14.1.0, markdown-it@^14.1.0: version "14.1.0" resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-14.1.0.tgz#3c3c5992883c633db4714ccb4d7b5935d98b7d45" integrity sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg== @@ -2229,17 +2236,6 @@ markdown-it@14.1.0: punycode.js "^2.3.1" uc.micro "^2.1.0" -markdown-it@^13.0.1: - version "13.0.1" - resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-13.0.1.tgz#c6ecc431cacf1a5da531423fc6a42807814af430" - integrity sha512-lTlxriVoy2criHP0JKRhO2VDG9c2ypWCsT237eDiLqi09rmbKoUetyGHq2uOIRoRS//kfoJckS0eUzzkDR+k2Q== - dependencies: - argparse "^2.0.1" - entities "~3.0.1" - linkify-it "^4.0.1" - mdurl "^1.0.1" - uc.micro "^1.0.5" - markdownlint-cli2-formatter-default@0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/markdownlint-cli2-formatter-default/-/markdownlint-cli2-formatter-default-0.0.5.tgz#b8fde4e127f9a9c0596e6d45eed352dd0aa0ff98" @@ -2295,11 +2291,6 @@ mdast-util-to-string@^3.1.0: dependencies: "@types/mdast" "^3.0.0" -mdurl@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" - integrity sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g== - mdurl@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-2.0.0.tgz#80676ec0433025dd3e17ee983d0fe8de5a2237e0" @@ -2520,34 +2511,22 @@ minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" -minimatch@^5.0.1: - version "5.1.6" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" - integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== +minimatch@^9.0.4: + version "9.0.5" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.5.tgz#d74f9dd6b57d83d8e98cfb82133b03978bc929e5" + integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow== dependencies: brace-expansion "^2.0.1" -minimatch@^8.0.2: - version "8.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-8.0.4.tgz#847c1b25c014d4e9a7f68aaf63dedd668a626229" - integrity sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA== - dependencies: - brace-expansion "^2.0.1" - -minimist@^1.2.0, minimist@^1.2.6, minimist@^1.2.8: +minimist@^1.2.0, minimist@^1.2.6: version "1.2.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== -minipass@^4.2.4: - version "4.2.8" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-4.2.8.tgz#f0010f64393ecfc1d1ccb5f582bcaf45f48e1a3a" - integrity sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ== - -minipass@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d" - integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ== +"minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707" + integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw== mri@^1.1.0: version "1.2.0" @@ -2703,6 +2682,11 @@ p-try@^2.0.0: resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== +package-json-from-dist@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz#4f1471a010827a86f94cfd9b0727e36d267de505" + integrity sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw== + parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -2750,13 +2734,13 @@ path-parse@^1.0.7: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== -path-scurry@^1.6.1: - version "1.8.0" - resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.8.0.tgz#809e09690c63817c76d0183f19a5b21b530ff7d2" - integrity sha512-IjTrKseM404/UAWA8bBbL3Qp6O2wXkanuIE3seCxBH7ctRuvH1QRawy1N3nVDHGkdeZsjOsSe/8AQBL/VQCy2g== +path-scurry@^1.11.1: + version "1.11.1" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.11.1.tgz#7960a668888594a0720b12a911d1a742ab9f11d2" + integrity sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA== dependencies: - lru-cache "^9.1.1" - minipass "^5.0.0" + lru-cache "^10.2.0" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" path-type@^4.0.0: version "4.0.0" @@ -2908,13 +2892,6 @@ rimraf@^3.0.2: dependencies: glob "^7.1.3" -rimraf@^4.4.1: - version "4.4.1" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-4.4.1.tgz#bd33364f67021c5b79e93d7f4fa0568c7c21b755" - integrity sha512-Gk8NlF062+T9CqNGn6h4tls3k6T1+/nXdOcSZVikNVtlRdYpA7wRJJMoXmuvOnLW844rPjdQ7JgXCYM6PPC/og== - dependencies: - glob "^9.2.0" - rollup@^4.20.0: version "4.22.4" resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.22.4.tgz#4135a6446671cd2a2453e1ad42a45d5973ec3a0f" @@ -3001,6 +2978,11 @@ siginfo@^2.0.0: resolved "https://registry.yarnpkg.com/siginfo/-/siginfo-2.0.0.tgz#32e76c70b79724e3bb567cb9d543eb858ccfaf30" integrity sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g== +signal-exit@^4.0.1: + version "4.1.0" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== + slash@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" @@ -3055,7 +3037,16 @@ std-env@^3.7.0: resolved "https://registry.yarnpkg.com/std-env/-/std-env-3.7.0.tgz#c9f7386ced6ecf13360b6c6c55b8aaa4ef7481d2" integrity sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg== -string-width@^4.1.0, string-width@^4.2.0: +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string-width@^4.1.0: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -3064,6 +3055,15 @@ string-width@^4.1.0, string-width@^4.2.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" +string-width@^5.0.1, string-width@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" + integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== + dependencies: + eastasianwidth "^0.2.0" + emoji-regex "^9.2.2" + strip-ansi "^7.0.1" + string.prototype.matchall@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.8.tgz#3bf85722021816dcd1bf38bb714915887ca79fd3" @@ -3096,6 +3096,13 @@ string.prototype.trimstart@^1.0.6: define-properties "^1.1.4" es-abstract "^1.20.4" +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" @@ -3103,6 +3110,13 @@ strip-ansi@^6.0.0, strip-ansi@^6.0.1: dependencies: ansi-regex "^5.0.1" +strip-ansi@^7.0.1: + version "7.1.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" + integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== + dependencies: + ansi-regex "^6.0.1" + strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" @@ -3215,11 +3229,6 @@ typescript@^5.4.5: resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.5.tgz#42ccef2c571fdbd0f6718b1d1f5e6e5ef006f611" integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ== -uc.micro@^1.0.1, uc.micro@^1.0.5: - version "1.0.6" - resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" - integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== - uc.micro@^2.0.0, uc.micro@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-2.1.0.tgz#f8d3f7d0ec4c3dea35a7e3c8efa4cb8b45c9e7ee" @@ -3235,6 +3244,11 @@ unbox-primitive@^1.0.2: has-symbols "^1.0.3" which-boxed-primitive "^1.0.2" +undici-types@~6.19.8: + version "6.19.8" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" + integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== + unicorn-magic@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/unicorn-magic/-/unicorn-magic-0.1.0.tgz#1bb9a51c823aaf9d73a8bfcd3d1a23dde94b0ce4" @@ -3395,11 +3409,16 @@ vscode-languageserver@^8.1.0: dependencies: vscode-languageserver-protocol "3.17.3" -vscode-uri@^3.0.3, vscode-uri@^3.0.7: +vscode-uri@^3.0.3: version "3.0.7" resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.7.tgz#6d19fef387ee6b46c479e5fb00870e15e58c1eb8" integrity sha512-eOpPHogvorZRobNqJGhapa0JdwaxpjVvyBp0QIUMRMSf8ZAlqOdEquKuRmw9Qwu0qXtJIWqFtMkmvJjUZmMjVA== +vscode-uri@^3.0.8: + version "3.0.8" + resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.8.tgz#1770938d3e72588659a172d0fd4642780083ff9f" + integrity sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw== + web-namespaces@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/web-namespaces/-/web-namespaces-2.0.1.tgz#1010ff7c650eccb2592cebeeaf9a1b253fd40692" @@ -3448,7 +3467,7 @@ word-wrap@^1.2.3: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.4.tgz#cb4b50ec9aca570abd1f52f33cd45b6c61739a9f" integrity sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA== -wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -3457,6 +3476,15 @@ wrap-ansi@^7.0.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" + integrity sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ== + dependencies: + ansi-styles "^6.1.0" + string-width "^5.0.1" + strip-ansi "^7.0.1" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" From c573d56a8affbfe07a2d43f5b14ee60316c5bdef Mon Sep 17 00:00:00 2001 From: David Sanders Date: Mon, 4 Nov 2024 15:46:17 -0800 Subject: [PATCH 2/3] chore: convert custom rules to .cjs extension --- .gitignore | 4 ++-- markdownlint-rules/{emd004.js => emd004.cjs} | 0 markdownlint-rules/index.cjs | 5 +++++ markdownlint-rules/index.js | 5 ----- package.json | 4 ++-- tests/markdownlint-cli2.spec.ts | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) rename markdownlint-rules/{emd004.js => emd004.cjs} (100%) create mode 100644 markdownlint-rules/index.cjs delete mode 100644 markdownlint-rules/index.js diff --git a/.gitignore b/.gitignore index 4612385..e637f3f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ dist node_modules -markdownlint-rules/emd002.js -markdownlint-rules/emd003.js +markdownlint-rules/emd002.cjs +markdownlint-rules/emd003.cjs diff --git a/markdownlint-rules/emd004.js b/markdownlint-rules/emd004.cjs similarity index 100% rename from markdownlint-rules/emd004.js rename to markdownlint-rules/emd004.cjs diff --git a/markdownlint-rules/index.cjs b/markdownlint-rules/index.cjs new file mode 100644 index 0000000..802ddb6 --- /dev/null +++ b/markdownlint-rules/index.cjs @@ -0,0 +1,5 @@ +const EMD002 = require('./emd002.cjs'); +const EMD003 = require('./emd003.cjs'); +const EMD004 = require('./emd004.cjs'); + +module.exports = [EMD002, EMD003, EMD004]; diff --git a/markdownlint-rules/index.js b/markdownlint-rules/index.js deleted file mode 100644 index 71ef263..0000000 --- a/markdownlint-rules/index.js +++ /dev/null @@ -1,5 +0,0 @@ -const EMD002 = require('./emd002.js'); -const EMD003 = require('./emd003.js'); -const EMD004 = require('./emd004.js'); - -module.exports = [EMD002, EMD003, EMD004]; diff --git a/package.json b/package.json index c52ef72..5eba3ba 100644 --- a/package.json +++ b/package.json @@ -23,8 +23,8 @@ }, "scripts": { "build": "tsc && yarn run build:emd002 && yarn run build:emd003", - "build:emd002": "esbuild --platform=node --target=node18 --format=cjs --bundle --outfile=markdownlint-rules/emd002.js markdownlint-rules/emd002.mjs", - "build:emd003": "esbuild --platform=node --target=node18 --format=cjs --bundle --outfile=markdownlint-rules/emd003.js markdownlint-rules/emd003.mjs", + "build:emd002": "esbuild --platform=node --target=node18 --format=cjs --bundle --outfile=markdownlint-rules/emd002.cjs markdownlint-rules/emd002.mjs", + "build:emd003": "esbuild --platform=node --target=node18 --format=cjs --bundle --outfile=markdownlint-rules/emd003.cjs markdownlint-rules/emd003.mjs", "prepublishOnly": "yarn run build", "lint:eslint": "eslint \"{bin,lib,markdownlint-rules,tests}/**/*.{js,mjs,ts}\"", "lint:eslint:fix": "eslint --fix \"{bin,lib,markdownlint-rules,tests}/**/*.{js,mjs,ts}\"", diff --git a/tests/markdownlint-cli2.spec.ts b/tests/markdownlint-cli2.spec.ts index fe6b054..f040e1e 100644 --- a/tests/markdownlint-cli2.spec.ts +++ b/tests/markdownlint-cli2.spec.ts @@ -18,7 +18,7 @@ async function runMarkdownlint(args: string[], configOptions: Record Date: Mon, 4 Nov 2024 16:24:53 -0800 Subject: [PATCH 3/3] chore: convert custom markdownlint rules to ESM --- .gitignore | 2 - markdownlint-rules/emd004.cjs | 30 ------- markdownlint-rules/emd004.mjs | 31 +++++++ markdownlint-rules/index.cjs | 5 -- markdownlint-rules/index.mjs | 5 ++ package.json | 5 +- tests/markdownlint-cli2.spec.ts | 2 +- yarn.lock | 144 -------------------------------- 8 files changed, 38 insertions(+), 186 deletions(-) delete mode 100644 markdownlint-rules/emd004.cjs create mode 100644 markdownlint-rules/emd004.mjs delete mode 100644 markdownlint-rules/index.cjs create mode 100644 markdownlint-rules/index.mjs diff --git a/.gitignore b/.gitignore index e637f3f..de4d1f0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,2 @@ dist node_modules -markdownlint-rules/emd002.cjs -markdownlint-rules/emd003.cjs diff --git a/markdownlint-rules/emd004.cjs b/markdownlint-rules/emd004.cjs deleted file mode 100644 index 40947e9..0000000 --- a/markdownlint-rules/emd004.cjs +++ /dev/null @@ -1,30 +0,0 @@ -module.exports = { - names: ['EMD004', 'no-newline-in-links'], - description: 'Newlines inside link text', - tags: ['newline', 'links'], - parser: 'markdownit', - function: function EMD004(params, onError) { - const tokens = params.parsers.markdownit.tokens.filter((token) => token.type === 'inline'); - - for (const token of tokens) { - const { children } = token; - let { lineNumber } = token; - let inLink = false; - for (const child of children) { - const { type } = child; - if (type === 'link_open') { - inLink = true; - } else if (type === 'link_close') { - inLink = false; - } else if (type === 'softbreak') { - if (inLink) { - onError({ lineNumber }); - break; - } else { - lineNumber++; - } - } - } - } - }, -}; diff --git a/markdownlint-rules/emd004.mjs b/markdownlint-rules/emd004.mjs new file mode 100644 index 0000000..36e6896 --- /dev/null +++ b/markdownlint-rules/emd004.mjs @@ -0,0 +1,31 @@ +export const names = ['EMD004', 'no-newline-in-links']; +export const description = 'Newlines inside link text'; +export const tags = ['newline', 'links']; +export const parser = 'markdownit'; + +function EMD004(params, onError) { + const tokens = params.parsers.markdownit.tokens.filter((token) => token.type === 'inline'); + + for (const token of tokens) { + const { children } = token; + let { lineNumber } = token; + let inLink = false; + for (const child of children) { + const { type } = child; + if (type === 'link_open') { + inLink = true; + } else if (type === 'link_close') { + inLink = false; + } else if (type === 'softbreak') { + if (inLink) { + onError({ lineNumber }); + break; + } else { + lineNumber++; + } + } + } + } +} + +export { EMD004 as function }; diff --git a/markdownlint-rules/index.cjs b/markdownlint-rules/index.cjs deleted file mode 100644 index 802ddb6..0000000 --- a/markdownlint-rules/index.cjs +++ /dev/null @@ -1,5 +0,0 @@ -const EMD002 = require('./emd002.cjs'); -const EMD003 = require('./emd003.cjs'); -const EMD004 = require('./emd004.cjs'); - -module.exports = [EMD002, EMD003, EMD004]; diff --git a/markdownlint-rules/index.mjs b/markdownlint-rules/index.mjs new file mode 100644 index 0000000..287c2ec --- /dev/null +++ b/markdownlint-rules/index.mjs @@ -0,0 +1,5 @@ +import * as EMD002 from './emd002.mjs'; +import * as EMD003 from './emd003.mjs'; +import * as EMD004 from './emd004.mjs'; + +export default [EMD002, EMD003, EMD004]; diff --git a/package.json b/package.json index 5eba3ba..2779799 100644 --- a/package.json +++ b/package.json @@ -22,9 +22,7 @@ "lib": "lib" }, "scripts": { - "build": "tsc && yarn run build:emd002 && yarn run build:emd003", - "build:emd002": "esbuild --platform=node --target=node18 --format=cjs --bundle --outfile=markdownlint-rules/emd002.cjs markdownlint-rules/emd002.mjs", - "build:emd003": "esbuild --platform=node --target=node18 --format=cjs --bundle --outfile=markdownlint-rules/emd003.cjs markdownlint-rules/emd003.mjs", + "build": "tsc", "prepublishOnly": "yarn run build", "lint:eslint": "eslint \"{bin,lib,markdownlint-rules,tests}/**/*.{js,mjs,ts}\"", "lint:eslint:fix": "eslint --fix \"{bin,lib,markdownlint-rules,tests}/**/*.{js,mjs,ts}\"", @@ -54,7 +52,6 @@ "@types/glob": "^8.1.0", "@types/markdown-it": "^14.1.2", "@types/node": "22.8.7", - "esbuild": "^0.21.0", "eslint": "^8.54.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-node": "^11.1.0", diff --git a/tests/markdownlint-cli2.spec.ts b/tests/markdownlint-cli2.spec.ts index f040e1e..beacbaf 100644 --- a/tests/markdownlint-cli2.spec.ts +++ b/tests/markdownlint-cli2.spec.ts @@ -18,7 +18,7 @@ async function runMarkdownlint(args: string[], configOptions: Record