textlint
Version:
The pluggable linting tool for natural language.
62 lines • 1.7 kB
TypeScript
import type { TextlintProfileEntry } from "@textlint/kernel";
export type TextlintProfilePhase = {
name: string;
depth: number;
time: number;
percent: number;
count: number;
};
export type TextlintProfileParser = {
id: string;
time: number;
count: number;
};
export type TextlintProfileRule = {
id: string;
type: "rule" | "filter-rule";
time: number;
percent: number;
count: number;
};
export type TextlintProfileFile = {
filePath: string;
time: number;
};
/**
* The summary of `textlint --profile`.
* Times are in milliseconds.
*/
export type TextlintProfileReport = {
total: number;
files: number;
phases: TextlintProfilePhase[];
parsers: TextlintProfileParser[];
rules: TextlintProfileRule[];
slowestFiles: TextlintProfileFile[];
};
/**
* Create the summary from the totals of the profiler
* @param entries the totals of the profiler
* @param options.total the total time of the run
* @param options.files the number of the linted files
*/
export declare const createProfileReport: (entries: TextlintProfileEntry[], options: {
total: number;
files: number;
}) => TextlintProfileReport;
/**
* Format the summary as Markdown
* @param report the summary
* @param options.cwd file paths are shown relative to it
*/
export declare const formatProfileReportAsMarkdown: (report: TextlintProfileReport, options: {
cwd: string;
}) => string;
/**
* Format the summary as JSON.
* File paths are relative to `cwd`, as in Markdown.
*/
export declare const formatProfileReportAsJSON: (report: TextlintProfileReport, options: {
cwd: string;
}) => string;
//# sourceMappingURL=profile-report.d.ts.map