Skip to content

Stylelint Config


Terminal window
npm i --save-dev stylelint @archoleat/stylelint-config-extended-scss @double-great/stylelint-a11y stylelint-config-prettier-scss stylelint-config-recommended-scss stylelint-config-sass-guidelines stylelint-config-standard stylelint-config-standard-scss stylelint-config-tailwindcss stylelint-declaration-block-no-ignored-properties stylelint-declaration-strict-value stylelint-group-selectors stylelint-plugin-defensive-css stylelint-prettier stylelint-scss stylelint-use-nesting stylelint-config-astro
Terminal window
cat > .stylelintrc.json <<EOF
{
"configBasedir": ".",
"extends": [
"@double-great/stylelint-a11y/recommended",
"@archoleat/stylelint-config-extended-scss",
"stylelint-config-standard",
"stylelint-prettier/recommended",
"stylelint-config-standard-scss",
"stylelint-config-prettier-scss",
"stylelint-config-sass-guidelines",
"stylelint-config-recommended-scss",
"stylelint-config-astro",
"stylelint-config-tailwindcss"
],
"plugins": [
"@double-great/stylelint-a11y",
"stylelint-declaration-strict-value",
"stylelint-declaration-block-no-ignored-properties",
"stylelint-prettier",
"stylelint-scss",
"stylelint-plugin-defensive-css"
],
"rules": {
"@stylistic/block-opening-brace-space-before": null,
"@stylistic/color-hex-case": "lower",
"@stylistic/declaration-block-semicolon-space-before": null,
"@stylistic/declaration-colon-space-after": null,
"@stylistic/function-comma-newline-after": "always-multi-line",
"@stylistic/function-comma-space-after": null,
"@stylistic/function-max-empty-lines": 0,
"@stylistic/function-parentheses-newline-inside": null,
"@stylistic/function-parentheses-space-inside": null,
"@stylistic/function-whitespace-after": "always",
"@stylistic/indentation": null,
"@stylistic/max-empty-lines": 1,
"@stylistic/media-feature-parentheses-space-inside": null,
"@stylistic/number-leading-zero": "always",
"@stylistic/number-no-trailing-zeros": true,
"@stylistic/selector-attribute-brackets-space-inside": null,
"@stylistic/selector-combinator-space-before": null,
"@stylistic/selector-descendant-combinator-no-non-space": null,
"@stylistic/string-quotes": "single",
"@stylistic/unit-case": "lower",
"@stylistic/value-list-comma-newline-after": null,
"a11y/content-property-no-static-value": true,
"a11y/font-size-is-readable": true,
"a11y/line-height-is-vertical-rhythmed": null,
"a11y/media-prefers-color-scheme": null,
"a11y/media-prefers-reduced-motion": null,
"a11y/no-display-none": true,
"a11y/no-obsolete-attribute": true,
"a11y/no-obsolete-element": true,
"a11y/no-outline-none": true,
"a11y/no-spread-text": true,
"a11y/no-text-align-justify": true,
"a11y/selector-pseudo-class-focus": true,
"alpha-value-notation": "number",
"at-rule-allowed-list": null,
"at-rule-descriptor-no-unknown": [
true,
{
"ignore": ["font-optical-sizing"]
}
],
"at-rule-disallowed-list": null,
"at-rule-empty-line-before": null,
"at-rule-no-deprecated": null,
"at-rule-no-unknown": null,
"at-rule-no-vendor-prefix": null,
"at-rule-property-required-list": null,
"block-no-empty": true,
"color-function-notation": null,
"color-hex-alpha": null,
"color-hex-length": "short",
"color-named": "never",
"color-no-hex": null,
"color-no-invalid-hex": true,
"comment-empty-line-before": null,
"comment-no-empty": true,
"comment-pattern": "^\\s*",
"comment-whitespace-inside": "always",
"comment-word-disallowed-list": null,
"custom-media-pattern": [
"^(--([a-z]+-)*breakpoint-[a-z]+|\\$breakpoint-[a-z]+)$",
{
"severity": "warning"
}
],
"custom-property-empty-line-before": null,
"custom-property-no-missing-var-function": true,
"custom-property-pattern": null,
"declaration-block-no-duplicate-custom-properties": true,
"declaration-block-no-duplicate-properties": [
true,
{
"ignore": ["consecutive-duplicates-with-different-values"]
}
],
"declaration-block-no-redundant-longhand-properties": true,
"declaration-block-no-shorthand-property-overrides": true,
"declaration-block-single-line-max-declarations": null,
"declaration-empty-line-before": null,
"declaration-no-important": null,
"declaration-property-value-no-unknown": null,
"font-family-name-quotes": "always-unless-keyword",
"font-family-no-duplicate-names": true,
"font-family-no-missing-generic-family-keyword": true,
"font-weight-notation": "numeric",
"function-calc-no-unspaced-operator": true,
"function-linear-gradient-no-nonstandard-direction": true,
"function-name-case": null,
"function-no-unknown": null,
"function-url-no-scheme-relative": true,
"function-url-quotes": "always",
"hue-degree-notation": "number",
"import-notation": null,
"keyframe-block-no-duplicate-selectors": true,
"keyframe-declaration-no-important": true,
"keyframe-selector-notation": null,
"keyframes-name-pattern": null,
"length-zero-no-unit": true,
"lightness-notation": "number",
"max-nesting-depth": null,
"media-feature-name-no-unknown": null,
"media-feature-name-no-vendor-prefix": true,
"media-feature-name-value-no-unknown": true,
"media-feature-range-notation": "prefix",
"media-query-no-invalid": null,
"named-grid-areas-no-invalid": true,
"no-descending-specificity": null,
"no-duplicate-at-import-rules": true,
"no-duplicate-selectors": true,
"no-empty-source": true,
"no-invalid-double-slash-comments": true,
"no-invalid-position-at-import-rule": true,
"no-irregular-whitespace": true,
"no-unknown-animations": null,
"no-unknown-custom-media": true,
"no-unknown-custom-properties": null,
"order/order": [
"dollar-variables",
"custom-properties",
{
"name": "include",
"type": "at-rule"
},
{
"name": "extend",
"type": "at-rule"
},
"declarations",
{
"selector": "^&",
"type": "rule"
},
"rules",
{
"name": "media",
"type": "at-rule"
},
{
"name": "supports",
"type": "at-rule"
}
],
"order/properties-order": [
{
"groupName": "Positioning",
"properties": ["position", "top", "right", "bottom", "left", "z-index", "transform", "transform-origin"]
},
{
"groupName": "Display & Box Model",
"properties": [
"display",
"flex",
"flex-basis",
"flex-direction",
"flex-flow",
"flex-grow",
"flex-shrink",
"flex-wrap",
"gap",
"grid",
"grid-area",
"grid-auto-rows",
"grid-auto-columns",
"grid-auto-flow",
"grid-gap",
"grid-row",
"grid-row-start",
"grid-row-end",
"grid-column",
"grid-column-start",
"grid-column-end",
"grid-template",
"grid-template-areas",
"grid-template-rows",
"grid-template-columns",
"box-sizing",
"width",
"min-width",
"max-width",
"height",
"min-height",
"max-height",
"margin",
"margin-top",
"margin-right",
"margin-bottom",
"margin-left",
"padding",
"padding-top",
"padding-right",
"padding-bottom",
"padding-left",
"border",
"border-width",
"border-style",
"border-color",
"border-top",
"border-right",
"border-bottom",
"border-left",
"border-radius"
]
},
{
"groupName": "Typography",
"properties": [
"color",
"font",
"font-family",
"font-size",
"font-style",
"font-weight",
"font-variant",
"font-size-adjust",
"font-stretch",
"font-effect",
"font-emphasize",
"font-emphasize-position",
"font-emphasize-style",
"font-smooth",
"line-height",
"letter-spacing",
"text-align",
"text-decoration",
"text-indent",
"text-justify",
"text-outline",
"text-overflow",
"text-overflow-ellipsis",
"text-overflow-mode",
"text-rendering",
"text-shadow",
"text-transform",
"text-wrap",
"word-wrap",
"word-break",
"word-spacing",
"overflow-wrap",
"white-space",
"vertical-align"
]
},
{
"groupName": "Visual",
"properties": [
"background",
"background-color",
"background-image",
"background-repeat",
"background-position",
"background-size",
"box-shadow",
"opacity",
"visibility",
"cursor",
"pointer-events"
]
},
{
"groupName": "Animation",
"properties": [
"transition",
"transition-delay",
"transition-timing-function",
"transition-duration",
"transition-property",
"animation",
"animation-name",
"animation-duration",
"animation-play-state",
"animation-timing-function",
"animation-delay",
"animation-iteration-count",
"animation-direction"
]
}
],
"plugin/declaration-block-no-ignored-properties": true,
"plugin/stylelint-group-selectors": null,
"plugin/use-defensive-css": [
true,
{
"accidental-hover": null,
"background-repeat": true,
"content-for-empty-links": true,
"custom-property-fallbacks": null,
"flex-direction-column-gap": true,
"flex-direction-row-gap": true,
"flex-wrapping": true,
"https-for-urls": true,
"no-background-repeat": true,
"no-border-for-outlines": true,
"no-shadow-for-outlines": true,
"no-z-index-integer": true,
"property-validation": true,
"scroll-chaining": true,
"scroll-margin-for-scrolled-elements": true,
"scrollbar-gutter": true,
"vendor-prefix-grouping": true
}
],
"plugin/use-logical-properties-and-values": null,
"plugin/use-logical-units": null,
"prettier/prettier": true,
"property-no-unknown": true,
"property-no-vendor-prefix": null,
"rem-over-px/rem-over-px": null,
"rule-empty-line-before": [
"always",
{
"except": ["first-nested"],
"ignore": ["after-comment"]
}
],
"scss/at-extend-no-missing-placeholder": null,
"scss/at-function-pattern": null,
"scss/at-mixin-argumentless-call-parentheses": null,
"scss/at-mixin-pattern": null,
"scss/at-rule-no-unknown": null,
"scss/comment-no-empty": null,
"scss/comment-no-loud": null,
"scss/dollar-variable-colon-space-after": null,
"scss/dollar-variable-empty-line-after": null,
"scss/dollar-variable-no-missing-interpolation": null,
"scss/dollar-variable-pattern": null,
"scss/double-slash-comment-empty-line-before": null,
"scss/double-slash-comment-inline": null,
"scss/function-color-relative": null,
"scss/function-no-unknown": null,
"scss/media-feature-value-dollar-variable": null,
"scss/no-global-function-names": null,
"scss/operator-no-newline-after": null,
"scss/operator-no-unspaced": null,
"scss/partial-no-import": null,
"scss/percent-placeholder-pattern": null,
"scss/selector-no-redundant-nesting-selector": true,
"selector-anb-no-unmatchable": true,
"selector-attribute-quotes": "always",
"selector-class-pattern": null,
"selector-id-pattern": null,
"selector-max-combinators": null,
"selector-max-compound-selectors": null,
"selector-max-id": null,
"selector-no-qualifying-type": null,
"selector-no-vendor-prefix": null,
"selector-pseudo-class-no-unknown": true,
"selector-pseudo-element-no-unknown": true,
"selector-type-no-unknown": true,
"shorthand-property-no-redundant-values": true,
"string-no-newline": true,
"time-min-milliseconds": null,
"unit-no-unknown": true,
"value-keyword-case": null,
"value-no-vendor-prefix": null
}
}
EOF

Terminal window
cat > .stylelintignore <<EOF
**/*.min.css
**/*.min.css.map
assets/scss/output.scss
assets/scss/output.css
**/*.html
dist
dist/
**/*.jsonc
**/*.json
**/*.js
**/*.hbs
node_modules
node_modules/
_Other
_Other/
public
public/
EOF