prettylint
Version:
Run Prettier as a linter
59 lines (58 loc) • 1.53 kB
TypeScript
import { FormatResult } from "./vendor/format.js";
export interface LintResult {
/**
* The absolute path to the file that was linted.
*/
filePath: string;
/**
* An array of message objects. See below for more info about messages.
*/
messages: LintMessage[];
/**
* The number of errors for the given file.
*/
errorCount: number;
/**
* The number of warnings for the given file.
*/
warningCount: number;
/**
* The source code for the given file. This property is omitted if this file has no errors/warnings or if the `output` property is present.
*/
source: string;
/**
* The source code for the given file with as many fixes applied as possible. This property is omitted if no fix is available.
*/
output?: string;
}
export declare const enum LintSeverity {
Warning = 1,
Error = 2
}
export interface LintMessage {
/**
* the id of the rule that produced the error or warning.
*/
ruleId: string;
/**
* the severity of the failure, 1 for warnings and 2 for errors.
*/
severity: LintSeverity;
/**
* the human readable description of the error.
*/
message: string;
/**
* the line where the issue is located.
*/
line: number;
/**
* the column where the issue is located.
*/
column: number;
/**
* the type of the node in the AST
*/
nodeType: string;
}
export declare function lint(result: FormatResult): LintResult;