jenkins-bot has submitted this change and it was merged.
Change subject: Update linters and checkers
......................................................................
Update linters and checkers
There is no JavaScript in this repo yet apart from
Gruntfile.js. But seems easier to keep these files
more consistent across repos. And we might add JS
files in future.
Change-Id: Idccf0fae10003e65574243ab105fd183c2aecd20
---
A .jscsrc
A .jshintrc
M Gruntfile.js
M package.json
4 files changed, 41 insertions(+), 7 deletions(-)
Approvals:
Siebrand: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.jscsrc b/.jscsrc
new file mode 100644
index 0000000..9d22e3f
--- /dev/null
+++ b/.jscsrc
@@ -0,0 +1,3 @@
+{
+ "preset": "wikimedia"
+}
diff --git a/.jshintrc b/.jshintrc
new file mode 100644
index 0000000..31ce942
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,20 @@
+{
+ "bitwise": true,
+ "curly": true,
+ "eqeqeq": true,
+ "forin": false,
+ "freeze": true,
+ "latedef": true,
+ "noarg": true,
+ "nonew": true,
+ "onevar": true,
+ "strict": true,
+ "undef": true,
+ "unused": true,
+ "browser": true,
+ "predef": [
+ "mediaWiki",
+ "jQuery",
+ "QUnit"
+ ]
+}
diff --git a/Gruntfile.js b/Gruntfile.js
index 1c93271..a832fd1 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,26 +1,36 @@
/*jshint node:true */
module.exports = function ( grunt ) {
+ 'use strict';
+
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
- grunt.loadNpmTasks( 'grunt-banana-checker' );
+ grunt.loadNpmTasks( 'grunt-jscs' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
+ grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.initConfig( {
jshint: {
+ options: {
+ jshintrc: true
+ },
all: [
- '*.js'
+ '**/*.js',
+ '!node_modules/**'
]
},
- banana: {
- all: 'i18n/'
+ jscs: {
+ src: '<%= jshint.all %>'
},
jsonlint: {
all: [
'**/*.json',
'!node_modules/**'
]
+ },
+ banana: {
+ all: 'i18n/'
}
} );
- grunt.registerTask( 'test', [ 'jshint', 'jsonlint', 'banana' ] );
+ grunt.registerTask( 'test', [ 'jshint', 'jscs', 'jsonlint', 'banana' ]
);
grunt.registerTask( 'default', 'test' );
};
diff --git a/package.json b/package.json
index 407b969..611c585 100644
--- a/package.json
+++ b/package.json
@@ -7,7 +7,8 @@
"grunt": "0.4.5",
"grunt-cli": "0.1.13",
"grunt-contrib-jshint": "0.11.3",
- "grunt-banana-checker": "0.4.0",
- "grunt-jsonlint": "1.0.7"
+ "grunt-jscs": "2.5.0",
+ "grunt-jsonlint": "1.0.7",
+ "grunt-banana-checker": "0.4.0"
}
}
--
To view, visit https://gerrit.wikimedia.org/r/270962
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Idccf0fae10003e65574243ab105fd183c2aecd20
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/InviteSignup
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits