Esanders has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/374843 )
Change subject: build: Update linters and fix errors
......................................................................
build: Update linters and fix errors
Mostly just indentations fixes from eslint.
Change-Id: I49ff853b474dc96825419cb29f5f777d550c00e2
---
M modules/dashboard/ext.cx.dashboard.js
M modules/dashboard/ext.cx.suggestionlist.js
M modules/dashboard/ext.cx.translationlist.js
M modules/mw.cx.init.Translation.js
M modules/stats/ext.cx.stats.js
M modules/tools/ext.cx.tools.link.js
M modules/tools/ext.cx.tools.mt.js
M modules/tools/mw.cx.tools.InstructionsTool.js
M modules/tours/ext.cx.tours.publish.js
M modules/ui/widgets/mw.cx.ui.TranslationToolWidget.js
M modules/util/ext.cx.util.js
M modules/widgets/translator/ext.cx.translator.js
M package.json
13 files changed, 68 insertions(+), 62 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation
refs/changes/43/374843/1
diff --git a/modules/dashboard/ext.cx.dashboard.js
b/modules/dashboard/ext.cx.dashboard.js
index 6fdfbfe..31d6718 100644
--- a/modules/dashboard/ext.cx.dashboard.js
+++ b/modules/dashboard/ext.cx.dashboard.js
@@ -181,12 +181,12 @@
$links.append(
$( '<li>' ).append(
$( '<a>' )
- .addClass( items[ i ].class )
- .text( items[ i ].label )
- .prop( {
- target: '_blank',
- href: items[ i ].href
- } )
+ .addClass( items[ i ].class )
+ .text( items[ i ].label )
+ .prop( {
+ target: '_blank',
+ href: items[ i ].href
+ } )
)
);
}
diff --git a/modules/dashboard/ext.cx.suggestionlist.js
b/modules/dashboard/ext.cx.suggestionlist.js
index ac0731c..a2972aa 100644
--- a/modules/dashboard/ext.cx.suggestionlist.js
+++ b/modules/dashboard/ext.cx.suggestionlist.js
@@ -495,13 +495,14 @@
.attr( 'data-suggestion', JSON.stringify( suggestion ) )
// It must be a separate element to ensure
// separation from the target title
- .append( $( '<span>' )
- .text( suggestion.title )
- .addClass( 'source-title' )
- .prop( {
- lang: suggestion.sourceLanguage,
- dir: sourceDir
- } ),
+ .append(
+ $( '<span>' )
+ .text( suggestion.title )
+ .addClass( 'source-title' )
+ .prop( {
+ lang: suggestion.sourceLanguage,
+ dir: sourceDir
+ } ),
$featured
);
diff --git a/modules/dashboard/ext.cx.translationlist.js
b/modules/dashboard/ext.cx.translationlist.js
index 9f7b2f4..7ab418d 100644
--- a/modules/dashboard/ext.cx.translationlist.js
+++ b/modules/dashboard/ext.cx.translationlist.js
@@ -86,8 +86,9 @@
CXTranslationList.prototype.init = function () {
this.$headerContainer = $( '<div>' )
.addClass( 'cx-translationlist__header' )
- .append( $( '<span>' )
- .text( mw.msg( 'cx-translation-label-' +
this.type ) ),
+ .append(
+ $( '<span>' )
+ .text( mw.msg( 'cx-translation-label-'
+ this.type ) ),
this.languageFilter.$element
);
this.$translationsList = $( '<div>' )
diff --git a/modules/mw.cx.init.Translation.js
b/modules/mw.cx.init.Translation.js
index 177fa7a..6c78230 100644
--- a/modules/mw.cx.init.Translation.js
+++ b/modules/mw.cx.init.Translation.js
@@ -99,8 +99,8 @@
mw.log( '[CX] Fetching Source page...' );
sourcePageFetchDeferred = this.fetchSourcePageContent(
- this.sourceWikiPage, this.config.siteMapper
- ).fail( this.fetchSourcePageContentError.bind( this ) );
+ this.sourceWikiPage, this.config.siteMapper
+ ).fail( this.fetchSourcePageContentError.bind( this ) );
mw.log( '[CX] Checking existing translation...' );
draftFetchDeferred = this.fetchDraftInformation(
diff --git a/modules/stats/ext.cx.stats.js b/modules/stats/ext.cx.stats.js
index 4477787..8ebf6d0 100644
--- a/modules/stats/ext.cx.stats.js
+++ b/modules/stats/ext.cx.stats.js
@@ -824,8 +824,9 @@
// Set the global siteMapper for code which we cannot inject it
mw.cx.siteMapper = new mw.cx.SiteMapper( mw.config.get(
'wgContentTranslationSiteTemplates' ) );
$( 'body' ).append(
- $( '<div>' ).addClass( 'cx-widget' )
- .append( $header, $container )
+ $( '<div>' ).addClass( 'cx-widget' ).append(
+ $header, $container
+ )
);
header = new mw.cx.ui.Header( {
siteMapper: this.siteMapper,
diff --git a/modules/tools/ext.cx.tools.link.js
b/modules/tools/ext.cx.tools.link.js
index 9bc502f..6375b13 100644
--- a/modules/tools/ext.cx.tools.link.js
+++ b/modules/tools/ext.cx.tools.link.js
@@ -401,8 +401,8 @@
.addClass( 'card__title' )
.text(
this.page ?
- mw.msg( 'cx-tools-link-title' ) :
- mw.msg( 'cx-tools-missing-link-title' )
+ mw.msg( 'cx-tools-link-title' ) :
+ mw.msg( 'cx-tools-missing-link-title' )
)
);
diff --git a/modules/tools/ext.cx.tools.mt.js b/modules/tools/ext.cx.tools.mt.js
index 419d2b7..44eacee 100644
--- a/modules/tools/ext.cx.tools.mt.js
+++ b/modules/tools/ext.cx.tools.mt.js
@@ -147,12 +147,13 @@
.always( function () {
cxserverToken.promise = undefined;
} )
- .then( function ( response ) {
- cxserverToken.jwt = response.jwt;
- cxserverToken.expires = response.exp;
+ .then(
+ function ( response ) {
+ cxserverToken.jwt = response.jwt;
+ cxserverToken.expires = response.exp;
- return response.jwt;
- },
+ return response.jwt;
+ },
// Not all MT services require token, so let
the caller try
// with empty token to see if it fails.
function () {
diff --git a/modules/tools/mw.cx.tools.InstructionsTool.js
b/modules/tools/mw.cx.tools.InstructionsTool.js
index 29b9cf0..2537acb 100644
--- a/modules/tools/mw.cx.tools.InstructionsTool.js
+++ b/modules/tools/mw.cx.tools.InstructionsTool.js
@@ -82,12 +82,14 @@
$content.find( '.card-instructions-description-three' )
.text( mw.msg( 'cx-tools-instructions-text6' ) );
$content.find( '.card-instructions-guidelines' )
- .append( $( '<a>' )
- .prop( {
- href: mw.msg( 'cx-tools-view-guidelines-link' ),
- target: '_blank'
- } )
- .text( mw.msg( 'cx-tools-view-guidelines' ) ) );
+ .append(
+ $( '<a>' )
+ .prop( {
+ href: mw.msg(
'cx-tools-view-guidelines-link' ),
+ target: '_blank'
+ } )
+ .text( mw.msg( 'cx-tools-view-guidelines' ) )
+ );
return $content;
};
diff --git a/modules/tours/ext.cx.tours.publish.js
b/modules/tours/ext.cx.tours.publish.js
index 1e1fa67..e187e5f 100644
--- a/modules/tours/ext.cx.tours.publish.js
+++ b/modules/tours/ext.cx.tours.publish.js
@@ -101,9 +101,9 @@
position: 'leftBottom',
titlemsg: 'cx-publish-gt-first-step-title',
description: mw.message(
- 'cx-publish-gt-first-step-description',
- $( '#ca-edit a' ).text()
- ).parse(),
+ 'cx-publish-gt-first-step-description',
+ $( '#ca-edit a' ).text()
+ ).parse(),
onShow: function () {
var $cactions = $( cactions ),
$actionsMenu = $cactions.find( '.menu' );
@@ -124,11 +124,11 @@
} );
}
} )
- .transition( function () {
- if ( isMovePage() ) {
- return 'movehelpstart';
- }
- } );
+ .transition( function () {
+ if ( isMovePage() ) {
+ return 'movehelpstart';
+ }
+ } );
// Help the user to move the page correctly
tour.step( {
@@ -138,11 +138,11 @@
titlemsg: 'cx-publish-gt-move-page-title',
descriptionmsg: 'cx-publish-gt-move-page-description'
} )
- .transition( function () {
- if ( isMoveSuccessPage() ) {
- return 'movedstart';
- }
- } );
+ .transition( function () {
+ if ( isMoveSuccessPage() ) {
+ return 'movedstart';
+ }
+ } );
// The page was moved.
// The move action result is shown.
@@ -153,11 +153,11 @@
titlemsg: 'cx-publish-gt-moved-title',
descriptionmsg: 'cx-publish-gt-moved-description'
} )
- .transition( function () {
- if ( isPublishedPage() ) {
- return 'publishedstart';
- }
- } );
+ .transition( function () {
+ if ( isPublishedPage() ) {
+ return 'publishedstart';
+ }
+ } );
// The page was moved to the main space.
// Suggest more editing.
diff --git a/modules/ui/widgets/mw.cx.ui.TranslationToolWidget.js
b/modules/ui/widgets/mw.cx.ui.TranslationToolWidget.js
index fadf3ba..8efce52 100644
--- a/modules/ui/widgets/mw.cx.ui.TranslationToolWidget.js
+++ b/modules/ui/widgets/mw.cx.ui.TranslationToolWidget.js
@@ -33,8 +33,8 @@
.addClass( 'card__title--language' )
.text( $.uls.data.getAutonym( config.language ) || '' );
this.$header = $( '<div>' )
- .addClass( 'cx-widget-translationtool-header' )
- .append( this.$title, this.$language );
+ .addClass( 'cx-widget-translationtool-header' )
+ .append( this.$title, this.$language );
// It is not always possible to provide the toolContent at this point.
The tools can update this widget
this.$information = $( '<div>' )
diff --git a/modules/util/ext.cx.util.js b/modules/util/ext.cx.util.js
index c487a1f..bddf79e 100644
--- a/modules/util/ext.cx.util.js
+++ b/modules/util/ext.cx.util.js
@@ -119,7 +119,7 @@
mw.cx.wikitextToHTML = function ( siteMapper, language, wikitext, title
) {
var url, domain;
- if ( !wikitext || !wikitext.trim() || !/\{\{|[\[<>&'=#*]/.test(
wikitext ) ) {
+ if ( !wikitext || !wikitext.trim() || !/\{\{|[[<>&'=#*]/.test(
wikitext ) ) {
// Plan text. Does not contain wiki markup. Save api
call.
return $.Deferred().resolve( wikitext ).promise();
}
diff --git a/modules/widgets/translator/ext.cx.translator.js
b/modules/widgets/translator/ext.cx.translator.js
index 29a0a4b..3ea7e17 100644
--- a/modules/widgets/translator/ext.cx.translator.js
+++ b/modules/widgets/translator/ext.cx.translator.js
@@ -78,14 +78,14 @@
$monthStats = $( '<div>' ).addClass(
'cx-translator__month-stats' ).append(
$( '<div>' ).addClass(
'cx-translator__month-stats-count' ),
$( '<div>' )
- .addClass( 'cx-translator__month-stats-label' )
- .text( mw.msg( 'cx-translator-month-stats-label' ) )
+ .addClass( 'cx-translator__month-stats-label' )
+ .text( mw.msg(
'cx-translator-month-stats-label' ) )
);
$total = $( '<div>' ).addClass(
'cx-translator__total-translations' ).append(
$( '<div>' ).addClass(
'cx-translator__total-translations-count' ),
$( '<div>' )
- .addClass( 'cx-translator__total-translations-label' )
- .text( mw.msg( 'cx-translator-total-translations-label'
) )
+ .addClass(
'cx-translator__total-translations-label' )
+ .text( mw.msg(
'cx-translator-total-translations-label' ) )
);
$trend = $( '<canvas>' ).addClass( 'cx-translatorstats' );
statsRequest = statsRequest || api.get( {
diff --git a/package.json b/package.json
index b6bd9f6..e5a4f66 100644
--- a/package.json
+++ b/package.json
@@ -4,12 +4,12 @@
"test": "grunt test"
},
"devDependencies": {
- "eslint-config-wikimedia": "0.4.0",
+ "eslint-config-wikimedia": "0.5.0",
"grunt": "1.0.1",
- "grunt-banana-checker": "0.5.0",
- "grunt-eslint": "19.0.0",
- "grunt-jsonlint": "1.0.8",
- "grunt-stylelint": "0.7.0",
+ "grunt-banana-checker": "0.6.0",
+ "grunt-eslint": "20.0.0",
+ "grunt-jsonlint": "1.1.0",
+ "grunt-stylelint": "0.8.0",
"stylelint": "7.8.0",
"stylelint-config-wikimedia": "0.4.1"
}
--
To view, visit https://gerrit.wikimedia.org/r/374843
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I49ff853b474dc96825419cb29f5f777d550c00e2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits