mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-30 18:43:21 +08:00
52 lines
1.4 KiB
TypeScript
52 lines
1.4 KiB
TypeScript
// Type definitions for stylelint 7.11
|
|
// Project: https://github.com/stylelint/stylelint
|
|
// Definitions by: Alan Agius <https://github.com/alan-agius4>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
export type FormatterType = "json" | "string" | "verbose";
|
|
|
|
export type SyntaxType = "scss" | "less" | "sugarss";
|
|
|
|
export interface LinterOptions {
|
|
code?: string;
|
|
codeFilename?: string;
|
|
config?: JSON;
|
|
configBasedir?: string;
|
|
configFile?: string;
|
|
configOverrides?: JSON;
|
|
cache?: boolean;
|
|
cacheLocation?: string;
|
|
files?: string | string[];
|
|
fix?: boolean;
|
|
formatter?: FormatterType;
|
|
ignoreDisables?: boolean;
|
|
reportNeedlessDisables?: boolean;
|
|
ignorePath?: boolean;
|
|
syntax?: SyntaxType;
|
|
customSyntax?: string;
|
|
}
|
|
|
|
export interface LinterResult {
|
|
errored: boolean;
|
|
output: string;
|
|
postcssResults: any[];
|
|
results: LintResult[];
|
|
}
|
|
|
|
export interface LintResult {
|
|
source: string;
|
|
errored: boolean | undefined;
|
|
ignored: boolean | undefined;
|
|
warnings: string[];
|
|
deprecations: string[];
|
|
invalidOptionWarnings: any[];
|
|
}
|
|
|
|
export namespace formatters {
|
|
function json(results: LintResult[]): string;
|
|
function string(results: LintResult[]): string;
|
|
function verbose(results: LintResult[]): string;
|
|
}
|
|
|
|
export function lint(options?: LinterOptions): Promise<LinterResult>;
|