jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/340341 )
Change subject: build: Replace jscs and jshint with eslint
......................................................................
build: Replace jscs and jshint with eslint
Change-Id: I943e55aaf95b069e1f7c5dad4063b40aa3364b33
---
A .eslintrc.json
D .jscsrc
M Gruntfile.js
M modules/mmv.3d.js
M package.json
5 files changed, 29 insertions(+), 34 deletions(-)
Approvals:
MarkTraceur: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644
index 0000000..c2cd2ce
--- /dev/null
+++ b/.eslintrc.json
@@ -0,0 +1,13 @@
+{
+ "extends": "wikimedia",
+ "env": {
+ "browser": true,
+ "jquery": true,
+ "qunit": true
+ },
+ "globals": {
+ "mediaWiki": false,
+ "TD": true,
+ "THREE": false
+ }
+}
diff --git a/.jscsrc b/.jscsrc
deleted file mode 100644
index 7ca08f2..0000000
--- a/.jscsrc
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "preset": "wikimedia",
-
- "jsDoc": {
- "checkAnnotations": {
- "preset": "jsduck5",
- "extra": {
- "see": true
- }
- },
- "checkParamNames": true,
- "checkRedundantAccess": true,
- "checkRedundantReturns": true,
- "requireNewlineAfterDescription": true,
- "requireParamTypes": true,
- "requireReturnTypes": true
- },
-
- "excludeFiles": [ "resources/jquery/**" ]
-}
diff --git a/Gruntfile.js b/Gruntfile.js
index 1ecdd85..35d40d4 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,23 +1,24 @@
-/*jshint node:true */
+/* eslint-env node, es6 */
module.exports = function ( grunt ) {
- grunt.loadNpmTasks( 'grunt-contrib-jshint' );
+ grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
- grunt.loadNpmTasks( 'grunt-jscs' );
grunt.initConfig( {
- jshint: {
- options: {
- jshintrc: true
+ eslint: {
+ fix: {
+ options: {
+ fix: true
+ },
+ src: [
+ '<%= eslint.all %>'
+ ]
},
all: [
'*.js',
'modules/**/*.js',
'!modules/three/**'
]
- },
- jscs: {
- src: '<%= jshint.all %>'
},
banana: {
all: 'i18n/'
@@ -31,6 +32,7 @@
}
} );
- grunt.registerTask( 'test', [ 'jshint', 'jscs', 'jsonlint', 'banana' ]
);
+ grunt.registerTask( 'test', [ 'eslint:all', 'jsonlint', 'banana' ] );
+ grunt.registerTask( 'fix', [ 'eslint:fix' ] );
grunt.registerTask( 'default', 'test' );
};
diff --git a/modules/mmv.3d.js b/modules/mmv.3d.js
index 92cc4be..0d9fdbc 100644
--- a/modules/mmv.3d.js
+++ b/modules/mmv.3d.js
@@ -111,7 +111,7 @@
} );
deferred.fail( function () {
- if ( request && request.readyState != 4 ) {
+ if ( request && request.readyState !== 4 ) {
request.abort();
}
} );
@@ -168,7 +168,7 @@
threed.render( threed.renderer, threed.scene,
threed.camera );
} ).progress( function ( progress ) {
threed.progressBar.animateTo( progress );
- } ).fail( function ( error ) {
+ } ).fail( function ( /* error */ ) {
threed.progressBar.hide();
delete this.promise;
} );
diff --git a/package.json b/package.json
index 2e624bb..f0c1369 100644
--- a/package.json
+++ b/package.json
@@ -7,10 +7,10 @@
"test": "grunt test"
},
"devDependencies": {
+ "eslint-config-wikimedia": "0.3.0",
"grunt": "1.0.1",
- "grunt-contrib-jshint": "1.1.0",
+ "grunt-eslint": "19.0.0",
"grunt-banana-checker": "0.5.0",
- "grunt-jscs": "3.0.1",
"grunt-jsonlint": "1.1.0"
}
}
--
To view, visit https://gerrit.wikimedia.org/r/340341
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I943e55aaf95b069e1f7c5dad4063b40aa3364b33
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/3D
Gerrit-Branch: master
Gerrit-Owner: Jforrester <[email protected]>
Gerrit-Reviewer: MarkTraceur <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits