WordPress / wporg-repo-tools

6 stars 4 forks source link

Configs: Switch to inheriting stylistic rules for stylelint compatibility #32

Open ryelle opened 1 month ago

ryelle commented 1 month ago

In wp-scripts 30.0.0, the stylelint dependency was updated to ^16.8.2. The stylistic rules (e.g., max-line-length) were deprecated in v 15.0, and fully removed in 16.0. They've been moved to a new package @stylistic/stylelint-config, and wp-scripts uses that now to set up the style rules with a new ruleset @wordpress/stylelint-config/scss-stylistic.

This updates our .stylelintrc file to use this new ruleset, and use the @stylistic version of max-line-length.

On a repo with @wordpress/scripts >= 30

Without this PR, you'll see an error:

src/style/style.scss
  1:1  ✖  Unknown rule max-line-length  max-line-length

✖ 1 problem (1 error, 0 warnings)

For repos that are still on older versions of wp-scripts, they should be updated before update:tools is run, otherwise we'll have the inverse issue with the new rule being unknown.