59 lines
2 KiB
TypeScript
Executable file
59 lines
2 KiB
TypeScript
Executable file
import { Array as FxArray, pipe } from "effect";
|
|
import type stylelint from "stylelint";
|
|
import { propertyGroups } from "stylelint-config-clean-order";
|
|
|
|
/**
|
|
* Définition d'un groupe de Propriétés _CSS_ du plugin `stylelint-config-clean-order` pour _Stylelint_.
|
|
*/
|
|
type StylelintConfigCleanOrderPropertyGroup = {
|
|
emptyLineBefore: "never" | "threshold";
|
|
noEmptyLineBetween: boolean;
|
|
properties: ReadonlyArray<string> | string;
|
|
};
|
|
|
|
const ordreProprietes: ReadonlyArray<StylelintConfigCleanOrderPropertyGroup> = pipe(
|
|
Array.from(propertyGroups),
|
|
FxArray.map((properties: ReadonlyArray<string>) => ({
|
|
emptyLineBefore: "never",
|
|
noEmptyLineBetween: true,
|
|
properties,
|
|
})),
|
|
);
|
|
|
|
const stylelintConfig: stylelint.Config = {
|
|
extends: ["stylelint-config-standard-scss", "stylelint-config-sass-guidelines", "stylelint-config-clean-order"],
|
|
plugins: ["stylelint-declaration-block-no-ignored-properties"],
|
|
rules: {
|
|
"@stylistic/function-parentheses-space-inside": undefined,
|
|
"@stylistic/selector-list-comma-newline-after": undefined,
|
|
"@stylistic/string-quotes": undefined,
|
|
"custom-property-pattern": undefined,
|
|
"declaration-block-no-duplicate-custom-properties": true,
|
|
"declaration-block-no-duplicate-properties": true,
|
|
"declaration-block-no-redundant-longhand-properties": true,
|
|
"declaration-block-no-shorthand-property-overrides": true,
|
|
"max-nesting-depth": undefined,
|
|
"no-descending-specificity": undefined,
|
|
"no-duplicate-selectors": [
|
|
true,
|
|
{
|
|
disallowInList: false,
|
|
},
|
|
],
|
|
"order/properties-order": [
|
|
ordreProprietes,
|
|
{
|
|
severity: "error",
|
|
unspecified: "bottomAlphabetical",
|
|
},
|
|
],
|
|
"plugin/declaration-block-no-ignored-properties": true,
|
|
"selector-class-pattern": undefined,
|
|
"selector-id-pattern": undefined,
|
|
"selector-max-compound-selectors": undefined,
|
|
"selector-max-id": undefined,
|
|
"selector-no-qualifying-type": undefined,
|
|
},
|
|
};
|
|
|
|
export default stylelintConfig;
|