Skip to content
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
2ae787e
refactor: align rule type definitions with conventions from other plu…
lumirlumir May 9, 2025
d9b4be6
wip
lumirlumir May 9, 2025
f023049
wip: update `dedupe-types`
lumirlumir May 9, 2025
c65d558
wip: update `rules` type import path
lumirlumir May 9, 2025
7e73c58
wip: complete migration
lumirlumir May 9, 2025
bfb7894
wip: fix errors
lumirlumir May 9, 2025
31d2a1b
wip: cleanup
lumirlumir May 9, 2025
e66c951
wip: complete migration
lumirlumir May 9, 2025
1ead275
wip
lumirlumir May 9, 2025
b1e6298
Merge branch 'main' of https://github.com/eslint/markdown into refact…
lumirlumir Jun 21, 2025
6daf0a6
wip: revert type testing
lumirlumir Jun 21, 2025
200a2e9
wip: update `index.js`
lumirlumir Jun 21, 2025
d047161
wip: update `fenced-code-language.js`
lumirlumir Jun 21, 2025
1c62c89
wip: update `heading-increment.js`
lumirlumir Jun 21, 2025
ffa31ed
wip: update `no-bare-urls`
lumirlumir Jun 21, 2025
2e6f981
wip: update `no-duplicate-definitions.js`
lumirlumir Jun 21, 2025
eb27cc1
wip: update `no-duplicate-headings.js`
lumirlumir Jun 21, 2025
a0db87f
wip: add optional property to `no-duplicate-definitions`
lumirlumir Jun 21, 2025
3aea485
wip: update `no-empty-definitions.js`
lumirlumir Jun 21, 2025
c2df307
wip: update `no-empty-images.js`
lumirlumir Jun 21, 2025
89d8406
wip: update `no-empty-links.js`
lumirlumir Jun 21, 2025
b046450
wip: update `no-html.js`
lumirlumir Jun 21, 2025
655d241
wip: update `no-invalid-label-refs.js`
lumirlumir Jun 21, 2025
2dfb75f
wip: update `no-missing-atx-heading-space.js`
lumirlumir Jun 21, 2025
36f64d4
wip: update `no-missing-label-refs.js`
lumirlumir Jun 21, 2025
5b992fe
wip: update `index.js`
lumirlumir Jun 21, 2025
6e6c436
wip: fix CI error
lumirlumir Jun 21, 2025
cb574f4
wip: update `no-missing-link-fragements.js`
lumirlumir Jun 21, 2025
c1f6c24
wip: update `types.ts`
lumirlumir Jun 21, 2025
6cac104
wip: update `no-multiple-h1.js`
lumirlumir Jun 21, 2025
af428d2
wip: update `no-reversed-media-syntax.js`
lumirlumir Jun 21, 2025
fa288c2
wip: update `require-alt-text.js`
lumirlumir Jun 21, 2025
4f73f4d
wip: update `table-column-count.js`
lumirlumir Jun 21, 2025
be286e6
wip: more accurate type
lumirlumir Jun 22, 2025
7de7180
wip: typo
lumirlumir Jun 22, 2025
c01f54e
Merge branch 'main' of https://github.com/eslint/markdown into refact…
lumirlumir Jun 23, 2025
47f06b7
wip: extra blank line
lumirlumir Jun 23, 2025
a001891
wip: address comment
lumirlumir Jun 25, 2025
7e3f031
Merge branch 'main' into refactor-align-rule-type-definitions-with-co…
lumirlumir Jul 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @fileoverview Enables the processor for Markdown file extensions.
* @fileoverview Markdown plugin.
* @author Brandon Mills
*/

Expand All @@ -17,16 +17,18 @@ import rules from "./build/rules.js";
// Type Definitions
//-----------------------------------------------------------------------------

/** @typedef {import("eslint").Linter.RulesRecord} RulesRecord*/
/** @typedef {import("eslint").Linter.Config} Config*/
/** @typedef {import("eslint").ESLint.Plugin} Plugin */
/**
* @typedef {import("./types.ts").MarkdownRuleDefinition<Options>} MarkdownRuleDefinition<Options>
* @template {Partial<import("./types.ts").MarkdownRuleDefinitionTypeOptions>} [Options={}]
* @import { Linter } from "eslint";
* @import { MarkdownRuleVisitor as MRV, MarkdownRuleDefinition as MRD, MarkdownRuleDefinitionTypeOptions } from "./types.js";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just use the regular names? I think that makes things a lot easier to understand.

Suggested change
* @import { MarkdownRuleVisitor as MRV, MarkdownRuleDefinition as MRD, MarkdownRuleDefinitionTypeOptions } from "./types.js";
* @import { MarkdownRuleVisitor , MarkdownRuleDefinition, MarkdownRuleDefinitionTypeOptions } from "./types.js";

Copy link
Member Author

@lumirlumir lumirlumir Jun 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially tried using the original name, but without an alias, it results in a duplicate type definitions error when running the tsc command, since the same name is declared again in the following lines using the @typedef syntax.

(This redeclaration is intentional, for the reason I mentioned here.)

However, if we decide to remove these types from the @eslint/markdown export path and move them to the @eslint/markdown/types path, then these lines can be safely removed. (ref: here)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe instead of renaming the imported types we could import the whole types module as a namespace to avoid the naming collision? I.e:

/**
 * @import { Linter } from "eslint";
 * @import * as Types from "./types.js";
 * @typedef {Linter.RulesRecord} RulesRecord
 * @typedef {Types.MarkdownRuleDefinition} RuleModule
 * @typedef {Types.MarkdownRuleVisitor} MarkdownRuleVisitor
 */

And similarly for the MarkdownRuleDefinition typedef below.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, it works 👍

I've added a new commit a001891

* @typedef {Linter.RulesRecord} RulesRecord
* @typedef {MarkdownRuleDefinition} RuleModule
* @typedef {MRV} MarkdownRuleVisitor
*/

/**
* @typedef {MRD<Options>} MarkdownRuleDefinition<Options>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I don't think we need these.

Copy link
Member Author

@lumirlumir lumirlumir Jun 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because the type tests in types.test.js currently depend on these type definitions.
So, removing them in this PR would introduce a breaking change:

import markdown, {
MarkdownSourceCode,
MarkdownRuleDefinition,
MarkdownRuleVisitor,
type RuleModule,
} from "@eslint/markdown";

Personally, I think it would be better to keep this PR non-breaking and create a separate PR to remove these types and move them under the @eslint/markdown/types path when importing.

Both the JSON and CSS plugins follow a similar approach, so it would make sense to organize the types this way:

If it’s acceptable, I can open a separate PR with the breaking changes by tomorrow.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Because the next release will be a major release, this is the time to get all the breaking changes in. 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made a separate PR #446 👍

* @template {Partial<MarkdownRuleDefinitionTypeOptions>} [Options={}]
*/
/** @typedef {MarkdownRuleDefinition} RuleModule */
/** @typedef {import("./types.ts").MarkdownRuleVisitor} MarkdownRuleVisitor */
/** @typedef {import("@eslint/core").Language} Language */

//-----------------------------------------------------------------------------
// Exports
Expand Down
23 changes: 11 additions & 12 deletions src/language/markdown-language.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@ import { gfm } from "micromark-extension-gfm";
// Types
//-----------------------------------------------------------------------------

/** @typedef {import("mdast").Root} RootNode */
/** @typedef {import("mdast-util-from-markdown").Options['extensions']} Extensions */
/** @typedef {import("mdast-util-from-markdown").Options['mdastExtensions']} MdastExtensions */
/** @typedef {import("@eslint/core").Language} Language */
/** @typedef {import("@eslint/core").File} File */
/** @typedef {import("@eslint/core").ParseResult<RootNode>} ParseResult */
/** @typedef {import("@eslint/core").OkParseResult<RootNode>} OkParseResult */
/** @typedef {import("../types.ts").MarkdownLanguageOptions} MarkdownLanguageOptions */
/** @typedef {import("../types.ts").MarkdownLanguageContext} MarkdownLanguageContext */
/** @typedef {"commonmark"|"gfm"} ParserMode */
/**
* @import { Language, File, ParseResult, OkParseResult } from "@eslint/core";
* @import { Root } from "mdast";
* @import { Options } from "mdast-util-from-markdown";
* @import { MarkdownLanguageOptions, MarkdownLanguageContext } from "../types.js";
* @typedef {Options['extensions']} Extensions
* @typedef {Options['mdastExtensions']} MdastExtensions
* @typedef {"commonmark"|"gfm"} ParserMode
*/

//-----------------------------------------------------------------------------
// Helpers
Expand Down Expand Up @@ -182,7 +181,7 @@ export class MarkdownLanguage {
* Parses the given file into an AST.
* @param {File} file The virtual file to parse.
* @param {MarkdownLanguageContext} context The options to use for parsing.
* @returns {ParseResult} The result of parsing.
* @returns {ParseResult<Root>} The result of parsing.
*/
parse(file, context) {
// Note: BOM already removed
Expand Down Expand Up @@ -216,7 +215,7 @@ export class MarkdownLanguage {
/**
* Creates a new `MarkdownSourceCode` object from the given information.
* @param {File} file The virtual file to create a `MarkdownSourceCode` object from.
* @param {OkParseResult} parseResult The result returned from `parse()`.
* @param {OkParseResult<Root>} parseResult The result returned from `parse()`.
* @returns {MarkdownSourceCode} The new `MarkdownSourceCode` object.
*/
createSourceCode(file, parseResult) {
Expand Down
35 changes: 13 additions & 22 deletions src/language/markdown-source-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,11 @@ import { findOffsets } from "../util.js";
// Types
//-----------------------------------------------------------------------------

/** @typedef {import("mdast").Root} RootNode */
/** @typedef {import("mdast").Node} MarkdownNode */
/** @typedef {import("mdast").Html} HTMLNode */
/** @typedef {import("@eslint/core").Language} Language */
/** @typedef {import("@eslint/core").File} File */
/** @typedef {import("@eslint/core").TraversalStep} TraversalStep */
/** @typedef {import("@eslint/core").VisitTraversalStep} VisitTraversalStep */
/** @typedef {import("@eslint/core").ParseResult<RootNode>} ParseResult */
/** @typedef {import("@eslint/core").SourceLocation} SourceLocation */
/** @typedef {import("@eslint/core").SourceRange} SourceRange */
/** @typedef {import("@eslint/core").FileProblem} FileProblem */
/** @typedef {import("@eslint/core").DirectiveType} DirectiveType */
/** @typedef {import("@eslint/core").RulesConfig} RulesConfig */
/** @typedef {import("../types.ts").MarkdownLanguageOptions} MarkdownLanguageOptions */
/**
* @import { Root, Node, Html } from "mdast";
* @import { TraversalStep, SourceLocation, FileProblem, DirectiveType, RulesConfig } from "@eslint/core";
* @import { MarkdownLanguageOptions } from "../types.js";
*/

//-----------------------------------------------------------------------------
// Helpers
Expand Down Expand Up @@ -73,7 +64,7 @@ class InlineConfigComment {

/**
* Extracts inline configuration comments from an HTML node.
* @param {HTMLNode} node The HTML node to extract comments from.
* @param {Html} node The HTML node to extract comments from.
* @returns {Array<InlineConfigComment>} The inline configuration comments found in the node.
*/
function extractInlineConfigCommentsFromHTML(node) {
Expand Down Expand Up @@ -136,7 +127,7 @@ function extractInlineConfigCommentsFromHTML(node) {

/**
* Markdown Source Code Object
* @extends {TextSourceCodeBase<{LangOptions: MarkdownLanguageOptions, RootNode: RootNode, SyntaxElementWithLoc: MarkdownNode, ConfigNode: { value: string; position: SourceLocation }}>}
* @extends {TextSourceCodeBase<{LangOptions: MarkdownLanguageOptions, RootNode: Root, SyntaxElementWithLoc: Node, ConfigNode: { value: string; position: SourceLocation }}>}
*/
export class MarkdownSourceCode extends TextSourceCodeBase {
/**
Expand All @@ -147,13 +138,13 @@ export class MarkdownSourceCode extends TextSourceCodeBase {

/**
* Cache of parent nodes.
* @type {WeakMap<MarkdownNode, MarkdownNode>}
* @type {WeakMap<Node, Node>}
*/
#parents = new WeakMap();

/**
* Collection of HTML nodes. Used to find directive comments.
* @type {Array<HTMLNode>}
* @type {Array<Html>}
*/
#htmlNodes = [];

Expand All @@ -165,15 +156,15 @@ export class MarkdownSourceCode extends TextSourceCodeBase {

/**
* The AST of the source code.
* @type {RootNode}
* @type {Root}
*/
ast = undefined;

/**
* Creates a new instance.
* @param {Object} options The options for the instance.
* @param {string} options.text The source code text.
* @param {RootNode} options.ast The root AST node.
* @param {Root} options.ast The root AST node.
*/
constructor({ text, ast }) {
super({ ast, text });
Expand All @@ -185,8 +176,8 @@ export class MarkdownSourceCode extends TextSourceCodeBase {

/**
* Returns the parent of the given node.
* @param {MarkdownNode} node The node to get the parent of.
* @returns {MarkdownNode|undefined} The parent of the node.
* @param {Node} node The node to get the parent of.
* @returns {Node|undefined} The parent of the node.
*/
getParent(node) {
return this.#parents.get(node);
Expand Down
23 changes: 11 additions & 12 deletions src/processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ import { fromMarkdown } from "mdast-util-from-markdown";
// Type Definitions
//-----------------------------------------------------------------------------

/** @typedef {import("./types.ts").Block} Block */
/** @typedef {import("./types.ts").RangeMap} RangeMap */
/** @typedef {import("mdast").Node} Node */
/** @typedef {import("mdast").Parent} ParentNode */
/** @typedef {import("mdast").Code} CodeNode */
/** @typedef {import("mdast").Html} HtmlNode */
/** @typedef {import("eslint").Linter.LintMessage} Message */
/** @typedef {import("eslint").Rule.Fix} Fix */
/** @typedef {import("eslint").AST.Range} Range */
/**
* @import { Node, Parent, Code, Html } from "mdast";
* @import { Linter, Rule, AST } from "eslint";
* @import { Block, RangeMap } from "./types.js";
* @typedef {Linter.LintMessage} Message
* @typedef {Rule.Fix} Fix
* @typedef {AST.Range} Range
*/

//-----------------------------------------------------------------------------
// Helpers
Expand Down Expand Up @@ -53,7 +52,7 @@ function traverse(node, callbacks) {
callbacks["*"]();
}

const parent = /** @type {ParentNode} */ (node);
const parent = /** @type {Parent} */ (node);

if (typeof parent.children !== "undefined") {
for (let i = 0; i < parent.children.length; i++) {
Expand Down Expand Up @@ -291,7 +290,7 @@ function preprocess(sourceText, filename) {

/**
* Visit a code node.
* @param {CodeNode} node The visited node.
* @param {Code} node The visited node.
* @returns {void}
*/
code(node) {
Expand Down Expand Up @@ -320,7 +319,7 @@ function preprocess(sourceText, filename) {

/**
* Visit an HTML node.
* @param {HtmlNode} node The visited node.
* @param {Html} node The visited node.
* @returns {void}
*/
html(node) {
Expand Down
6 changes: 4 additions & 2 deletions src/rules/fenced-code-language.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
//-----------------------------------------------------------------------------

/**
* @typedef {import("../types.ts").MarkdownRuleDefinition<{ RuleOptions: [{ required?: string[]; }]; }>}
* FencedCodeLanguageRuleDefinition
* @import { MarkdownRuleDefinition } from "../types.js";
* @typedef {"missingLanguage" | "disallowedLanguage"} FencedCodeLanguageMessageIds
* @typedef {[{ required?: string[] }]} FencedCodeLanguageOptions
* @typedef {MarkdownRuleDefinition<{ RuleOptions: FencedCodeLanguageOptions, MessageIds: FencedCodeLanguageMessageIds }>} FencedCodeLanguageRuleDefinition
*/

//-----------------------------------------------------------------------------
Expand Down
6 changes: 4 additions & 2 deletions src/rules/heading-increment.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
//-----------------------------------------------------------------------------

/**
* @typedef {import("../types.ts").MarkdownRuleDefinition<{ RuleOptions: []; }>}
* HeadingIncrementRuleDefinition
* @import { MarkdownRuleDefinition } from "../types.js";
* @typedef {"skippedHeading"} HeadingIncrementMessageIds
* @typedef {[]} HeadingIncrementOptions
* @typedef {MarkdownRuleDefinition<{ RuleOptions: HeadingIncrementOptions, MessageIds: HeadingIncrementMessageIds }>} HeadingIncrementRuleDefinition
*/

//-----------------------------------------------------------------------------
Expand Down
16 changes: 7 additions & 9 deletions src/rules/no-bare-urls.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
// Type Definitions
//-----------------------------------------------------------------------------

/** @typedef {import("mdast").Node} Node */
/** @typedef {import("mdast").Paragraph} ParagraphNode */
/** @typedef {import("mdast").Heading} HeadingNode */
/** @typedef {import("mdast").TableCell} TableCellNode */
/** @typedef {import("mdast").Link} LinkNode */
/**
* @typedef {import("../types.ts").MarkdownRuleDefinition<{ RuleOptions: []; }>}
* NoBareUrlsRuleDefinition
* @import { Node, Heading, Paragraph, TableCell, Link } from "mdast";
* @import { MarkdownRuleDefinition } from "../types.js";
* @typedef {"bareUrl"} NoBareUrlsMessageIds
* @typedef {[]} NoBareUrlsOptions
* @typedef {MarkdownRuleDefinition<{ RuleOptions: NoBareUrlsOptions, MessageIds: NoBareUrlsMessageIds }>} NoBareUrlsRuleDefinition
*/

//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -67,14 +65,14 @@ export default {

create(context) {
const { sourceCode } = context;
/** @type {Array<LinkNode>} */
/** @type {Array<Link>} */
const bareUrls = [];

/**
* Finds bare URLs in markdown nodes while handling HTML tags.
* When an HTML tag is found, it looks for its closing tag and skips all nodes
* between them to prevent checking for bare URLs inside HTML content.
* @param {ParagraphNode|HeadingNode|TableCellNode} node The node to process
* @param {Paragraph|Heading|TableCell} node The node to process
* @returns {void}
*/
function findBareUrls(node) {
Expand Down
8 changes: 6 additions & 2 deletions src/rules/no-duplicate-definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
//-----------------------------------------------------------------------------

/**
* @typedef {import("../types.ts").MarkdownRuleDefinition<{ RuleOptions: [{ allowDefinitions: string[], allowFootnoteDefinitions: string[]; }]; }>}
* NoDuplicateDefinitionsRuleDefinition
* @import { MarkdownRuleDefinition } from "../types.js";
* @typedef {"duplicateDefinition" | "duplicateFootnoteDefinition"} NoDuplicateDefinitionsMessageIds
* @typedef {[{ allowDefinitions?: string[], allowFootnoteDefinitions?: string[] }]} NoDuplicateDefinitionsOptions
* @typedef {MarkdownRuleDefinition<{ RuleOptions: NoDuplicateDefinitionsOptions, MessageIds: NoDuplicateDefinitionsMessageIds }>} NoDuplicateDefinitionsRuleDefinition
*/

//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -70,7 +72,9 @@ export default {
context.options[0]?.allowFootnoteDefinitions,
);

/** @type {Set<string>} */
const definitions = new Set();
/** @type {Set<string>} */
const footnoteDefinitions = new Set();

return {
Expand Down
10 changes: 6 additions & 4 deletions src/rules/no-duplicate-headings.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
// Type Definitions
//-----------------------------------------------------------------------------

/** @typedef {import("mdast").Heading} HeadingNode */
/**
* @typedef {import("../types.ts").MarkdownRuleDefinition<{ RuleOptions: [{ checkSiblingsOnly?: boolean; }]; }>}
* NoDuplicateHeadingsRuleDefinition
* @import { Heading } from "mdast";
* @import { MarkdownRuleDefinition } from "../types.js";
* @typedef {"duplicateHeading"} NoDuplicateHeadingsMessageIds
* @typedef {[{ checkSiblingsOnly?: boolean }]} NoDuplicateHeadingsOptions
* @typedef {MarkdownRuleDefinition<{ RuleOptions: NoDuplicateHeadingsOptions, MessageIds: NoDuplicateHeadingsMessageIds }>} NoDuplicateHeadingsRuleDefinition
*/

//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -65,7 +67,7 @@ export default {

/**
* Gets the text of a heading node
* @param {HeadingNode} node The heading node
* @param {Heading} node The heading node
* @returns {string} The heading text
*/
function getHeadingText(node) {
Expand Down
6 changes: 4 additions & 2 deletions src/rules/no-empty-definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
//-----------------------------------------------------------------------------

/**
* @typedef {import("../types.ts").MarkdownRuleDefinition<{ RuleOptions: []; }>}
* NoEmptyDefinitionsRuleDefinition
* @import { MarkdownRuleDefinition } from "../types.js";
* @typedef {"emptyDefinition"} NoEmptyDefinitionsMessageIds
* @typedef {[]} NoEmptyDefinitionsOptions
* @typedef {MarkdownRuleDefinition<{ RuleOptions: NoEmptyDefinitionsOptions, MessageIds: NoEmptyDefinitionsMessageIds }>} NoEmptyDefinitionsRuleDefinition
*/

//-----------------------------------------------------------------------------
Expand Down
6 changes: 4 additions & 2 deletions src/rules/no-empty-images.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
//-----------------------------------------------------------------------------

/**
* @typedef {import("../types.ts").MarkdownRuleDefinition<{ RuleOptions: []; }>}
* NoEmptyImagesRuleDefinition
* @import { MarkdownRuleDefinition } from "../types.js";
* @typedef {"emptyImage"} NoEmptyImagesMessageIds
* @typedef {[]} NoEmptyImagesOptions
* @typedef {MarkdownRuleDefinition<{ RuleOptions: NoEmptyImagesOptions, MessageIds: NoEmptyImagesMessageIds }>} NoEmptyImagesRuleDefinition
*/

//-----------------------------------------------------------------------------
Expand Down
6 changes: 4 additions & 2 deletions src/rules/no-empty-links.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
//-----------------------------------------------------------------------------

/**
* @typedef {import("../types.ts").MarkdownRuleDefinition<{ RuleOptions: []; }>}
* NoEmptyLinksRuleDefinition
* @import { MarkdownRuleDefinition } from "../types.js";
* @typedef {"emptyLink"} NoEmptyLinksMessageIds
* @typedef {[]} NoEmptyLinksOptions
* @typedef {MarkdownRuleDefinition<{ RuleOptions: NoEmptyLinksOptions, MessageIds: NoEmptyLinksMessageIds }>} NoEmptyLinksRuleDefinition
*/

//-----------------------------------------------------------------------------
Expand Down
6 changes: 4 additions & 2 deletions src/rules/no-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ import { findOffsets } from "../util.js";
//-----------------------------------------------------------------------------

/**
* @typedef {import("../types.ts").MarkdownRuleDefinition<{ RuleOptions: [{ allowed?: string[]; }]; }>}
* NoHtmlRuleDefinition
* @import { MarkdownRuleDefinition } from "../types.js";
* @typedef {"disallowedElement"} NoHtmlMessageIds
* @typedef {[{ allowed?: string[] }]} NoHtmlOptions
* @typedef {MarkdownRuleDefinition<{ RuleOptions: NoHtmlOptions, MessageIds: NoHtmlMessageIds }>} NoHtmlRuleDefinition
*/

//-----------------------------------------------------------------------------
Expand Down
Loading