From 97d6f953ebe410818e4a85096c6da73b08a986a1 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Fri, 20 Sep 2024 17:07:55 +0800 Subject: chore: apply stylelint-order --- .stylelintrc.json | 110 +++++++++++++++++++++++++++++++++++++++++++++++++++++- package.json | 3 +- 2 files changed, 110 insertions(+), 3 deletions(-) diff --git a/.stylelintrc.json b/.stylelintrc.json index 6094e04..029a623 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -1,6 +1,112 @@ { - "extends": ["stylelint-config-standard"], + "extends": [ + "stylelint-config-standard" + ], + "plugins": [ + "stylelint-order" + ], "rules": { - "selector-class-pattern": null + "declaration-empty-line-before": null, + "declaration-block-single-line-max-declarations": 1, + "custom-property-empty-line-before": "never", + "selector-class-pattern": null, + "no-duplicate-selectors": true, + "color-hex-length": "short", + "color-named": "always-where-possible", + "selector-attribute-quotes": "always", + "property-no-vendor-prefix": true, + "value-no-vendor-prefix": true, + "font-family-name-quotes": "always-where-required", + "comment-whitespace-inside": "always", + "comment-empty-line-before": "always", + "at-rule-no-vendor-prefix": true, + "selector-no-vendor-prefix": true, + "order/order": [ + "custom-properties", + "dollar-variables", + "declarations", + "rules", + "at-rules" + ], + "order/properties-order": [ + { + "groupName": "Display & Box Model", + "emptyLineBefore": "always", + "noEmptyLineBetween": true, + "properties": [ + "display", + "overflow", + "box-sizing", + "width", + "height", + "margin", + "padding" + ] + }, + { + "groupName": "Positioning", + "emptyLineBefore": "always", + "noEmptyLineBetween": true, + "properties": [ + "position", + "top", + "right", + "bottom", + "left", + "z-index" + ] + }, + { + "groupName": "Border", + "emptyLineBefore": "always", + "noEmptyLineBetween": true, + "properties": [ + "border", + "border-top", + "border-right", + "border-bottom", + "border-left", + "border-radius" + ] + }, + { + "groupName": "Background", + "emptyLineBefore": "always", + "noEmptyLineBetween": true, + "properties": [ + "background", + "background-color", + "background-image", + "background-repeat", + "background-position" + ] + }, + { + "groupName": "Typography", + "emptyLineBefore": "always", + "noEmptyLineBetween": true, + "properties": [ + "color", + "font-family", + "font-size", + "font-weight", + "line-height", + "text-align", + "text-transform" + ] + }, + { + "groupName": "Misc", + "emptyLineBefore": "always", + "noEmptyLineBetween": true, + "properties": [ + "opacity", + "visibility", + "cursor", + "transition", + "transform" + ] + } + ] } } diff --git a/package.json b/package.json index 865e2a1..3b7142d 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,8 @@ "globals": "^15.9.0", "rollup": "^4.21.3", "stylelint": "^16.9.0", - "stylelint-config-standard": "^36.0.1" + "stylelint-config-standard": "^36.0.1", + "stylelint-order": "^6.0.4" }, "dependencies": { "easymde": "^2.18.0", -- cgit v1.2.3-70-g09d2