mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-04 12:11:47 +00:00
feat(stylelint): create Type for formatter and syntax
This commit is contained in:
Vendored
+6
-2
@@ -3,6 +3,10 @@
|
||||
// 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;
|
||||
@@ -11,11 +15,11 @@ export interface LinterOptions {
|
||||
configFile?: string;
|
||||
configOverrides?: JSON;
|
||||
files?: string | string[];
|
||||
formatter?: "json" | "string" | "verbose";
|
||||
formatter?: FormatterType;
|
||||
ignoreDisables?: boolean;
|
||||
reportNeedlessDisables?: boolean;
|
||||
ignorePath?: boolean;
|
||||
syntax?: "scss" | "less" | "sugarss";
|
||||
syntax?: SyntaxType;
|
||||
customSyntax?: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { LinterOptions, lint, LintResult, LinterResult } from "stylelint";
|
||||
import { LinterOptions, FormatterType, SyntaxType, lint, LintResult, LinterResult } from "stylelint";
|
||||
|
||||
const options: LinterOptions = {
|
||||
code: "div { color: red }",
|
||||
@@ -16,3 +16,7 @@ lint(options).then((x: LinterResult) => {
|
||||
const postcssResults: any[] = x.postcssResults;
|
||||
const results: LintResult[] = x.results;
|
||||
});
|
||||
|
||||
const formatter: FormatterType = "json";
|
||||
|
||||
const syntax: SyntaxType = "scss";
|
||||
|
||||
Reference in New Issue
Block a user