mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-11 19:42:23 +08:00
25 lines
679 B
TypeScript
25 lines
679 B
TypeScript
import { LinterOptions, FormatterType, SyntaxType, lint, LintResult, LinterResult } from "stylelint";
|
|
|
|
const options: LinterOptions = {
|
|
code: "div { color: red }",
|
|
files: ["**/**.scss"],
|
|
formatter: "json",
|
|
cache: true,
|
|
cacheLocation: "./stylelint.cache.json",
|
|
ignoreDisables: true,
|
|
reportNeedlessDisables: true,
|
|
ignorePath: true,
|
|
syntax: "scss"
|
|
};
|
|
|
|
lint(options).then((x: LinterResult) => {
|
|
const err: boolean = x.errored;
|
|
const output: string = x.output;
|
|
const postcssResults: any[] = x.postcssResults;
|
|
const results: LintResult[] = x.results;
|
|
});
|
|
|
|
const formatter: FormatterType = "json";
|
|
|
|
const syntax: SyntaxType = "scss";
|