feat(stylelint): create Type for formatter and syntax

This commit is contained in:
Alan Agius
2017-03-26 08:42:18 +02:00
parent bb7d6b2d08
commit 40d95a701d
2 changed files with 11 additions and 3 deletions
+6 -2
View File
@@ -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;
}
+5 -1
View File
@@ -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";