Skip to content

Latest commit

 

History

History
80 lines (55 loc) · 3.12 KB

to-15.md

File metadata and controls

80 lines (55 loc) · 3.12 KB

Migrating to 15.0.0

This release contains significant and breaking changes that will help us modernize our code so that Stylelint remains free of security issues.

Significant change

We deprecated most of the rules that enforce stylistic conventions. You should remove these rules from your configuration object.

We recommend:

Stylelint and pretty printers are complementary tools that work together to help you write consistent and error-free code. To help facilitate this, we've removed the deprecated rules from the latest version of our standard config. You can extend the config using:

{
+ "extends": ["stylelint-config-standard"],
  "rules" { .. }
}

Our standard config turns on many of the other rules that enforce conventions, e.g. most of the *-notation, *-pattern and *-quotes rules. We recommend adding more of the rules that enforce conventions to your config as many of them will be specific to your needs, e.g. what units you allow in your code.

For example, you can:

Additionally, you may no longer need to extend Prettier's Stylelint config as there should be no conflicting rules:

{
- "extends": ["stylelint-config-prettier"],
  "rules" { .. }
}

If you want to continue using Stylelint to enforce stylistic consistency, you can migrate the deprecated rules you need to a plugin. We will remove the rules from Stylelint in the next major release.

Breaking changes

Three breaking changes may also affect you:

  • removed support for Node.js 12
  • removed support for processors
  • changed overrides.extends behavior

Removed support for Node.js 12

You should use the following or higher versions of Node.js:

  • 14.13.1
  • 16.0.0

Removed support for processors

You should use a custom syntax instead.

Changed overrides.extends behavior

To be consistent with the overrides.plugins, overrides.extends will merge rather than replace.

If you would like to keep the previous behavior, you should change your config to:

{
- "extends": ["config-a"],
  "overrides": [
    {
      "rules": ["*.module.css"],
      "extends": ["config-b"]
    },
+   {
+     "rules": ["*.css"],
+     "extends": ["config-a"]
+   }
  ]
}