Problem/Motivation

stylelint released a new major version (https://github.com/stylelint/stylelint/releases/tag/16.0.1).

Related:

stylelint-config-standard followed suit. (https://github.com/stylelint/stylelint-config-standard/releases/tag/35.0.0)
stylelint-order only bumped a minor version (https://github.com/hudochenkov/stylelint-order/releases/tag/6.0.4)

Steps to reproduce

$ yarn outdated

Proposed resolution

Remaining tasks

_If_ we can and want to ship this with drupal 10.2.0, I think we need to decide if we want to wait on stylelint-formatter-gitlab to be stylelint:^16-ready, in order to keep our nice code-quality overview in GitLab or (temporarily) go back to the situation before #3387503: Move Gitlab linting steps to main job where CSS linting failures are reported as test-failures.

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3407211

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Spokje created an issue. See original summary.

spokje’s picture

Issue summary: View changes
spokje’s picture

Title: Update stylelint(-config-standard) to latest version (major bump) » Update stylelint(-config-standard) to latest versions (major bump)
Issue summary: View changes

spokje’s picture

Issue summary: View changes
spokje’s picture

Issue summary: View changes
spokje’s picture

Issue summary: View changes
spokje’s picture

Status: Active » Needs review

So the current state of the MR uses stylelint-junit-formatter.
I also opened https://gitlab.com/leon0399/stylelint-formatter-gitlab/-/issues/3 to try and get stylelint-formatter-gitlab working with stylelint 16 and upwards.

Putting this on NR the get some input on:
- if we want to try and get this into 10.2.0
- if so, are we prepared to (temporarily) fallback to using stylelint-junit-formatter and going back to test-errors instead of codequality.

smustgrave’s picture

The rules being removed does prettier automatically catch those now?

spokje’s picture

The rules being removed does prettier automatically catch those now?

Not quite, but good question.

- stylelint has loads of rules, but enables none of them by default.
- stylelint-config-standard enables a bunch of them with some community-defined, sane defaults

Drupal uses a lot of those stylelint-config-standard rules, but overrules some of them with other defaults, and disables others.

The latter one is of interest here: When there's a "[rule-name]": null defined in core/.stylelintrc.json, it _should_ mean stylelint-config-standard-enabled rule, Drupal turns it off. See https://stylelint.io/user-guide/configure/#rules, first bullet-point. (More on the _should_ below).

The rules that are removed in this issue (function-whitespace-after and max-line-length), were both defined as null, so were turned off in Drupal, so no need for replacement.

Now to the _should_: Turns out during all updates of stylelint and stylelint-config-standard we didn't pay much attention to rules that were dropped at some point from stylelint-config-standard but still being turned off in our core/.stylelintrc.json.
Turning things off that aren't on in the first place is just silly.

Opened #3408129: Sync up core/.stylelintrc.json and stylelint-config-standard to get core/.stylelintrc.json, stylelint and stylelint-config-standard back into sync.

TLDR; There's no need to do anything with the deleted rules in this issue, Drupal wasn't using them.
Thanks for asking though, since it made me dive in deeper and found some cruft to remove in a follow-up issue :)

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for explaining!

longwave’s picture

Title: Update stylelint(-config-standard) to latest versions (major bump) » [PP-upstream] Update stylelint(-config-standard) to latest versions (major bump)
Status: Reviewed & tested by the community » Postponed

Thank you for explaining the changes in #10.

As this breaks our current CI integration because stylelint-formatter-gitlab is not yet compatible, I think we should hold off on committing this for a while - there are no pressing changes here and to me this can wait until 10.3.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.