jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/365955 )
Change subject: build: Update eslint, stylelint and other and make pass
......................................................................
build: Update eslint, stylelint and other and make pass
Change-Id: I7a2ed722dbdbbd06ee6b27f867bd4479b0c9cc92
---
M package.json
M resources/mobile.gallery/PhotoListGateway.js
M resources/mobile.nearby/Nearby.js
M resources/mobile.notifications.filter.overlay/NotificationsFilterOverlay.js
M resources/mobile.pagelist.styles/pagelist.less
M resources/mobile.patrol.ajax/init.js
M resources/mobile.references.gateway/ReferencesHtmlScraperGateway.js
M resources/mobile.references/references.less
M resources/mobile.search.api/SearchGateway.js
M resources/mobile.startup/Page.js
M tests/qunit/mobile.search.util/test_extendSearchParams.js
11 files changed, 41 insertions(+), 39 deletions(-)
Approvals:
jenkins-bot: Verified
Jforrester: Looks good to me, but someone else must approve
Jdlrobson: Looks good to me, approved
diff --git a/package.json b/package.json
index 7717800..4f10976 100644
--- a/package.json
+++ b/package.json
@@ -12,13 +12,14 @@
"devDependencies": {
"eslint-config-wikimedia": "0.4.0",
"grunt": "^1.0.1",
- "grunt-banana-checker": "^0.5.0",
+ "grunt-banana-checker": "^0.6.0",
"grunt-contrib-watch": "^1.0.0",
- "grunt-eslint": "19.0.0",
+ "grunt-eslint": "20.0.0",
"grunt-jsonlint": "^1.1.0",
"grunt-notify": "^0.4.5",
- "grunt-stylelint": "^0.6.0",
+ "grunt-stylelint": "0.8.0",
"resource-modules": "^1.0.17",
- "stylelint-config-wikimedia": "^0.3.0"
+ "stylelint": "7.8.0",
+ "stylelint-config-wikimedia": "0.4.1"
}
}
diff --git a/resources/mobile.gallery/PhotoListGateway.js
b/resources/mobile.gallery/PhotoListGateway.js
index 61572e5..9b316ed 100644
--- a/resources/mobile.gallery/PhotoListGateway.js
+++ b/resources/mobile.gallery/PhotoListGateway.js
@@ -32,7 +32,7 @@
* @return {string} Description for file
*/
_getDescription: function ( title ) {
- title = title.replace( /\.[^\. ]+$/, '' ); // replace
filename suffix
+ title = title.replace( /\.[^. ]+$/, '' ); // replace
filename suffix
// strip namespace: prefix and date suffix from
remainder
return title.replace( /^[^:]*:/, '' )
.replace( / \d{4}-\d{1,2}-\d{1,2}
\d{1,2}-\d{1,2}$/, '' );
diff --git a/resources/mobile.nearby/Nearby.js
b/resources/mobile.nearby/Nearby.js
index f1ca150..70430b5 100644
--- a/resources/mobile.nearby/Nearby.js
+++ b/resources/mobile.nearby/Nearby.js
@@ -90,12 +90,13 @@
getCurrentPosition: function () {
var result = $.Deferred();
if ( browser.supportsGeoLocation() ) {
- navigator.geolocation.getCurrentPosition(
function ( geo ) {
- result.resolve( {
- latitude: geo.coords.latitude,
- longitude: geo.coords.longitude
- } );
- },
+ navigator.geolocation.getCurrentPosition(
+ function ( geo ) {
+ result.resolve( {
+ latitude:
geo.coords.latitude,
+ longitude:
geo.coords.longitude
+ } );
+ },
function ( err ) {
// see
https://developer.mozilla.org/en-US/docs/Web/API/PositionError
if ( err.code === 1 ) {
@@ -108,7 +109,8 @@
{
timeout: 10000,
enableHighAccuracy: true
- } );
+ }
+ );
} else {
result.reject( 'incompatible' );
}
@@ -155,12 +157,13 @@
}
if ( options.latitude && options.longitude ) {
- this.nearbyApi.getPages( {
- latitude: options.latitude,
- longitude: options.longitude
- },
- this.range, options.exclude
- )
+ this.nearbyApi.getPages(
+ {
+ latitude: options.latitude,
+ longitude: options.longitude
+ },
+ this.range, options.exclude
+ )
.done( pagesSuccess )
.fail( pagesError );
} else if ( options.pageTitle ) {
diff --git
a/resources/mobile.notifications.filter.overlay/NotificationsFilterOverlay.js
b/resources/mobile.notifications.filter.overlay/NotificationsFilterOverlay.js
index b94afee..bf7ef0a 100644
---
a/resources/mobile.notifications.filter.overlay/NotificationsFilterOverlay.js
+++
b/resources/mobile.notifications.filter.overlay/NotificationsFilterOverlay.js
@@ -31,10 +31,8 @@
this.$( '.overlay-content' ).append(
$( '<div>' )
.addClass(
'notifications-filter-overlay-read-state' )
- .append(
- options.$notifReadState
- ),
- options.$crossWikiUnreadFilter
+ .append( options.$notifReadState ),
+ options.$crossWikiUnreadFilter
);
};
diff --git a/resources/mobile.pagelist.styles/pagelist.less
b/resources/mobile.pagelist.styles/pagelist.less
index dbda656..ce3ef18 100644
--- a/resources/mobile.pagelist.styles/pagelist.less
+++ b/resources/mobile.pagelist.styles/pagelist.less
@@ -59,7 +59,7 @@
button {
position: absolute;
text-indent: inherit;
- outline: none;
+ outline: 0;
}
}
diff --git a/resources/mobile.patrol.ajax/init.js
b/resources/mobile.patrol.ajax/init.js
index b4a1849..d900f09 100644
--- a/resources/mobile.patrol.ajax/init.js
+++ b/resources/mobile.patrol.ajax/init.js
@@ -30,8 +30,7 @@
apiRequest.postWithToken( 'patrol', {
action: 'patrol',
rcid: rcid
- } )
- .done( function ( data ) {
+ } ).done( function ( data ) {
var title;
// Disable all patrollinks from the page.
@@ -50,8 +49,7 @@
// This should never happen as errors
should trigger fail
toast.show( mw.msg(
'markedaspatrollederrornotify' ), 'error' );
}
- } )
- .fail( function ( error ) {
+ } ).fail( function ( error ) {
$spinner.remove();
// Restore the patrol link. This allows the
user to try again
// (or open it in a new window, bypassing this
ajax module).
diff --git
a/resources/mobile.references.gateway/ReferencesHtmlScraperGateway.js
b/resources/mobile.references.gateway/ReferencesHtmlScraperGateway.js
index 7c4716e..4c093e5 100644
--- a/resources/mobile.references.gateway/ReferencesHtmlScraperGateway.js
+++ b/resources/mobile.references.gateway/ReferencesHtmlScraperGateway.js
@@ -23,7 +23,7 @@
result = $.Deferred(),
// Escape (almost) all CSS selector meta
characters
// see
http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
- meta = /[!"$%&'()*+,.\/:;<=>?@[\\\]^`{|}~]/g;
+ meta = /[!"$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;
id = id.replace( meta, '\\$&' );
id = id.substr( 1, id.length );
diff --git a/resources/mobile.references/references.less
b/resources/mobile.references/references.less
index a0ae183..d398784 100644
--- a/resources/mobile.references/references.less
+++ b/resources/mobile.references/references.less
@@ -48,7 +48,7 @@
// Compensate for the padding.
// Top and bottom margins are for the padding we're
adding below.
// The right margin is for the 1em margin of icon:before
- margin: -@extraPadding -@extraPadding -@extraPadding 0;
+ margin: -@extraPadding -@extraPadding -@extraPadding 0;
/* stylelint-disable-line value-keyword-case */
// Make the tappable area bigger. No need to add left
and right paddings because
// the icon:before already has 1em margin on both sides
padding: @extraPadding 0;
diff --git a/resources/mobile.search.api/SearchGateway.js
b/resources/mobile.search.api/SearchGateway.js
index 3405269..f0f6b85 100644
--- a/resources/mobile.search.api/SearchGateway.js
+++ b/resources/mobile.search.api/SearchGateway.js
@@ -53,7 +53,9 @@
* @private
*/
_createSearchRegEx: function ( str ) {
- str = str.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g,
'\\$&' );
+ // '\[' can be unescaped, but leave it balanced with
'`]'
+ // eslint-disable-next-line no-useless-escape
+ str = str.replace( /[-\[\]{}()*+?.,\\^$|#\s]/g, '\\$&'
);
return new RegExp( '^(' + str + ')', 'ig' );
},
diff --git a/resources/mobile.startup/Page.js b/resources/mobile.startup/Page.js
index 2ec9c68..ab7ecfa 100644
--- a/resources/mobile.startup/Page.js
+++ b/resources/mobile.startup/Page.js
@@ -265,8 +265,8 @@
$lazyImage = $a.find(
'.lazy-image-placeholder' ),
// Parents need to be checked
as well.
valid = $a.parents(
blacklistSelector ).length === 0 && $a.find( blacklistSelector ).length === 0,
- legacyMatch = $a.attr( 'href'
).match( /title=([^\/&]+)/ ),
- match = $a.attr( 'href'
).match( /[^\/]+$/ );
+ legacyMatch = $a.attr( 'href'
).match( /title=([^/&]+)/ ),
+ match = $a.attr( 'href'
).match( /[^/]+$/ );
// filter out invalid lazy loaded
images if so far image is valid
if ( $lazyImage.length && valid ) {
diff --git a/tests/qunit/mobile.search.util/test_extendSearchParams.js
b/tests/qunit/mobile.search.util/test_extendSearchParams.js
index 7c48507..f312c22 100644
--- a/tests/qunit/mobile.search.util/test_extendSearchParams.js
+++ b/tests/qunit/mobile.search.util/test_extendSearchParams.js
@@ -88,13 +88,13 @@
QUnit.test( 'it is variadic', function ( assert ) {
var params = extendSearchParams(
- 'search',
- {
- baz: 'qux'
- },
- {
- quux: 'corge'
- }
+ 'search',
+ {
+ baz: 'qux'
+ },
+ {
+ quux: 'corge'
+ }
),
expectedParams = {
foo: 'bar',
--
To view, visit https://gerrit.wikimedia.org/r/365955
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7a2ed722dbdbbd06ee6b27f867bd4479b0c9cc92
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Niedzielski <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits