fix(lib,scripts): import locally for linting, snapshot tests, dev server (#2172)
Co-authored-by: WalkQuackBack <[email protected]>
This commit is contained in:
1 parent
dc1fac9639
commit
acd47ee987
8 files changed
+302
-18
No files matched your search
@@ -12,17 +12,13 @@ export async function runStylelint(
|
||||
content: string,
|
||||
fix: boolean,
|
||||
config: stylelint.Config,
|
||||
) {
|
||||
): Promise<string | undefined> {
|
||||
const { results, code } = await stylelint.lint({
|
||||
code: content,
|
||||
config,
|
||||
fix,
|
||||
});
|
||||
|
||||
if (code) {
|
||||
Deno.writeTextFileSync(file, code);
|
||||
}
|
||||
|
||||
for (const result of results) {
|
||||
for (const warning of result.warnings) {
|
||||
// Some cleanup for fancier logging - dims the rule name.
|
||||
@@ -43,4 +39,6 @@ export async function runStylelint(
|
||||
|
||||
if (result.warnings.length > 0) throw new Error("stylelint error");
|
||||
}
|
||||
|
||||
return code;
|
||||
}
|
||||
Reference in new issue
Block a user