Skip to content

Upgrading stylelint 5 to 6

Breaking5.4.0 → 6.9.0Breaking1Deprecated11New52Changed2Fixed80Other1

BreakingUpgrade verdict

1 breaking change.

  • Invalid CSS no longer crashes the run; the syntax problem is reported like a normal warning instead.
  • Two command-line flags and one programming option for pulling styles out of HTML are now deprecated and may be removed later.
  • An old rule name is being retired; use the new name instead.
  • Old property list rule names are being retired; use the new declaration-property names instead.
Top 4 of 12 that need code or config changes

Adds html-tags ^1.1.1, htmlparser2 ^3.9.0, log-symbols ^1.0.2, string-width ^1.0.1, svg-tags ^1.0.0, table ^3.7.8.

Drops is-css-color-name.

Installs 203 packages in all (was 161).

Also installs ajv, ajv-keywords, async-function, async-generator-function, call-bind, call-bind-apply-helpers, call-bound, co, define-data-property, dom-serializer, domelementtype, domhandler, domutils, dunder-proto, entities and 17 more.

Moves ansi-regex 2.1.1 → 2.1.1, 3.0.1, balanced-match 0.3.0, 1.0.2 → 0.4.2, 1.0.2, css-color-names 0.0.2, 0.0.3 → 0.0.3, glob 6.0.4 → 7.2.3, globby 4.1.0 → 5.0.0, is-fullwidth-code-point 1.0.0 → 1.0.0, 2.0.0, isarray 0.0.1 → 0.0.1, 2.0.5, postcss-less 0.8.0 → 0.14.0, postcss-selector-parser 1.3.3, 2.2.3 → 2.2.3, readable-stream 1.0.34, 1.1.14 → 1.0.34, 1.1.14, 3.6.2, specificity 0.1.6 → 0.2.1, string-width 1.0.2 → 1.0.2, 2.1.1, string_decoder 0.10.31 → 0.10.31, 1.3.0, strip-ansi 3.0.1 → 3.0.1, 4.0.0. Your build may pick other versions.

Breaking1
CssSyntaxError is no longer thrown but reported alongside warnings.
CssSyntaxError
Deprecated11
Deprecates the -e and --extract CLI flags and the extractStyleTagsFromHtml node API option.
-e--extractextractStyleTagsFromHtml
Deprecates the number-zero-length-no-unit rule in favor of length-zero-no-unit.
number-zero-length-no-unitlength-zero-no-unit
Deprecates property-*-blacklist and property-*-whitelist in favor of declaration-property-*-blacklist and declaration-property-*-whitelist.
property-*-blacklistproperty-*-whitelistdeclaration-property-*-blacklistdeclaration-property-*-whitelist
Deprecates the -v and --verbose CLI flags in favor of -f verbose or --formatter verbose.
-v--verbose-f--formatter
Deprecates stylelint.util.styleSearch() in favor of the external style-search module.
stylelint.util.styleSearch()style-search
Deprecates the "emptyLineBefore" option for declaration-block-properties-order.
declaration-block-properties-orderemptyLineBefore
Deprecates six quote options for font-family-name-quotes in favor of always-* options plus string-quotes.
font-family-name-quotesstring-quotessingle-where-requiredsingle-where-recommendedsingle-unless-keyworddouble-where-requireddouble-where-recommendeddouble-unless-keyword
Deprecates the "single", "double" and "none" options for function-url-quotes in favor of "always" or "never" plus string-quotes.
function-url-quotesstring-quotessingledoublenone
Deprecates the "hierarchicalSelectors" option for indentation.
indentationhierarchicalSelectors
Deprecates plugin rule names that are not namespaced; only namespaced rule names like your-namespace/your-rule-name are supported.
Deprecates stylelint.utils.cssWordIsVariable() because non-standard syntax utils are now defensive.
stylelint.utils.cssWordIsVariable()