jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/342328 )
Change subject: build: Replace jshint with eslint and introduce stylelint
......................................................................
build: Replace jshint with eslint and introduce stylelint
Change-Id: I7b1e3f5ca7bcd5d91a90b6e3cd3701cda66da9e2
---
A .eslintrc.json
D .jshintignore
D .jshintrc
A .stylelintrc
M Gruntfile.js
M package.json
M resources/master.less
M skinStyles/tipsy.original.less
M skinStyles/tipsy.override.less
9 files changed, 172 insertions(+), 173 deletions(-)
Approvals:
jenkins-bot: Verified
Jforrester: Looks good to me, approved
diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644
index 0000000..9fad52a
--- /dev/null
+++ b/.eslintrc.json
@@ -0,0 +1,7 @@
+{
+ "extends": "wikimedia",
+ "env": {
+ "browser": true,
+ "jquery": true
+ }
+}
diff --git a/.jshintignore b/.jshintignore
deleted file mode 100644
index 2965710..0000000
--- a/.jshintignore
+++ /dev/null
@@ -1,2 +0,0 @@
-node_modules
-resources/vendor/**
diff --git a/.jshintrc b/.jshintrc
deleted file mode 100644
index 82721ad..0000000
--- a/.jshintrc
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- // Enforcing
- "bitwise": true,
- "eqeqeq": true,
- "freeze": true,
- "latedef": true,
- "noarg": true,
- "nonew": true,
- "undef": true,
- "unused": false,
- "strict": false,
-
- // Relaxing
- "es5": false,
-
- // Environment
- "browser": true,
- "jquery": true
-}
diff --git a/.stylelintrc b/.stylelintrc
new file mode 100644
index 0000000..2c90730
--- /dev/null
+++ b/.stylelintrc
@@ -0,0 +1,3 @@
+{
+ "extends": "stylelint-config-wikimedia"
+}
diff --git a/Gruntfile.js b/Gruntfile.js
index f8b7d51..4502395 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,33 +1,42 @@
-/*jshint node:true */
+/* eslint-env node */
module.exports = function ( grunt ) {
var conf = grunt.file.readJSON( 'skin.json' );
-
grunt.loadNpmTasks( 'grunt-banana-checker' );
- grunt.loadNpmTasks( 'grunt-contrib-jshint' );
- grunt.loadNpmTasks( 'grunt-jscs' );
+ grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
+ grunt.loadNpmTasks( 'grunt-stylelint' );
grunt.initConfig( {
- jshint: {
- options: {
- jshintrc: true
- },
+ eslint: {
all: [
- '.'
+ '*.js',
+ '**/*.js',
+ '!node_modules/**',
+ '!resources/vendor/**'
]
},
- jscs: {
- src: '<%= jshint.all %>'
- },
- banana: conf.MessagesDirs,
jsonlint: {
all: [
+ '*.json',
'**/*.json',
- '!node_modules/**'
+ '!node_modules/**',
+ '!resources/vendor/**'
+ ]
+ },
+ banana: conf.MessagesDirs,
+ stylelint: {
+ options: {
+ syntax: 'less'
+ },
+ all: [
+ '*.{less,css}',
+ '**/*.{less,css}',
+ '!node_modules/**',
+ '!resources/vendor/**'
]
}
} );
- grunt.registerTask( 'test', [ 'jshint', 'jscs', 'jsonlint', 'banana' ]
);
+ grunt.registerTask( 'test', [ 'eslint', 'jsonlint', 'banana',
'stylelint' ] );
grunt.registerTask( 'default', 'test' );
};
diff --git a/package.json b/package.json
index ab30448..a2a0960 100644
--- a/package.json
+++ b/package.json
@@ -4,11 +4,12 @@
"test": "grunt test"
},
"devDependencies": {
- "grunt": "0.4.5",
- "grunt-cli": "0.1.13",
- "grunt-contrib-jshint": "0.11.3",
- "grunt-banana-checker": "0.4.0",
- "grunt-jscs": "2.1.0",
- "grunt-jsonlint": "1.0.7"
+ "eslint-config-wikimedia": "0.3.0",
+ "grunt": "1.0.1",
+ "grunt-banana-checker": "0.5.0",
+ "grunt-eslint": "19.0.0",
+ "grunt-jsonlint": "1.1.0",
+ "grunt-stylelint": "0.7.0",
+ "stylelint-config-wikimedia": "0.4.1"
}
}
diff --git a/resources/master.less b/resources/master.less
index aad5d43..2ecbafc 100644
--- a/resources/master.less
+++ b/resources/master.less
@@ -1,34 +1,35 @@
-@import "vendor/bootstrap/bootstrap.less";
+@import 'vendor/bootstrap/bootstrap.less';
+
+/* stylelint-disable selector-no-id, no-descending-specificity */
/**
* Variables
*/
// Colors
-@bgc-main: #fff;
+@bgc-main: #fff;
@bgc-contrast: #265bb2;
-@bgc-code: #f9f9f9;
-@c-main: #333;
-@c-contrast: #fff;
-@c-link: #265bb2;
+@bgc-code: #f9f9f9;
+@c-main: #333;
+@c-contrast: #fff;
+@c-link: #265bb2;
// Box Sizes & Boxes
@bdc-contrast: #225196;
-@bdc-headers: #ccc;
-@bdrs-main: 2px;
+@bdc-headers: #ccc;
+@bdrs-main: 2px;
// Fonts
-@ff-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
+@ff-sans: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
// same as Vector's @content-heading-font-family
-@ff-serif: "Linux Libertine", Georgia, Times, serif;
+@ff-serif: 'Linux Libertine', 'Georgia', 'Times', serif;
// Box-Shadows
// taken from OOjs UI mediawiki/common.less - keep in sync
-@bxsh-menu: 0 .15em 0 0 rgba( 0, 0, 0, .15 );
-@bxsh-popup: @bxsh-menu;
+@bxsh-menu: 0 0.15em 0 0 rgba( 0, 0, 0, 0.15 );
+@bxsh-popup: @bxsh-menu;
// Transitions
-@trs-main: .2s ease-in;
-
+@trs-main: 0.2s ease-in;
/*
* Stateful Helper Classes
@@ -36,7 +37,7 @@
/* Text for Screen Readers only, as long as T119444 isn't resolved and there's
no possibility in core */
.is-aural {
display: block;
- position: absolute !important;
+ position: absolute !important; // stylelint-disable-line
declaration-no-important
clip: rect( 1px, 1px, 1px, 1px );
width: 1px;
height: 1px;
@@ -45,9 +46,9 @@
padding: 0;
overflow: hidden;
- &[tabindex="0"]:active,
- &[tabindex="0"]:focus {
- position: static !important;
+ &[tabindex='0']:active,
+ &[tabindex='0']:focus {
+ position: static !important; // stylelint-disable-line
declaration-no-important
clip: auto;
width: auto;
height: auto;
@@ -77,7 +78,7 @@
h2 {
margin-bottom: 1em;
border-bottom: 1px solid @bdc-headers;
- padding-bottom: .2em;
+ padding-bottom: 0.2em;
font: 2em/1.25 @ff-serif;
}
@@ -86,8 +87,8 @@
h5,
h6 {
font-family: @ff-sans;
- line-height: 1.5
- margin: 1.2em 0 .8em 0;
+ line-height: 1.5;
+ margin: 1.2em 0 0.8em 0;
padding: 0;
}
@@ -107,7 +108,7 @@
}
p {
- margin: 1.2em 0 .8em 0;
+ margin: 1.2em 0 0.8em 0;
line-height: 1.5;
}
@@ -122,10 +123,9 @@
}
/* Forms */
-[type="search"]::-ms-clear { // IE10+ adds clearing x, we want to avoid
+[type='search']::-ms-clear { // IE10+ adds clearing x, we want to avoid
display: none;
}
-
/**
* General Modules Classes
@@ -135,15 +135,14 @@
.box-shadow( @bxsh-popup );
}
-
/**
* Document Structure
*/
.skin-blueprint > .is-aural {
- &[tabindex="0"]:active,
- &[tabindex="0"]:focus {
+ &[tabindex='0']:active,
+ &[tabindex='0']:focus {
background: @bgc-main;
- position: absolute !important;
+ position: absolute !important; // stylelint-disable-line
declaration-no-important
top: 50px;
min-width: 260px;
border: 1px solid #eee;
@@ -160,27 +159,28 @@
padding-top: 1.25em;
padding-left: 22px; // 32px minus 10px margin added in menu.js
}
- .mw-indicators {
- float: right;
- /* Ensure that this is displayed on top of .mw-body-content and
clickable */
- position: relative;
- z-index: 1;
- }
- .mw-indicator {
- display: inline-block;
- }
+.mw-indicators {
+ float: right;
+ /* Ensure that this is displayed on top of .mw-body-content and
clickable */
+ position: relative;
+ z-index: 1;
+}
- .client-js .container .toc {
- display: none;
- }
+.mw-indicator {
+ display: inline-block;
+}
- /* Wiki Article Content */
- // Unbreak Visual Editor and possible user contributed styles by
overruling `border-box`, see T122117
- .mw-body-content *,
- .ve-ui-toolbar * {
- .box-sizing( content-box );
- }
+.client-js .container .toc {
+ display: none;
+}
+
+/* Wiki Article Content */
+// Unbreak Visual Editor and possible user contributed styles by overruling
`border-box`, see T122117
+.mw-body-content *,
+.ve-ui-toolbar * {
+ .box-sizing( content-box );
+}
.example_container {
background-color: @bgc-code;
@@ -212,95 +212,93 @@
}
}
- .sidebar-heading {
- margin: 32px 50px;
- font-size: 2em;
+.sidebar-heading {
+ margin: 32px 50px;
+ font-size: 2em;
+}
+
+.sidebar-toc {
+ margin-top: 17px; // 32px - 10px (padding on ul) - 5px (padding on li)
+ padding: 0 50px;
+ font-size: 16px;
+ line-height: 16px;
+
+ & ul {
+ padding-left: 0;
}
- .sidebar-toc {
- margin-top: 17px; // 32px - 10px (padding on ul) - 5px (padding
on li)
- padding: 0 50px;
- font-size: 16px;
- line-height: 16px;
+ & .tocnumber {
+ display: inline-block;
+ min-width: 60px;
+ }
- & ul {
- padding-left: 0;
+ & .toctext {
+ display: inline-block;
+ width: 200px;
+ }
+
+ & a {
+ display: inline-block;
+ min-width: 280px;
+ border-radius: @bdrs-main;
+ padding: 5px;
+
+ &:hover {
+ background: rgba( 0, 0, 0, 0.2 );
}
+ }
+}
- & .tocnumber {
- display: inline-block;
- min-width: 60px;
- }
+.sidebar-toc-page > a {
+ font-weight: bold;
+}
- & .toctext {
- display: inline-block;
- width: 200px;
- }
+#toctitle {
+ &:extend( .is-aural );
+}
+.nav-in-context {
+ padding: 0 50px 27px 50px;
+ margin-top: 30px;
+ border-bottom: 1px solid @bdc-contrast;
+
+ & li {
& a {
+ background-position: center left;
+ background-repeat: no-repeat;
display: inline-block;
- min-width: 280px;
- border-radius: @bdrs-main;
- padding: 5px;
-
- &:hover {
- background: rgba( 0, 0, 0, .2 );
- }
+ padding: 5px 0 5px 70px;
+ font-size: 16px;
}
}
-
- .sidebar-toc-page > a {
- font-weight: bold;
- }
-
- #toctitle {
- &:extend( .is-aural );
- }
-
- .nav-in-context {
- padding: 0 50px 27px 50px;
- margin-top: 30px;
- border-bottom: 1px solid @bdc-contrast;
-
- & li {
- & a {
- background-position: center left;
- background-repeat: no-repeat;
- display: inline-block;
- padding: 5px 0 5px 70px;
- font-size: 16px;
- }
- }
- /*
- * Hide the current tab (e.g. "Page" or "Discussion")
- * in the content_navigation.namespace set of tabs.
- */
- & .mw-skin-bs-cn_ns .selected {
- display: none;
- }
+ /*
+ * Hide the current tab (e.g. 'Page' or 'Discussion')
+ * in the content_navigation.namespace set of tabs.
+ */
+ & .mw-skin-bs-cn_ns .selected {
+ display: none;
}
+}
- #ca-view {
- background-image: url( img/view.svg );
- }
+#ca-view {
+ background-image: url( img/view.svg );
+}
- #ca-edit {
- background-image: url( img/edit.svg );
- }
+#ca-edit {
+ background-image: url( img/edit.svg );
+}
- #ca-viewsource {
- background-image: url( img/edit-locked.svg );
- }
+#ca-viewsource {
+ background-image: url( img/edit-locked.svg );
+}
- #ca-history {
- background-image: url( img/history.svg );
- }
+#ca-history {
+ background-image: url( img/history.svg );
+}
- #ca-talk {
- background-image: url( img/talk.svg );
- }
-
-
+#ca-talk {
+ background-image: url( img/talk.svg );
+}
/* Navbar */
.navbar.navbar-fixed-top {
@@ -329,7 +327,7 @@
margin: 0;
padding: 0;
- & div[role="search"] {
+ & div[role='search'] {
height: 100%;
}
}
@@ -344,7 +342,7 @@
.box-shadow( none );
&:focus {
- outline: none;
+ outline: 0;
.box-shadow( none );
& + .search-input-label {
@@ -367,7 +365,7 @@
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
- opacity: .666;
+ opacity: 0.666;
cursor: pointer;
.transition( opacity @trs-main );
}
@@ -415,10 +413,10 @@
padding: 0;
}
- li {
- display: inline-block;
- margin-right: 20px;
- }
+ li {
+ display: inline-block;
+ margin-right: 20px;
+ }
}
@media screen {
@@ -429,10 +427,10 @@
}
.content-actions {
- font-size: .5em;
+ font-size: 0.5em;
a {
- margin-left: .75em;
+ margin-left: 0.75em;
}
}
@@ -449,9 +447,8 @@
.catlinks {
clear: both;
margin-top: 1em;
- padding-right: .36em;
+ padding-right: 0.36em;
}
-
/**
* Print Style Refinements on top of MW's commonPrint.css
@@ -462,7 +459,8 @@
}
.navbar {
- min-height: 20px !important; // override bootstrap.css
+ // override bootstrap.css
+ min-height: 20px !important; // stylelint-disable-line
declaration-no-important
}
.navbar.navbar-fixed-top .navbar-head {
diff --git a/skinStyles/tipsy.original.less b/skinStyles/tipsy.original.less
index 14a31f5..7f07d0d 100644
--- a/skinStyles/tipsy.original.less
+++ b/skinStyles/tipsy.original.less
@@ -1,6 +1,8 @@
// Copied from
https://raw.githubusercontent.com/jaz303/tipsy/master/src/stylesheets/tipsy.css
// And modified for additional specificity
+/* stylelint-disable */
+
@tooltip-color: #333;
body {
diff --git a/skinStyles/tipsy.override.less b/skinStyles/tipsy.override.less
index 39d3f8c..9bb6c6d 100644
--- a/skinStyles/tipsy.override.less
+++ b/skinStyles/tipsy.override.less
@@ -2,6 +2,6 @@
font-size: 14px;
.tipsy-inner {
- border: none;
+ border: 0;
}
}
--
To view, visit https://gerrit.wikimedia.org/r/342328
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7b1e3f5ca7bcd5d91a90b6e3cd3701cda66da9e2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Blueprint
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits