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 number-no-trailing-zeros
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 |
---|---|---|---|
#18 | 2866819-18.patch | 4.62 KB | harsha012 |
#16 | interdiff-2866819-14-16.txt | 324 bytes | harsha012 |
#16 | 2866819-16.patch | 4.92 KB | harsha012 |
#14 | interdiff-2866819-12-14.txt | 307 bytes | harsha012 |
#14 | 2866819-14.patch | 4.54 KB | harsha012 |
Comments
Comment #2
alexpottComment #3
jpassetti CreditAttribution: jpassetti commentedWorking on this at d4d boston sprint.
Comment #4
jpassetti CreditAttribution: jpassetti commentedGetting rid of trailing zeros made sense to me. I removed the no-trailing-zeros rule from .stylelintrc.json file so it would inherit from the base rule set. I fixed all of the issues.
Comment #6
joelpittetRan the core npm with the patch applied and no errors, checked out one of the files to see it fail and it totally did so I know the change is working. Thanks for doing these @jpassetti and @alexpott
Comment #7
alexpottI agree it makes sense... less bytes to send and all. Unfortunately the patch does not apply anymore.
Comment #8
harsha012 CreditAttribution: harsha012 as a volunteer and at Red Crackle commentedre-rolled the patch
Comment #10
harsha012 CreditAttribution: harsha012 as a volunteer and at Red Crackle commentedre-rolled the patch
Comment #11
alexpottI think these changes are out-of-scope.
Comment #12
harsha012 CreditAttribution: harsha012 as a volunteer and at Red Crackle commentedFixed changes as per #11
Comment #13
joelpittetThe change to remove
"length-zero-no-unit": null,
incore/.stylelintrc.json
should not be in this patch, could it be removed please?Comment #14
harsha012 CreditAttribution: harsha012 as a volunteer and at Red Crackle commentedfixed as per comment #14
Comment #15
alexpott@harsha012 the patch in #14 is still missing the removal of the line from core/.stylelintrc.json
Comment #16
harsha012 CreditAttribution: harsha012 as a volunteer and at Red Crackle commentedComment #17
joelpittetThanks @harsha012. There seems to be an unrelated change in there still like @alexpott mentioned in #11.
Since this patch is about trailing 0's these changes to case are not needed.
Very close though!
Comment #18
harsha012 CreditAttribution: harsha012 as a volunteer and at Red Crackle commentedfixed it.
Comment #19
joelpittetThanks @harsha012, @jpassetti, and @alexpott!
It's catching the rule when I test
npm run lint:css
without the changes and the changes pass all tests.I double checked an all the extra changes have been removed.
Comment #20
alexpottCommitted e965387 and pushed to 8.5.x. Thanks!