Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Follow-up to #2865971: Use stylelint as opposed to csslint in core. Configure the block-no-empty
to be consistent with https://www.drupal.org/docs/develop/standards/css/css-coding-standards
Proposed resolution
Brief instructions on running stylelint - you'll need npm...
All the commands below take place in DRUPAL_ROOT/core
To install stylelint
npm install
This will install Drupal 8's npm dependencies of which stylelint is one.
To run it on all core css files. Apply this issue's patch and do the following command from DRUPAL_ROOT/core
npm run lint:css
Remaining tasks
User interface changes
None
API changes
None
Comment | File | Size | Author |
---|---|---|---|
#9 | stylelint-block-no-empty-2866800-9.patch | 1.19 KB | BrightBold |
#5 | stylelint-block-no-empty-includes-2865971-41-patch-2866800-5.patch | 41.62 KB | BrightBold |
#4 | stylelint-block-no-empty-2866800-4.patch | 1.22 KB | BrightBold |
Comments
Comment #2
alexpottComment #3
alexpottComment #4
BrightBoldAdded this rule and fixed core CSS so all files now pass.
This patch depends on #2865971-41: Use stylelint as opposed to csslint in core.
Comment #5
BrightBoldThis patch includes #2865971-41: Use stylelint as opposed to csslint in core for testing purposes.
Comment #6
BrightBoldComment #7
BrightBoldNote: I've been updating all these issues to include the relevant passage from the CSS standards in the Problem/Motivation section, but I can't find a mention of this rule there. So I'm making an assumption that we want to disallow empty blocks. We should update the formatting guidelines if so. (Or if I've missed it, someone could add the correct language to the issue text above).
Comment #8
BrightBoldComment #9
BrightBoldRerolled.
Comment #11
joelpittetThank you @BrightBold and @Alexpott. Ran the patch with the lint command and it has no errors, reverted one file to see the error show and it did.
Comment #12
alexpottCommitted e8a584a and pushed to 8.5.x. Thanks!