From: Ed Sanders Date: Fri, 27 Oct 2017 12:31:41 +0000 (+0100) Subject: build: Update stylelint X-Git-Tag: 1.31.0-rc.0~1658^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=10644263276ab941b19d2365e16813bd57e9d1f5 build: Update stylelint Change-Id: I5a0ccb26a54109e641fd121c6427a71e82e05c74 --- diff --git a/.stylelintrc.json b/.stylelintrc.json index 27e289d430..60c8f36d48 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -3,6 +3,6 @@ "rules": { "no-descending-specificity": null, - "selector-no-id": null + "selector-max-id": null } } diff --git a/Gruntfile.js b/Gruntfile.js index dbbfcb814e..d1ef72f270 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -62,9 +62,6 @@ module.exports = function ( grunt ) { installer: 'includes/installer/i18n/' }, stylelint: { - options: { - syntax: 'less' - }, src: '{resources/src,mw-config}/**/*.{css,less}' }, watch: { diff --git a/package.json b/package.json index c30e150257..8ff77d8cb3 100644 --- a/package.json +++ b/package.json @@ -26,8 +26,8 @@ "karma-qunit": "1.2.1", "nodemw": "0.10.1", "qunitjs": "2.4.0", - "stylelint": "7.8.0", - "stylelint-config-wikimedia": "0.4.1", + "stylelint": "8.2.0", + "stylelint-config-wikimedia": "0.4.2", "wdio-junit-reporter": "0.2.0", "wdio-mocha-framework": "0.5.8", "wdio-sauce-service": "^0.3.1", diff --git a/resources/src/mediawiki.action/mediawiki.action.history.css b/resources/src/mediawiki.action/mediawiki.action.history.css index f3ea1639eb..520917a40c 100644 --- a/resources/src/mediawiki.action/mediawiki.action.history.css +++ b/resources/src/mediawiki.action/mediawiki.action.history.css @@ -1,6 +1,6 @@ /* Styles for the JavaScript enhancements of the history page */ -#pagehistory li.before input[name='oldid'], -#pagehistory li.after input[name='diff'] { +#pagehistory li.before input[ name='oldid' ], +#pagehistory li.after input[ name='diff' ] { visibility: hidden; } diff --git a/resources/src/mediawiki.legacy/commonPrint.css b/resources/src/mediawiki.legacy/commonPrint.css index 8ff0634207..6931c7d724 100644 --- a/resources/src/mediawiki.legacy/commonPrint.css +++ b/resources/src/mediawiki.legacy/commonPrint.css @@ -77,8 +77,8 @@ a.stub { } /* Expand protocol-relative URLs for printing */ -.mw-body-content a.external.text[href^='//']:after, -.mw-body-content a.external.autonumber[href^='//']:after { +.mw-body-content a.external.text[ href^='//' ]:after, +.mw-body-content a.external.autonumber[ href^='//' ]:after { content: ' (https:' attr( href ) ')'; } diff --git a/resources/src/mediawiki.legacy/shared.css b/resources/src/mediawiki.legacy/shared.css index 74233d6375..ecdfb6161d 100644 --- a/resources/src/mediawiki.legacy/shared.css +++ b/resources/src/mediawiki.legacy/shared.css @@ -56,36 +56,36 @@ wbr { /* Input types that should follow user direction, like buttons */ /* TODO: What about buttons in wikipage content ? */ -input[type='submit'], -input[type='button'], -input[type='reset'], -input[type='file'] { +input[ type='submit' ], +input[ type='button' ], +input[ type='reset' ], +input[ type='file' ] { direction: ltr; } /* Override default values */ -textarea[dir='ltr'], -input[dir='ltr'] { +textarea[ dir='ltr' ], +input[ dir='ltr' ] { /* @noflip */ direction: ltr; } -textarea[dir='rtl'], -input[dir='rtl'] { +textarea[ dir='rtl' ], +input[ dir='rtl' ] { /* @noflip */ direction: rtl; } /* Default style for semantic tags */ -abbr[title], -.explain[title] { +abbr[ title ], +.explain[ title ] { border-bottom: 1px dotted; cursor: help; } @supports ( text-decoration: underline dotted ) { - abbr[title], - .explain[title] { + abbr[ title ], + .explain[ title ] { border-bottom: 0; text-decoration: underline dotted; } diff --git a/resources/src/mediawiki.less/mediawiki.ui/mixins.less b/resources/src/mediawiki.less/mediawiki.ui/mixins.less index 505aa61012..1e078bd6f2 100644 --- a/resources/src/mediawiki.less/mediawiki.ui/mixins.less +++ b/resources/src/mediawiki.less/mediawiki.ui/mixins.less @@ -17,8 +17,8 @@ line-height: normal; font-weight: normal; - & > input[type='checkbox'], - & > input[type='radio'] { + & > input[ type='checkbox' ], + & > input[ type='radio' ] { width: auto; height: auto; margin: 0 0.1em 0 0; diff --git a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less index f3d81b7638..790e01584e 100644 --- a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less +++ b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less @@ -55,9 +55,9 @@ // work if the rules are inside the above widget LESS scope .highlight-changesListWrapperWidget( @bgcolor ) { .mw-rcfilters-ui-changesListWrapperWidget li&, - .mw-rcfilters-ui-changesListWrapperWidget & tr:first-child, - .mw-rcfilters-ui-changesListWrapperWidget tr&.mw-rcfilters-ui-changesListWrapperWidget-enhanced-toplevel:not(.mw-rcfilters-ui-changesListWrapperWidget-enhanced-grey) td:not( :nth-child( -n+2 ) ), - .mw-rcfilters-ui-changesListWrapperWidget tr&.mw-rcfilters-ui-changesListWrapperWidget-enhanced-nested:not(.mw-rcfilters-ui-changesListWrapperWidget-enhanced-grey) td:not( :nth-child( -n+4 ) ) { + .mw-rcfilters-ui-changesListWrapperWidget & tr:first-child, + .mw-rcfilters-ui-changesListWrapperWidget tr&.mw-rcfilters-ui-changesListWrapperWidget-enhanced-toplevel:not( .mw-rcfilters-ui-changesListWrapperWidget-enhanced-grey ) td:not( :nth-child( -n+2 ) ), + .mw-rcfilters-ui-changesListWrapperWidget tr&.mw-rcfilters-ui-changesListWrapperWidget-enhanced-nested:not( .mw-rcfilters-ui-changesListWrapperWidget-enhanced-grey ) td:not( :nth-child( -n+4 ) ) { background-color: @bgcolor; } } diff --git a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.highlightCircles.seenunseen.less b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.highlightCircles.seenunseen.less index deaee284aa..5f6fbea2fb 100644 --- a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.highlightCircles.seenunseen.less +++ b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.highlightCircles.seenunseen.less @@ -21,7 +21,7 @@ .mw-rcfilters-mixin-circle( @highlight-none, @result-circle-diameter, 0, true, @highlight-grey, true ); } - .mw-rcfilters-ui-changesListWrapperWidget:not(.mw-rcfilters-ui-changesListWrapperWidget-highlighted) & { + .mw-rcfilters-ui-changesListWrapperWidget:not( .mw-rcfilters-ui-changesListWrapperWidget-highlighted ) & { .mw-rcfilters-mixin-circle( @highlight-none, @result-circle-diameter, 0, true, @highlight-bluedot, true ); } } @@ -31,7 +31,7 @@ .mw-rcfilters-mixin-circle( @highlight-grey, @result-circle-diameter, 0, true, @highlight-grey ); } - .mw-rcfilters-ui-changesListWrapperWidget:not(.mw-rcfilters-ui-changesListWrapperWidget-highlighted) & { + .mw-rcfilters-ui-changesListWrapperWidget:not( .mw-rcfilters-ui-changesListWrapperWidget-highlighted ) & { .mw-rcfilters-mixin-circle( @highlight-bluedot, @result-circle-diameter, 0, true, @highlight-bluedot ); } } diff --git a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.TagItemWidget.less b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.TagItemWidget.less index 0e7a635db6..e9c982a86c 100644 --- a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.TagItemWidget.less +++ b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.TagItemWidget.less @@ -58,23 +58,23 @@ top: 50%; } - &[data-color='c1']:before { + &[ data-color='c1' ]:before { .mw-rcfilters-mixin-circle( @highlight-c1, 10px, ~'-5px 0.5em 0 0' ); } - &[data-color='c2']:before { + &[ data-color='c2' ]:before { .mw-rcfilters-mixin-circle( @highlight-c2, 10px, ~'-5px 0.5em 0 0' ); } - &[data-color='c3']:before { + &[ data-color='c3' ]:before { .mw-rcfilters-mixin-circle( @highlight-c3, 10px, ~'-5px 0.5em 0 0' ); } - &[data-color='c4']:before { + &[ data-color='c4' ]:before { .mw-rcfilters-mixin-circle( @highlight-c4, 10px, ~'-5px 0.5em 0 0' ); } - &[data-color='c5']:before { + &[ data-color='c5' ]:before { .mw-rcfilters-mixin-circle( @highlight-c5, 10px, ~'-5px 0.5em 0 0' ); } } diff --git a/resources/src/mediawiki.skinning/content.externallinks.css b/resources/src/mediawiki.skinning/content.externallinks.css index cd674ef92e..2a64aa3075 100644 --- a/resources/src/mediawiki.skinning/content.externallinks.css +++ b/resources/src/mediawiki.skinning/content.externallinks.css @@ -19,7 +19,7 @@ padding-right: 15px; } -.mw-body-content a.external[href^='mailto:'], +.mw-body-content a.external[ href^='mailto:' ], .link-mailto { background: url( images/mail.png ) center right no-repeat; /* @embed */ @@ -27,7 +27,7 @@ padding-right: 15px; } -.mw-body-content a.external[href^='ftp://'], +.mw-body-content a.external[ href^='ftp://' ], .link-ftp { background: url( images/ftp-ltr.png ) center right no-repeat; /* @embed */ @@ -35,8 +35,8 @@ padding-right: 15px; } -.mw-body-content a.external[href^='irc://'], -.mw-body-content a.external[href^='ircs://'], +.mw-body-content a.external[ href^='irc://' ], +.mw-body-content a.external[ href^='ircs://' ], .link-irc { background: url( images/chat-ltr.png ) center right no-repeat; /* @embed */ @@ -44,18 +44,18 @@ padding-right: 15px; } -.mw-body-content a.external[href$='.ogg'], -.mw-body-content a.external[href$='.OGG'], -.mw-body-content a.external[href$='.mid'], -.mw-body-content a.external[href$='.MID'], -.mw-body-content a.external[href$='.midi'], -.mw-body-content a.external[href$='.MIDI'], -.mw-body-content a.external[href$='.mp3'], -.mw-body-content a.external[href$='.MP3'], -.mw-body-content a.external[href$='.wav'], -.mw-body-content a.external[href$='.WAV'], -.mw-body-content a.external[href$='.wma'], -.mw-body-content a.external[href$='.WMA'], +.mw-body-content a.external[ href$='.ogg' ], +.mw-body-content a.external[ href$='.OGG' ], +.mw-body-content a.external[ href$='.mid' ], +.mw-body-content a.external[ href$='.MID' ], +.mw-body-content a.external[ href$='.midi' ], +.mw-body-content a.external[ href$='.MIDI' ], +.mw-body-content a.external[ href$='.mp3' ], +.mw-body-content a.external[ href$='.MP3' ], +.mw-body-content a.external[ href$='.wav' ], +.mw-body-content a.external[ href$='.WAV' ], +.mw-body-content a.external[ href$='.wma' ], +.mw-body-content a.external[ href$='.WMA' ], .link-audio { background: url( images/audio-ltr.png ) center right no-repeat; /* @embed */ @@ -63,14 +63,14 @@ padding-right: 15px; } -.mw-body-content a.external[href$='.ogm'], -.mw-body-content a.external[href$='.OGM'], -.mw-body-content a.external[href$='.avi'], -.mw-body-content a.external[href$='.AVI'], -.mw-body-content a.external[href$='.mpeg'], -.mw-body-content a.external[href$='.MPEG'], -.mw-body-content a.external[href$='.mpg'], -.mw-body-content a.external[href$='.MPG'], +.mw-body-content a.external[ href$='.ogm' ], +.mw-body-content a.external[ href$='.OGM' ], +.mw-body-content a.external[ href$='.avi' ], +.mw-body-content a.external[ href$='.AVI' ], +.mw-body-content a.external[ href$='.mpeg' ], +.mw-body-content a.external[ href$='.MPEG' ], +.mw-body-content a.external[ href$='.mpg' ], +.mw-body-content a.external[ href$='.MPG' ], .link-video { background: url( images/video.png ) center right no-repeat; /* @embed */ @@ -78,12 +78,12 @@ padding-right: 15px; } -.mw-body-content a.external[href$='.pdf'], -.mw-body-content a.external[href$='.PDF'], -.mw-body-content a.external[href*='.pdf#'], -.mw-body-content a.external[href*='.PDF#'], -.mw-body-content a.external[href*='.pdf?'], -.mw-body-content a.external[href*='.PDF?'], +.mw-body-content a.external[ href$='.pdf' ], +.mw-body-content a.external[ href$='.PDF' ], +.mw-body-content a.external[ href*='.pdf#' ], +.mw-body-content a.external[ href*='.PDF#' ], +.mw-body-content a.external[ href*='.pdf?' ], +.mw-body-content a.external[ href*='.PDF?' ], .link-document { background: url( images/document-ltr.png ) center right no-repeat; /* @embed */ diff --git a/resources/src/mediawiki.skinning/content.parsoid.less b/resources/src/mediawiki.skinning/content.parsoid.less index 654b65550c..a36ba6ce6d 100644 --- a/resources/src/mediawiki.skinning/content.parsoid.less +++ b/resources/src/mediawiki.skinning/content.parsoid.less @@ -44,9 +44,9 @@ sub { /** * Block media items */ -figure[typeof*='mw:Image'], -figure[typeof*='mw:Video'], -figure[typeof*='mw:Audio'] { +figure[ typeof*='mw:Image' ], +figure[ typeof*='mw:Video' ], +figure[ typeof*='mw:Audio' ] { margin: 0; a { @@ -91,12 +91,12 @@ figure[typeof*='mw:Audio'] { } } -figure[typeof~='mw:Image/Thumb'], -figure[typeof~='mw:Video/Thumb'], -figure[typeof~='mw:Audio/Thumb'], -figure[typeof~='mw:Image/Frame'], -figure[typeof~='mw:Video/Frame'], -figure[typeof~='mw:Audio/Frame'] { +figure[ typeof~='mw:Image/Thumb' ], +figure[ typeof~='mw:Video/Thumb' ], +figure[ typeof~='mw:Audio/Thumb' ], +figure[ typeof~='mw:Image/Frame' ], +figure[ typeof~='mw:Video/Frame' ], +figure[ typeof~='mw:Audio/Frame' ] { display: table; text-align: center; border: 1px solid #c8ccd1; @@ -139,9 +139,9 @@ figure[typeof~='mw:Audio/Frame'] { } } -figure[typeof*='mw:Image/Thumb'], -figure[typeof*='mw:Video/Thumb'], -figure[typeof*='mw:Audio/Thumb'] { +figure[ typeof*='mw:Image/Thumb' ], +figure[ typeof*='mw:Video/Thumb' ], +figure[ typeof*='mw:Audio/Thumb' ] { > a:after { content: ''; width: 15px; diff --git a/resources/src/mediawiki.skinning/elements.css b/resources/src/mediawiki.skinning/elements.css index 245fb53f38..366c5a940b 100644 --- a/resources/src/mediawiki.skinning/elements.css +++ b/resources/src/mediawiki.skinning/elements.css @@ -13,7 +13,7 @@ a { background: none; } -a:not( [href] ) { +a:not( [ href ] ) { cursor: pointer; /* Always cursor:pointer even without href */ } diff --git a/resources/src/mediawiki.special/mediawiki.special.comparepages.styles.less b/resources/src/mediawiki.special/mediawiki.special.comparepages.styles.less index c951169d31..87b7a8b7cb 100644 --- a/resources/src/mediawiki.special/mediawiki.special.comparepages.styles.less +++ b/resources/src/mediawiki.special/mediawiki.special.comparepages.styles.less @@ -10,7 +10,7 @@ .box-sizing( border-box ); } -.mw-special-ComparePages .oo-ui-layout.oo-ui-panelLayout.oo-ui-panelLayout-padded.oo-ui-panelLayout-framed:nth-of-type(2) { +.mw-special-ComparePages .oo-ui-layout.oo-ui-panelLayout.oo-ui-panelLayout-padded.oo-ui-panelLayout-framed:nth-of-type( 2 ) { margin-left: 2%; } diff --git a/resources/src/mediawiki.ui/components/checkbox.less b/resources/src/mediawiki.ui/components/checkbox.less index c1626db610..0c13daf8b1 100644 --- a/resources/src/mediawiki.ui/components/checkbox.less +++ b/resources/src/mediawiki.ui/components/checkbox.less @@ -49,7 +49,7 @@ vertical-align: middle; } - [type='checkbox'] { + [ type='checkbox' ] { display: table-cell; position: relative; // Ensure the invisible input takes up the required `width` & `height` diff --git a/resources/src/mediawiki.ui/components/forms.less b/resources/src/mediawiki.ui/components/forms.less index d3c76d09d0..0a9023e923 100644 --- a/resources/src/mediawiki.ui/components/forms.less +++ b/resources/src/mediawiki.ui/components/forms.less @@ -66,7 +66,7 @@ } // Override input styling just for checkboxes and radio inputs. - input[type='radio'] { + input[ type='radio' ] { display: inline; .box-sizing( content-box ); width: auto; diff --git a/resources/src/mediawiki.ui/components/inputs.less b/resources/src/mediawiki.ui/components/inputs.less index 74dc0b756a..1c79d52ad1 100644 --- a/resources/src/mediawiki.ui/components/inputs.less +++ b/resources/src/mediawiki.ui/components/inputs.less @@ -73,7 +73,7 @@ } // Normalize styling for `` - &[type='search'] { + &[ type='search' ] { // Correct the odd appearance in Chrome and Safari 5 -webkit-appearance: textfield; @@ -103,7 +103,7 @@ textarea.mw-ui-input { // // // Styleguide 1.2. -input[type='number'], +input[ type='number' ], .mw-ui-input-inline { display: inline-block; width: auto; diff --git a/resources/src/mediawiki.ui/components/radio.less b/resources/src/mediawiki.ui/components/radio.less index 3d82e8eda2..d9b7c6d301 100644 --- a/resources/src/mediawiki.ui/components/radio.less +++ b/resources/src/mediawiki.ui/components/radio.less @@ -48,14 +48,14 @@ vertical-align: middle; } - [type='radio'] { + [ type='radio' ] { // ensure the invisible radio takes up the required width width: @sizeInputBinary; height: @sizeInputBinary; // This is needed for Firefox mobile (See T73750 to workaround default Firefox stylesheet) max-width: none; margin: 0; - // Hide `input[type=radio]` and instead style the label that follows + // Hide `input[ type=radio ]` and instead style the label that follows // Support: VoiceOver. Use `opacity` so that VoiceOver can still identify the radio opacity: 0;