Hashar has uploaded a new change for review.
https://gerrit.wikimedia.org/r/262710
Change subject: Pass jshint and add it to 'npm test' command
......................................................................
Pass jshint and add it to 'npm test' command
Bug: T63620
Change-Id: Ibae36050a1d8054b7280804513a258bc7cd8960f
---
M Gruntfile.js
M modules/ext.quiz.js
M package.json
3 files changed, 12 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Quiz
refs/changes/10/262710/1
diff --git a/Gruntfile.js b/Gruntfile.js
index 9c56558..ccbcf3f 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,11 +1,18 @@
/*jshint node:true */
module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-banana-checker' );
+ grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.initConfig( {
banana: {
all: 'i18n/'
+ },
+ jshint: {
+ all: [
+ '**/*.js',
+ '!node_modules/**'
+ ]
},
jsonlint: {
all: [
@@ -15,6 +22,6 @@
}
} );
- grunt.registerTask( 'test', [ 'jsonlint', 'banana' ] );
+ grunt.registerTask( 'test', [ 'jshint', 'jsonlint', 'banana' ] );
grunt.registerTask( 'default', 'test' );
};
diff --git a/modules/ext.quiz.js b/modules/ext.quiz.js
index 66aa9f7..b62713b 100644
--- a/modules/ext.quiz.js
+++ b/modules/ext.quiz.js
@@ -39,10 +39,12 @@
// Shuffle questions
function shuffle( area ) {
var div = area.childNodes;
+ var quizText;
+
for( var i = 0, questions = []; i < div.length; ++i ) {
if( div[i].className ) {
if( questions.length === 0 && div[i].className
=== 'quizText' ) {
- var quizText = div[i];
+ quizText = div[i];
} else {
questions.push( div[i] );
if( div[i].className === 'shuffle' ||
div[i].className === 'noshuffle' ) {
diff --git a/package.json b/package.json
index 72eb4aa..5f3eb9f 100644
--- a/package.json
+++ b/package.json
@@ -7,6 +7,7 @@
"grunt": "0.4.5",
"grunt-cli": "0.1.13",
"grunt-banana-checker": "0.4.0",
+ "grunt-contrib-jshint": "0.11.3",
"grunt-jsonlint": "1.0.7"
}
}
--
To view, visit https://gerrit.wikimedia.org/r/262710
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibae36050a1d8054b7280804513a258bc7cd8960f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Quiz
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits