Skip to content

Commit 8b26129

Browse files
committed
Convert types.d.mts from ambient module declaration to module augmentation which enables VS Code to handle @type {import("markdownlint").Rule} (https://www.typescriptlang.org/docs/handbook/modules/reference.html#ambient-modules), fix broken markdownlint @typedefs in helpers/*.cjs.
1 parent 6737ace commit 8b26129

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

helpers/helpers.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ module.exports.newLineRe = newLineRe;
1010
module.exports.nextLinesRe = nextLinesRe;
1111

1212
// @ts-expect-error https://github.com/microsoft/TypeScript/issues/52529
13-
/** @typedef {import("markdownlint").RuleOnError} RuleOnError */
13+
/** @typedef {import("../lib/exports.mjs").RuleOnError} RuleOnError */
1414
// @ts-expect-error https://github.com/microsoft/TypeScript/issues/52529
15-
/** @typedef {import("markdownlint").RuleOnErrorFixInfo} RuleOnErrorFixInfo */
15+
/** @typedef {import("../lib/exports.mjs").RuleOnErrorFixInfo} RuleOnErrorFixInfo */
1616
// @ts-expect-error https://github.com/microsoft/TypeScript/issues/52529
17-
/** @typedef {import("markdownlint").MicromarkToken} MicromarkToken */
17+
/** @typedef {import("../lib/exports.mjs").MicromarkToken} MicromarkToken */
1818
// eslint-disable-next-line jsdoc/valid-types
1919
/** @typedef {import("micromark-extension-gfm-footnote", { with: { "resolution-mode": "import" } })} */
2020
// eslint-disable-next-line jsdoc/valid-types

helpers/micromark-helpers.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const { flatTokensSymbol, htmlFlowSymbol } = require("./shared.cjs");
77
// eslint-disable-next-line jsdoc/valid-types
88
/** @typedef {import("micromark-util-types", { with: { "resolution-mode": "import" } }).TokenType} TokenType */
99
// @ts-expect-error https://github.com/microsoft/TypeScript/issues/52529
10-
/** @typedef {import("markdownlint").MicromarkToken} Token */
10+
/** @typedef {import("../lib/exports.mjs").MicromarkToken} Token */
1111

1212
/**
1313
* Determines if a Micromark token is within an htmlFlow type.

lib/types.d.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
export {};
12
declare module "markdownlint" {
23
export * from "./exports.mjs";
34
}

0 commit comments

Comments
 (0)