Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295807

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

$
0
0

Problem/Motivation

Stylelint updated to 15 #3344087: Update Stylelint and Prettier for Drupal 10.1 and use Prettier for formatting PostCSS

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

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


Viewing all articles
Browse latest Browse all 295807

Trending Articles