first commit

This commit is contained in:
2026-08-06 12:00:39 +10:00
commit 91221f5a8e
3259 changed files with 569069 additions and 0 deletions
@@ -0,0 +1,96 @@
/**
* Represents an inline config comment in the source code.
*/
export class InlineConfigComment {
/**
* Creates a new instance.
* @param {Object} options The options for the instance.
* @param {string} options.value The comment text.
* @param {Position} options.position The position of the comment in the source code.
*/
constructor({ value, position }: {
value: string;
position: Position;
});
/**
* The comment text.
* @type {string}
*/
value: string;
/**
* The position of the comment in the source code.
* @type {Position}
*/
position: Position;
}
/**
* Markdown Source Code Object
* @extends {TextSourceCodeBase<{LangOptions: MarkdownLanguageOptions, RootNode: Root, SyntaxElementWithLoc: Node, ConfigNode: { value: string; position: Position }}>}
*/
export class MarkdownSourceCode extends TextSourceCodeBase<{
LangOptions: MarkdownLanguageOptions;
RootNode: Root;
SyntaxElementWithLoc: Node;
ConfigNode: {
value: string;
position: Position;
};
}> {
/**
* Creates a new instance.
* @param {Object} options The options for the instance.
* @param {string} options.text The source code text.
* @param {Root} options.ast The root AST node.
*/
constructor({ text, ast }: {
text: string;
ast: Root;
});
/**
* Returns the parent of the given node.
* @param {Node} node The node to get the parent of.
* @returns {Parent|undefined} The parent of the node.
*/
getParent(node: Node): Parent | undefined;
/**
* Returns an array of all inline configuration nodes found in the
* source code.
* @returns {Array<InlineConfigComment>} An array of all inline configuration nodes.
*/
getInlineConfigNodes(): Array<InlineConfigComment>;
/**
* Returns an all directive nodes that enable or disable rules along with any problems
* encountered while parsing the directives.
* @returns {{problems:Array<FileProblem>,directives:Array<Directive>}} Information
* that ESLint needs to further process the directives.
*/
getDisableDirectives(): {
problems: Array<FileProblem>;
directives: Array<Directive>;
};
/**
* Returns inline rule configurations along with any problems
* encountered while parsing the configurations.
* @returns {{problems:Array<FileProblem>,configs:Array<{config:{rules:RulesConfig},loc:Position}>}} Information
* that ESLint needs to further process the rule configurations.
*/
applyInlineConfig(): {
problems: Array<FileProblem>;
configs: Array<{
config: {
rules: RulesConfig;
};
loc: Position;
}>;
};
#private;
}
import type { Position } from "unist";
import type { MarkdownLanguageOptions } from "../types.js";
import type { Root } from "mdast";
import type { Node } from "mdast";
import { TextSourceCodeBase } from "@eslint/plugin-kit";
import type { Parent } from "mdast";
import type { FileProblem } from "@eslint/core";
import { Directive } from "@eslint/plugin-kit";
import type { RulesConfig } from "@eslint/core";