Skip to content

Commit

Permalink
ci(lint): fix config
Browse files Browse the repository at this point in the history
  • Loading branch information
nekowinston committed Nov 15, 2023
1 parent 5cc6e1c commit 2c8e296
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 4 deletions.
53 changes: 53 additions & 0 deletions src/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions src/lint/stylelint.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { deepMerge } from "std/collections/mod.ts";

import stylelint from "npm:stylelint";
import stylelintConfigStandard from "npm:stylelint-config-standard";
import stylelintConfigRecommended from "npm:stylelint-config-recommended";
import postcssLess from "npm:postcss-less";

const config = {
...stylelintConfigRecommended,
...{ ...stylelintConfigStandard, extends: {} },
const config: stylelint.Config = {
customSyntax: postcssLess,
rules: {
"selector-class-pattern": null,
Expand Down Expand Up @@ -127,4 +127,13 @@ const config = {
},
};

export const lint = (code: string) => stylelint.lint({ config, code });
const base = deepMerge(
stylelintConfigRecommended,
{ ...stylelintConfigStandard, extends: {} },
);

export const lint = (code: string) =>
stylelint.lint({
config: deepMerge(base, config),
code,
});

0 comments on commit 2c8e296

Please sign in to comment.