All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
3.0.0 (2023-08-17)
- Update stylelint to v15 (#28).
- Update all config dependencies to their latest releases, compatible with stylelint v15 (#28).
- Remove dependency on
stylelint-config-prettier
, which is no longer needed with stylelint v15 (#28). - Change enforced rules from
stylelint-config-standard
, including 10 new rules (see list below) (#28).
The configuration now mandates stylelint v15, and no longer uses stylelint-config-prettier
. Stylelint has stopped enforcing formatting-related rules, which are no longer relevant with the majority of projects now using Prettier for formatting. See Stylelint’s official Migrating to 15.0.0 documentation.
The configuration also switches from stylelint-config-standard
to stylelint-config-standard-scss
, which more correctly disables CSS-only rules and replaces them with SCSS-aware rules.
Newly enforced rules:
import-notation
- Specify string or URL notation for @import rules.
- Set to:
string
keyframe-block-no-duplicate-selectors
- Disallow duplicate selectors within keyframe blocks.
- Set to:
true
keyframe-selector-notation
- Specify keyword or percentage notation for keyframe selectors.
- Set to:
percentage-unless-within-keyword-only-block
selector-anb-no-unmatchable
- Disallow unmatchable An+B selectors.
- Set to:
true
selector-attribute-quotes
- Require or disallow quotes for attribute values.
- Set to:
always
scss/at-if-no-null
- Check for equality to null is unnecessarily explicit since null is falsey in Sass.
- Set to:
true
scss/at-import-no-partial-leading-underscore
- Disallow leading underscore in partial names in @import.
- Set to:
true
scss/at-import-partial-extension
- Require or disallow extension in @import commands.
- Set to:
never
scss/declaration-nested-properties-no-divided-groups
- Disallow nested properties of the same "namespace" be divided into multiple groups.
- Set to:
true
scss/no-duplicate-mixins
- Disallow duplicate mixins within a stylesheet.
- Set to:
true
New rules which have been explicitly disabled:
annotation-no-unknown
- Disallow unknown annotations.
- Set to: disabled (rather than
true
)
selector-not-notation
- Specify simple or complex notation for :not() pseudo-class selectors.
- Set to: disabled (rather than
complex
, syntax from Selectors Level 4)
media-feature-range-notation
- Specify context or prefix notation for media feature ranges.
- Set to: disabled (rather than
context
, syntax from Media Queries Level 4)
at-rule-empty-line-before
- Require or disallow an empty line before at-rules.
- Set to: disabled (rather than
always except first-nested, blockless-after-blockless; ignore after-comment; ignoreAtRules else
)
scss/at-extend-no-missing-placeholder
- Disallow at-extends (@extend) with missing placeholders.
- Set to: disabled (rather than
true
)
scss/at-function-pattern
- Specify a pattern for Sass/SCSS-like function names.
- Set to: disabled (rather than "kebab-case")
scss/dollar-variable-pattern
- Specify a pattern for Sass-like variables.
- Set to: disabled (rather than "kebab-case")
scss/dollar-variable-empty-line-before
- Require an empty line or disallow empty lines before $-variable declarations.
- Set to: disabled (rather than
true
)
scss/double-slash-comment-empty-line-before
- Require or disallow an empty line before //-comments.
- Set to: disabled (rather than
true
)
scss/no-global-function-names
- Disallows the use of global function names, as these global functions are now located inside built-in Sass modules.
- Set to: disabled (rather than
true
)
Rules which have been replaced by a Sass-specific equivalent:
comment-no-empty
(replaced withscss/comment-no-empty
)function-no-unknown
(replaced withscss/function-no-unknown
)
New formatting rules which are enforced:
scss/at-if-closing-brace-newline-after
: always-last-in-chainscss/at-if-closing-brace-space-after
: always-intermediatescss/at-else-closing-brace-newline-after
: always-last-in-chainscss/at-else-closing-brace-space-after
: always-intermediatescss/at-else-empty-line-before
: neverscss/at-else-if-parentheses-space-before
: alwaysscss/at-function-parentheses-space-before
: neverscss/at-mixin-parentheses-space-before
: neverscss/at-rule-conditional-no-parentheses
: truescss/dollar-variable-colon-space-after
: alwaysscss/dollar-variable-colon-space-before
: neverscss/double-slash-comment-whitespace-inside
: alwaysscss/function-quote-no-quoted-strings-inside
: truescss/function-unquote-no-unquoted-strings-inside
: truescss/operator-no-newline-after
: truescss/operator-no-newline-before
: truescss/operator-no-unspaced
: true
Formatting rules which are no longer enforced:
number-leading-zero
at-rule-empty-line-before
at-rule-name-case
at-rule-name-newline-after
at-rule-name-space-after
at-rule-semicolon-newline-after
at-rule-semicolon-space-before
block-opening-brace-newline-after
block-opening-brace-newline-before
block-opening-brace-space-after
block-opening-brace-space-before
block-closing-brace-empty-line-before
block-closing-brace-newline-after
block-closing-brace-newline-before
block-closing-brace-space-after
block-closing-brace-space-before
color-hex-case
declaration-bang-space-after
declaration-bang-space-before
declaration-block-semicolon-newline-after
declaration-block-semicolon-newline-before
declaration-block-semicolon-space-after
declaration-block-semicolon-space-before
declaration-block-trailing-semicolon
declaration-colon-newline-after
declaration-colon-space-after
declaration-colon-space-before
function-comma-newline-after
function-comma-newline-before
function-comma-space-after
function-comma-space-before
function-max-empty-lines
function-whitespace-after
indentation
linebreaks
max-empty-lines
max-line-length
media-feature-colon-space-after
media-feature-colon-space-before
media-feature-name-case
media-feature-parentheses-space-inside
media-feature-range-operator-space-after
media-feature-range-operator-space-before
media-query-list-comma-newline-after
media-query-list-comma-newline-before
media-query-list-comma-space-after
media-query-list-comma-space-before
no-empty-first-line
no-eol-whitespace
no-extra-semicolons
no-missing-end-of-source-newline
number-no-trailing-zeros
property-case
selector-attribute-brackets-space-inside
selector-attribute-operator-space-after
selector-attribute-operator-space-before
selector-attribute-quotes
selector-combinator-space-after
selector-combinator-space-before
selector-descendant-combinator-no-non-space
selector-list-comma-newline-after
selector-list-comma-newline-before
selector-list-comma-space-after
selector-list-comma-space-before
selector-max-empty-lines
selector-pseudo-class-parentheses-space-inside
selector-pseudo-element-case
selector-pseudo-class-case
string-quotes
unicode-bom
unit-case
value-list-comma-newline-after
value-list-comma-newline-before
value-list-comma-space-after
value-list-comma-space-before
value-list-max-empty-lines
2.0.3 (2023-08-17)
Disables the following rules introduced in Stylelint 14 & related package updates, to make it simpler for projects to upgrade to Stylelint 14:
declaration-block-no-redundant-longhand-properties
selector-id-pattern
shorthand-property-no-redundant-values
2.0.2 (2023-08-17)
Disables the following rules introduced in Stylelint 14 & related package updates, to make it simpler for projects to upgrade to Stylelint 14:
keyframes-name-pattern
:^(a-za-z0-9*)(-a-z0-9+)*$, message: Expected keyframe name to be kebab-case
alpha-value-notation
:percentage, exceptProperties: opacity
color-function-notation
:modern
custom-media-pattern
:^(a-za-z0-9*)(-a-z0-9+)*$, message: Expected custom media query name to be kebab-case
custom-property-pattern
:^(a-za-z0-9*)(-a-z0-9+)*$, message: Expected custom property name to be kebab-case
2.0.1 (2023-08-17)
- Add explicit support for Sass/SCSS syntax
2.0.0 (2023-08-17)
- Update stylelint to v14 for compatibility with PostCSS v8 (#13).
- Update all config dependencies to their latest releases, compatible with stylelint v14 (#13).
- Remove
stylelint-a11y
, which is no longer maintained and does not support stylelint v14.no-text-align-justify
has been replaced withdeclaration-property-value-disallowed-list
(#13). - Stop enforcing
function-calc-no-invalid
, which has been removed from stylelint (#13) - Change enforced rules from stylelint-config-standard and stylelint-config-prettier.
The configuration now mandates stylelint v14, doesn’t use stylelint-a11y
, and follows changes in enforced rules from stylelint-config-standard
and stylelint-config-prettier
.
No longer enforced (all formatting related):
at-rule-name-space-after
declaration-bang-space-after
declaration-bang-space-before
media-feature-colon-space-after
media-feature-colon-space-before
media-feature-parentheses-space-inside
selector-attribute-brackets-space-inside
selector-attribute-operator-space-after
selector-attribute-operator-space-before
selector-pseudo-class-parentheses-space-inside
No longer enforced (from stylelint-a11y
):
a11y/no-obsolete-attribute
a11y/no-obsolete-element
a11y/no-outline-none
Newly enforced rules:
alpha-value-notation
:percentage, exceptProperties: opacity
color-function-notation
:modern
custom-media-pattern
:^(a-za-z0-9*)(-a-z0-9+)*$, message: Expected custom media query name to be kebab-case
custom-property-pattern
:^(a-za-z0-9*)(-a-z0-9+)*$, message: Expected custom property name to be kebab-case
declaration-block-no-redundant-longhand-properties
font-family-name-quotes
:always-where-recommended
function-url-quotes
:always
hue-degree-notation
:angle
keyframes-name-pattern
:^(a-za-z0-9*)(-a-z0-9+)*$, message: Expected keyframe name to be kebab-case
no-irregular-whitespace
number-max-precision
:4
rule-empty-line-before
:always-multi-line, except: first-nested, ignore: after-comment
selector-id-pattern
:^(a-za-z0-9*)(-a-z0-9+)*$, message: Expected id selector to be kebab-case
shorthand-property-no-redundant-values
custom-property-no-missing-var-function
declaration-block-no-duplicate-custom-properties
1.1.1 (2023-05-11)
- Ignore system colors with
declaration-strict-value
, and unset keyword.
1.1.0 (2022-06-25)
- Add new at-rule-no-unknown rules for tailwind (#21).
1.0.0 (2020-11-10)
- Update stylelint to v13 (#9).
- Update all config dependencies to their latest releases, compatible with stylelint v13 (#9).
- Enforce
value-keyword-case
from stylelint v13 (#9). - Rename all deprecated stylelint rules to their newer alternatives.
- The config’s README documentation now links directly to rules’ documentation for plugins.
The configuration now mandates stylelint v13, and additionally enforces value-keyword-case
.
Here are recommended steps:
# 1. Install the new versions.
npm install --save-dev stylelint@13 stylelint-config-torchbox@^1.0.0
# 2. Attempt to auto-fix any new issue picked up by Stylelint.
npm run lint:css -- --fix
npm run format
# 3. Check if there are remaining issues
npm run lint:css
If there are remaining issues, consider a gradual approach: whether you want to update the code, or disable the corresponding rules. This can be done either in the Stylelint configuration, or via stylelint-disable
configuration comments. Get the rules reporting issues with: npm run lint:js -- --formatter tap | grep ruleId | cut -d ':' -f 2 | cut -c 2- | sort | uniq
. For projects strapped for time, disabling all new rules listed above may be a reasonable tradeoff.
0.5.0 (2019-10-10)
- Stop enforcing
a11y/content-property-no-static-value
, which feels too restrictive for projects already following best practices.
- Fix
scale-unlimited/declaration-strict-value
being applied twice tobackground-color
declarations.
Projects considering this release should skip straight to v1.0.0.
0.4.0 (2019-10-08)
- Enforce accessibility-related rules with stylelint-a11y (#2, #3).
- Enforce usage of variables for colors with stylelint-declaration-strict-value (#2, #4).
- Enforce "hyphenated BEM" nomenclature for class names with
selector-class-pattern
(#1, #5). - Enforce "hyphenated lowercase" nomenclature for mixins with
scss/at-mixin-pattern
(#1, #5).
- Most if not all of the rules changes in this release are breaking changes. Expect breakage on every minor release until the config reaches v1.0.0.
Projects considering this release should skip straight to v1.0.0.
0.3.0 (2019-09-23)
- Stop enforcing order of rules and at-rules in declarations.
- Most if not all of the rules changes in this release are breaking changes. Expect breakage on every minor release until the config reaches v1.0.0.
Projects considering this release should skip straight to v1.0.0.
0.2.0 (2019-09-23)
- Enforce ordering of declaration blocks with stylelint-order.
- Allow using more usage of types in selectors with selector-max-type options.
- Enforce
number-leading-zero
: always - Stop enforcing
scss/media-feature-value-dollar-variable
:always
- Most if not all of the rules changes in this release are breaking changes. Expect breakage on every minor release until the config reaches v1.0.0.
Projects considering this release should skip straight to v1.0.0.
0.1.0 (2019-08-30)
First release