Problem/Motivation
Follow-up to #2865971: Use stylelint as opposed to csslint in core. Configure the number-leading-zero
to be consistent with https://www.drupal.org/docs/develop/standards/css/css-coding-standards
Relevant coding standard from the CSScomb settings for Drupal:
"leading-zero": true,
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 |
---|---|---|---|
#22 | 2866818-22.patch | 30.64 KB | harsha012 |
#17 | 2866818-17.patch | 30.63 KB | harsha012 |
#15 | interdiff-2866818-13-15.txt | 338 bytes | harsha012 |
#15 | 2866818-15.patch | 19.25 KB | harsha012 |
#13 | 2866818-13.patch | 18.86 KB | harsha012 |
Comments
Comment #2
alexpottComment #3
BrightBoldRemoved the
number-leading-zero
rule from.stylelintrc.json
since it matches stylelint-config-standard (per #2866816-9: Update stylelint rule length-zero-no-unit to be consistent with Drupal's CSS standards, thanks idebr) and updated all CSS to pass.This patch relies on #2865971-44: Use stylelint as opposed to csslint in core so won't pass testing until that is committed.
Comment #4
BrightBoldPatch for testing purposes which combines the patch in #1 above, plus the patch from #2865971-44: Use stylelint as opposed to csslint in core.
Comment #5
droplet CreditAttribution: droplet commentedNeeds reroll
Comment #6
BrightBoldComment #7
BrightBoldThis is the same as the patch in #1, which seemed like it still applied so let's re-test with 8.4.
Comment #8
BrightBoldComment #9
BrightBoldComment #10
brahmjeet789 CreditAttribution: brahmjeet789 as a volunteer and at gai Technologies Pvt Ltd commentedHi BrightBold,
i have changed some things in ur patch may be it works .
Comment #12
joelpittetOne more change and outside_in doesn't exist in the same space, this needs a reroll
Comment #13
harsha012 CreditAttribution: harsha012 as a volunteer and at Red Crackle commentedComment #14
joelpittetThanks @harsha012, although the
core/.stylelintrc.json
looks like it got removed from the last patch, could you put it back?Comment #15
harsha012 CreditAttribution: harsha012 as a volunteer and at Red Crackle commentedComment #16
joelpittetLooks like this is conflicting with some of the other CSS commits: needs another reroll.
Comment #17
harsha012 CreditAttribution: harsha012 as a volunteer and at Red Crackle commentedRe -rolled the patch
Comment #18
joelpittetThis looks like it doesn't match the CSSComb rule in the issue summary, I just noticed where we do have a leading 0. I personally find it easier to scan for fractions with a leading 0.
Could I recommend we match the CSSComb, or are there strong feelings for this one? Also it's a big patch but there would be no CSS changes if we turn this to
true
as an added bonus.Comment #19
joelpittetNo big objections, changing to needs work to see if any takers?
Comment #20
harsha012 CreditAttribution: harsha012 as a volunteer and at Red Crackle commented@joelpittet,
Since we are setting rule
"number-leading-zero": true
for adding a leading zero. if we see the css combo setting https://github.com/csscomb/csscomb.js/blob/master/doc/options.md#leading..., to add the leading zero we need to set true. Is there any specific change you are looking incore/.stylelintrc.json
.Please advice.
Comment #21
joelpittetI’m proposing we set it to true and keep the leading 0s
Comment #22
harsha012 CreditAttribution: harsha012 as a volunteer and at Red Crackle commentedfixed as per comment #18,
set the rule
"number-leading-zero": "always"
getting error on setting rule
"number-leading-zero": true
Invalid Option: Invalid option value "true" for rule "number-leading-zero"
Comment #24
joelpittetInteresting that the patches are the same size:) This feels easily bikeshedable, kind of wish I had another person agree with the direction, but for me this RTBC.
Thanks @harsha012, @BrightBold, @brahmjeet789, and @alexpott.
I reviewed with and without the changes running the linter to ensure it's catching everything and used
git diff --color-words
to scan the code changes.Comment #26
joelpittetPutting this back to RTBC. Still applies and the fail looks unrelated.
Comment #27
alexpottLooking at our CSS standards page and existing CSS comb rule this seems reasonable.
Committed and pushed f0272d5fa6 to 8.6.x and c2f2111781 to 8.5.x. Thanks!