Files
grecia/.stylelintrc.yml
Javi Martín f460d3bc31 Add and apply function-calculation-no-interpolation rule
This stylelint-scss rule is useful because we were inconsistent when
using calc(); sometimes we added interpolation to Sass variables, and
sometimes we didn't. The reason why we originally added interpolation
was that it was necessary until we migrated to Dart Sass in commit
d54971e53. Since then, we can omit the interpolation, which is also what
the Sass documentation recommends [1].

[1] https://sass-lang.com/documentation/values/calculations/
2025-03-05 14:39:16 +01:00

110 lines
4.0 KiB
YAML

customSyntax: postcss-scss
ignoreFiles:
- app/assets/stylesheets/pdf_fonts.scss.erb
- app/assets/stylesheets/print.css
- app/assets/stylesheets/browserslist
- app/assets/stylesheets/fonts.scss
plugins:
- stylelint-order
- stylelint-scss
- "@stylistic/stylelint-plugin"
rules:
at-rule-descriptor-no-unknown: true
at-rule-descriptor-value-no-unknown: true
at-rule-disallowed-list:
- debug
at-rule-no-deprecated: true
at-rule-no-vendor-prefix: true
at-rule-prelude-no-invalid: true
block-no-empty: true
color-hex-length: "short"
color-named: "never"
color-no-invalid-hex: true
custom-property-pattern: "^([a-z][a-z0-9]*)(-[a-z0-9]+)*$"
declaration-property-value-disallowed-list:
border:
- none
function-url-quotes: always
length-zero-no-unit: true
max-nesting-depth: 4
media-feature-name-no-vendor-prefix: true
property-no-unknown: true
property-no-vendor-prefix: true
rule-empty-line-before:
- "always-multi-line"
- ignore:
- after-comment
- first-nested
selector-class-pattern: "^([a-z][a-z0-9]*)(-[a-z0-9]+)*$"
selector-max-compound-selectors: 5
selector-max-id: 0
selector-no-vendor-prefix: true
selector-pseudo-element-colon-notation: "double"
selector-pseudo-element-no-unknown: true
shorthand-property-no-redundant-values: true
value-no-vendor-prefix: true
order/order:
- dollar-variables
- type: at-rule
name: extend
- type: at-rule
name: include
hasBlock: false
- declarations
- type: at-rule
name: include
hasBlock: true
- rules
order/properties-alphabetical-order: true
scss/at-else-closing-brace-space-after: always-intermediate
scss/at-else-empty-line-before: never
scss/at-extend-no-missing-placeholder: true
scss/at-function-pattern: "^(-?[a-z][a-z0-9]*)(-[a-z0-9]+)*$"
scss/at-if-closing-brace-newline-after: always-last-in-chain
scss/at-if-closing-brace-space-after: always-intermediate
scss/at-mixin-no-risky-nesting-selector: true
scss/at-mixin-pattern: "^(-?[a-z][a-z0-9]*)(-[a-z0-9]+)*$"
scss/dollar-variable-colon-space-before: never
scss/dollar-variable-pattern: "^(-?[a-z][a-z0-9]*)(-[a-z0-9]+)*$"
scss/function-calculation-no-interpolation: true
scss/load-no-partial-leading-underscore: true
scss/load-partial-extension: never
scss/no-unused-private-members: true
scss/operator-no-unspaced: true
scss/percent-placeholder-pattern: "^(-?[a-z][a-z0-9]*)(-[a-z0-9]+)*$"
scss/selector-no-redundant-nesting-selector: true
"@stylistic/declaration-bang-space-after": "never"
"@stylistic/declaration-bang-space-before": "always"
"@stylistic/declaration-block-semicolon-newline-after": always-multi-line
"@stylistic/declaration-block-trailing-semicolon": always
"@stylistic/declaration-colon-space-after": always-single-line
"@stylistic/declaration-colon-space-before": never
"@stylistic/function-parentheses-space-inside": never-single-line
"@stylistic/indentation":
- 2
- ignore:
- value
"@stylistic/media-feature-parentheses-space-inside": never
"@stylistic/no-eol-whitespace": true
"@stylistic/no-missing-end-of-source-newline": true
"@stylistic/number-no-trailing-zeros": true
"@stylistic/selector-attribute-brackets-space-inside": never
"@stylistic/selector-pseudo-class-parentheses-space-inside": never
"@stylistic/string-quotes": double
"@stylistic/value-list-comma-space-after": always-single-line
"@stylistic/block-opening-brace-space-before": always
"@stylistic/color-hex-case": "lower"
"@stylistic/number-leading-zero": "always"
"@stylistic/selector-list-comma-newline-after": always
overrides:
- files: app/assets/stylesheets/icons.scss
rules:
at-rule-descriptor-value-no-unknown: null
- files: app/assets/stylesheets/legislation_process.scss
rules:
max-nesting-depth: 8
selector-max-compound-selectors: 8
- files: app/assets/stylesheets/shared/social_share.scss
rules:
selector-class-pattern: "^([a-z][a-z0-9]*)((-|_)[a-z0-9]+)*$"