Configure postcss formatting after stylelint and stylelint-config-standard update

Created on 15 December 2023, 9 months ago
Updated 2 May 2024, 4 months ago

Problem/Motivation

Stylelint updated to 15 📌 Update Stylelint and Prettier for Drupal 10.1 and use Prettier for formatting PostCSS Fixed

But seems we ignore its `Significant changes`:

https://stylelint.io/migration-guide/to-15#significant-changes

Now stylelint only cares about `Code-quality rules` and never cares about `Formatting rules`

That formatting rules removed from our base config
`Removed: 64 rules deprecated in stylelint@15.0.0. For details, see the migration guide.`
https://github.com/stylelint/stylelint-config-standard/blob/main/CHANGEL...

More info: https://prettier.io/docs/en/comparison

Steps to reproduce

Put any bad formatted postcss into any core pipeline and it pass all checkings

Or open claro/css/components/tables.pcss.css and just save file

Proposed resolution

Use https://github.com/prettier/stylelint-prettier

3 MRs here

1. `proof-of-failures ` explains that after upgrade we don't have formatting errors reported. I downgraded stylelint and stylelintconfig and got pipeline reports about formatting errors which younger than 14-15 stylelint upgrade (UPD + new max-line-length recently removed)

2. `success-on-anything` explains why this ticket is major. Right now any unformatted postcss can appears in core without pipeline reports

3. `3409048-postcss-file-formatting` Fix MR. With stylelint-prettier.
One commit for review config fixes. And other to check what formatter errors it fixes.

Criteria for adding dependencies

1. Maintainership of the package:
Well maintained https://github.com/prettier/stylelint-prettier/activity by existing in core prettier https://github.com/prettier

2. Security policies of the package:
stylelint-prettier has not any reported security issues to date. The library is well documented.

3. Expected release and support cycles:
Looks like 6 month between 2 latest versions.

4. Code quality:
The codebase of stylelint-prettier is well written, well documented.

5. Other dependencies it would add:
stylelint-prettier has one dependency from same maintainer https://github.com/prettier/prettier-linter-helpers and it is already presented in our yarn.lock

🐛 Bug report
Status

Fixed

Version

10.3

Component
CSS 

Last updated 1 day ago

Created by

🇷🇸Serbia finnsky

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024