Stylelint lints CSS, SCSS, etc.
The default IDE arrangement feature fails to arrange properties within nested at-rules and SCSS at-rules. The "order/properties-order" rule ensures consistent arrangement except for custom properties.npm i -D stylelint postcss-scss stylelint-scss stylelint-order
import type { Config } from "stylelint";
export default {
customSyntax: "postcss-scss",
plugins: ["stylelint-scss", "stylelint-order"],
rules: {
"order/properties-order": [
[
"color-scheme",
"content",
"display",
"flex-flow",
"flex-direction",
"flex-wrap",
"grid",
"grid-template",
"grid-template-rows",
"grid-template-columns",
"grid-template-areas",
"grid-auto-rows",
"grid-auto-columns",
"grid-auto-flow",
"place-content",
"align-content",
"justify-content",
"place-items",
"align-items",
"justify-items",
"gap",
"row-gap",
"column-gap",
"order",
"flex",
"flex-grow",
"flex-shrink",
"flex-basis",
"grid-area",
"grid-row",
"grid-row-start",
"grid-row-end",
"grid-column",
"grid-column-start",
"grid-column-end",
"place-self",
"align-self",
"justify-self",
"container",
"container-name",
"container-type",
"contain",
"contain-intrinsic-size",
"contain-intrinsic-width",
"contain-intrinsic-height",
"table-layout",
"caption-side",
"border-collapse",
"border-spacing",
"empty-cells",
"list-style",
"list-style-type",
"list-style-position",
"list-style-image",
"position",
"inset",
"top",
"right",
"bottom",
"left",
"z-index",
"float",
"clear",
"content-visibility",
"visibility",
"opacity",
"page",
"break-after",
"box-sizing",
"box-shadow",
"box-decoration-break",
"margin",
"margin-top",
"margin-right",
"margin-bottom",
"margin-left",
"outline",
"outline-width",
"outline-style",
"outline-color",
"outline-offset",
"border",
"border-width",
"border-style",
"border-color",
"border-top",
"border-top-width",
"border-top-style",
"border-top-color",
"border-right",
"border-right-width",
"border-right-style",
"border-right-color",
"border-bottom",
"border-bottom-width",
"border-bottom-style",
"border-bottom-color",
"border-left",
"border-left-width",
"border-left-style",
"border-left-color",
"border-radius",
"border-top-left-radius",
"border-top-right-radius",
"border-bottom-right-radius",
"border-bottom-left-radius",
"border-image",
"border-image-source",
"border-image-slice",
"border-image-width",
"border-image-outset",
"border-image-repeat",
"padding",
"padding-top",
"padding-right",
"padding-bottom",
"padding-left",
"width",
"min-width",
"max-width",
"height",
"min-height",
"max-height",
"overflow",
"overflow-x",
"overflow-y",
"overflow-inline",
"overflow-block",
"overflow-clip-margin",
"text-overflow",
"scroll-behavior",
"scroll-snap-type",
"scroll-padding",
"scroll-padding-top",
"scroll-padding-right",
"scroll-padding-bottom",
"scroll-padding-left",
"scroll-snap-align",
"scroll-margin",
"scroll-margin-top",
"scroll-margin-right",
"scroll-margin-bottom",
"scroll-margin-left",
"scroll-snap-stop",
"scroll-timeline",
"scroll-timeline-name",
"scroll-timeline-axis",
"view-timeline",
"view-timeline-name",
"view-timeline-axis",
"view-timeline-inset",
"overscroll-behavior",
"overscroll-behavior-x",
"overscroll-behavior-y",
"scrollbar-width",
"scrollbar-color",
"scrollbar-gutter",
"resize",
"background",
"background-image",
"background-position",
"background-position-x",
"background-position-y",
"background-size",
"background-repeat",
"background-origin",
"background-clip",
"background-attachment",
"background-color",
"mix-blend-mode",
"filter",
"clip-path",
"shape-outside",
"object-fit",
"object-position",
"text-shadow",
"text-decoration",
"text-decoration-line",
"text-decoration-color",
"text-decoration-style",
"text-decoration-thickness",
"text-emphasis",
"text-emphasis-style",
"text-emphasis-color",
"text-emphasis-position",
"text-transform",
"color",
"font",
"font-style",
"font-variant",
"font-weight",
"font-stretch",
"font-size",
"font-size-adjust",
"line-height",
"font-family",
"font-variation-settings",
"direction",
"unicode-bidi",
"writing-mode",
"text-align",
"text-align-last",
"vertical-align",
"text-indent",
"white-space",
"word-spacing",
"letter-spacing",
"word-break",
"overflow-wrap",
"translate",
"rotate",
"scale",
"zoom",
"transform",
"transform-box",
"transform-origin",
"transform-style",
"perspective",
"perspective-origin",
"backface-visibility",
"animation",
"animation-duration",
"animation-delay",
"animation-timing-function",
"animation-iteration-count",
"animation-direction",
"animation-fill-mode",
"animation-play-state",
"animation-timeline",
"animation-name",
"animation-range",
"animation-range-start",
"animation-range-end",
"timeline-scope",
"transition",
"transition-property",
"transition-duration",
"transition-delay",
"transition-timing-function",
"transition-behavior",
"cursor",
"pointer-events",
"user-select",
],
{
unspecified: "bottom",
emptyLineBeforeUnspecified: "always",
},
],
},
} satisfies Config;