wikimedia / stylelint-config-wikimedia

CSS/Less Stylelint configuration according to CSS coding conventions for Wikimedia.
https://www.mediawiki.org/wiki/Manual:Coding_conventions/CSS
MIT License
14 stars 9 forks source link

selector-max-id detectes isses even when the lines are disabled inline #114

Closed umherirrender closed 2 years ago

umherirrender commented 4 years ago

When updating stylelint-config-wikimedia 0.5.0 to 0.6.0 npm begins to fail on MinervaNeue skin

I have updated grunt-stylelint to 0.14.0 and the issues remains, so I fault the config here, not stylelint

Running "stylelint:all" (stylelint) task

skinStyles/mediawiki.action.history.styles.less
  2:3  ✖  Expected ".action-history #pagehistory input[ type='radio' ]" to have no more than 0 ID selectors                                                                       selector-max-id
  8:3  ✖  Expected ".action-history #pagehistory input[ type='checkbox' ]" to have no more than 0 ID selectors                                                                    selector-max-id
 13:3  ✖  Expected ".action-history #pagehistory .mw-history-histlinks" to have no more than 0 ID selectors                                                                       selector-max-id
 18:3  ✖  Expected ".action-history #pagehistory .mw-changeslist-date" to have no more than 0 ID selectors                                                                        selector-max-id
 25:3  ✖  Expected ".action-history #pagehistory .history-user" to have no more than 0 ID selectors                                                                               selector-max-id
 31:4  ✖  Expected ".action-history #pagehistory .history-user .mw-userlink" to have no more than 0 ID selectors                                                                  selector-max-id
 39:3  ✖  Expected ".action-history #pagehistory .mw-changeslist-links:not( .mw-usertoollinks ):not( .mw-history-histlinks )" to have no more than 0 ID selectors                 selector-max-id
 41:4  ✖  Expected ".action-history #pagehistory .mw-changeslist-links:not( .mw-usertoollinks ):not( .mw-history-histlinks ) > span:before" to have no more than 0 ID selectors   selector-max-id
 45:4  ✖  Expected ".action-history #pagehistory .mw-changeslist-links:not( .mw-usertoollinks ):not( .mw-history-histlinks ) > span:after" to have no more than 0 ID selectors    selector-max-id
 51:3  ✖  Expected ".action-history #pagehistory .comment" to have no more than 0 ID selectors                                                                                    selector-max-id
 58:3  ✖  Expected ".action-history #pagehistory .comment" to have no more than 0 ID selectors                                                                                    selector-max-id
 58:3  ✖  Expected ".action-history #pagehistory .updatedmarker" to have no more than 0 ID selectors                                                                              selector-max-id
 58:3  ✖  Expected ".action-history #pagehistory .mw-diff-bytes" to have no more than 0 ID selectors                                                                              selector-max-id
 58:3  ✖  Expected ".action-history #pagehistory .mw-tag-markers" to have no more than 0 ID selectors                                                                             selector-max-id
 67:3  ✖  Expected ".action-history #pagehistory .history-user" to have no more than 0 ID selectors                                                                               selector-max-id
 67:3  ✖  Expected ".action-history #pagehistory .comment" to have no more than 0 ID selectors                                                                                    selector-max-id
 67:3  ✖  Expected ".action-history #pagehistory .updatedmarker" to have no more than 0 ID selectors                                                                              selector-max-id
 67:3  ✖  Expected ".action-history #pagehistory .mw-diff-bytes" to have no more than 0 ID selectors                                                                              selector-max-id
 67:3  ✖  Expected ".action-history #pagehistory .mw-history-tools" to have no more than 0 ID selectors                                                                           selector-max-id
 67:3  ✖  Expected ".action-history #pagehistory .mw-tag-markers" to have no more than 0 ID selectors                                                                             selector-max-id
 82:3  ✖  Expected ".action-history #pagehistory li:after" to have no more than 0 ID selectors                                                                                    selector-max-id
 87:3  ✖  Expected ".action-history #pagehistory input[ type='radio' ]" to have no more than 0 ID selectors                                                                       selector-max-id
 87:3  ✖  Expected ".action-history #pagehistory input[ type='checkbox' ]" to have no more than 0 ID selectors                                                                    selector-max-id

skinStyles/mediawiki.special.userlogin.common.styles/minerva.less
 2:2  ✖  Expected ".client-nojs #userloginForm" to have no more than 0 ID selectors                                     selector-max-id
 3:3  ✖  Expected ".client-nojs #userloginForm .mw-htmlform-field-HTMLCheckField" to have no more than 0 ID selectors   selector-max-id

At least the issues in mediawiki.special.userlogin.common.styles/minerva.less are disabled, but it seems stylelint just reports the wrong line:column and both lines are not disabled. When moving the disable comment up to the top of the file, it works. But that seems like a bad workaround https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/skins/MinervaNeue/+/3fab70f8bc4ad0603602fb56bd8456a8d7c83ff2/skinStyles/mediawiki.special.userlogin.common.styles/minerva.less

The issue in mediawiki.action.history.styles.less remains https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/skins/MinervaNeue/+/3fab70f8bc4ad0603602fb56bd8456a8d7c83ff2/skinStyles/mediawiki.action.history.styles.less

It also seems that stylelint cannot show lines with 3 digits (.mw-history-histlinks is in 113 of that file, not 13)

jdforrester commented 4 years ago

Yeah, you can't disable it inline, I believe. Repo-only for some reason.

umherirrender commented 4 years ago

It was moved from repo to inline - https://gerrit.wikimedia.org/r/#/c/mediawiki/skins/MinervaNeue/+/552949/

Volker-E commented 2 years ago

Don't see what would be left to do here. Patch shows part inline, part file specific overrides. Seems fair enough.