jenkins-bot has submitted this change and it was merged. Change subject: build: Replace jshint/jscs with eslint ......................................................................
build: Replace jshint/jscs with eslint Change-Id: I503a57bed2ee6bb648697d6245af0b0286b5f3ec --- A .eslintrc.json D .jscsrc D .jshintrc M Gruntfile.js M modules/ve-syntaxhighlight/ve.ce.MWSyntaxHighlightNode.js M modules/ve-syntaxhighlight/ve.ui.MWSyntaxHighlightDialogTool.js M modules/ve-syntaxhighlight/ve.ui.MWSyntaxHighlightInspectorTool.js M package.json 8 files changed, 27 insertions(+), 68 deletions(-) Approvals: Jforrester: Looks good to me, approved jenkins-bot: Verified diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..2c114ef --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,16 @@ +{ + "extends": "wikimedia", + "env": { + "browser": true, + "jquery": true, + "qunit": true + }, + "globals": { + "ve": true, + "OO": false, + "mw": false + }, + "rules": { + "dot-notation": [ "error", { "allowKeywords": true } ] + } +} diff --git a/.jscsrc b/.jscsrc deleted file mode 100644 index 1959eea..0000000 --- a/.jscsrc +++ /dev/null @@ -1,21 +0,0 @@ -{ - "preset": "wikimedia", - - "jsDoc": { - "checkAnnotations": { - "preset": "jsduck5", - "extra": { - "this": true, - "source": true, - "see": true - } - }, - "checkTypes": "strictNativeCase", - "checkParamNames": true, - "checkRedundantAccess": true, - "checkRedundantReturns": true, - "requireNewlineAfterDescription": true, - "requireParamTypes": true, - "requireReturnTypes": true - } -} diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 01df4e7..0000000 --- a/.jshintrc +++ /dev/null @@ -1,25 +0,0 @@ -{ - // Enforcing - "bitwise": true, - "eqeqeq": true, - "freeze": true, - "latedef": true, - "noarg": true, - "nonew": true, - "undef": true, - "unused": true, - "strict": false, - - // Relaxing - "es5": false, - - // Environment - "browser": true, - "jquery": true, - - "globals": { - "mw": false, - "OO": false, - "ve": false - } -} diff --git a/Gruntfile.js b/Gruntfile.js index d54583f..71c12a3 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -4,20 +4,16 @@ * @package SyntaxHighlight_GeSHi */ -/*jshint node:true */ +/* eslint-env node */ module.exports = function ( grunt ) { grunt.loadNpmTasks( 'grunt-banana-checker' ); - grunt.loadNpmTasks( 'grunt-contrib-jshint' ); grunt.loadNpmTasks( 'grunt-contrib-watch' ); - grunt.loadNpmTasks( 'grunt-jscs' ); + grunt.loadNpmTasks( 'grunt-eslint' ); grunt.loadNpmTasks( 'grunt-jsonlint' ); grunt.loadNpmTasks( 'grunt-stylelint' ); grunt.initConfig( { - jshint: { - options: { - jshintrc: true - }, + eslint: { all: [ '*.js', 'modules/**/*.js' @@ -29,9 +25,6 @@ 'i18n/*.json', 'modules/**/*.json' ] - }, - jscs: { - all: '<%= jshint.all %>' }, stylelint: { all: [ @@ -50,13 +43,13 @@ watch: { files: [ '.{stylelintrc,jscsrc,jshintignore,jshintrc}', - '<%= jshint.all %>', + '<%= eslint.all %>', '<%= stylelint.all %>' ], tasks: 'test' } } ); - grunt.registerTask( 'test', [ 'jshint', 'jsonlint', 'jscs', 'stylelint', 'banana' ] ); + grunt.registerTask( 'test', [ 'eslint', 'jsonlint', 'stylelint', 'banana' ] ); grunt.registerTask( 'default', 'test' ); }; diff --git a/modules/ve-syntaxhighlight/ve.ce.MWSyntaxHighlightNode.js b/modules/ve-syntaxhighlight/ve.ce.MWSyntaxHighlightNode.js index 7331237..5a036da 100644 --- a/modules/ve-syntaxhighlight/ve.ce.MWSyntaxHighlightNode.js +++ b/modules/ve-syntaxhighlight/ve.ce.MWSyntaxHighlightNode.js @@ -28,7 +28,7 @@ /* Methods */ -/** */ +// Inherits from ve.ce.GeneratedContentNode ve.ce.MWSyntaxHighlightNode.prototype.generateContents = function () { var node = this, args = arguments; @@ -41,7 +41,7 @@ } ); }; -/** */ +// Inherits from ve.ce.BranchNode ve.ce.MWSyntaxHighlightNode.prototype.onSetup = function () { // Parent method ve.ce.MWExtensionNode.prototype.onSetup.call( this ); @@ -50,7 +50,7 @@ this.$element.addClass( 've-ce-mwSyntaxHighlightNode' ); }; -/** */ +// Inherits from ve.ce.FocusableNode ve.ce.MWSyntaxHighlightNode.prototype.getBoundingRect = function () { // HACK: Because nodes can overflow due to the pre tag, just use the // first rect (of the wrapper div) for placing the context. diff --git a/modules/ve-syntaxhighlight/ve.ui.MWSyntaxHighlightDialogTool.js b/modules/ve-syntaxhighlight/ve.ui.MWSyntaxHighlightDialogTool.js index 8d5ad55..dbc7516 100644 --- a/modules/ve-syntaxhighlight/ve.ui.MWSyntaxHighlightDialogTool.js +++ b/modules/ve-syntaxhighlight/ve.ui.MWSyntaxHighlightDialogTool.js @@ -5,8 +5,6 @@ * @license The MIT License (MIT); see LICENSE.txt */ -/*global ve, OO */ - /** * MediaWiki UserInterface syntax highlight tool. * diff --git a/modules/ve-syntaxhighlight/ve.ui.MWSyntaxHighlightInspectorTool.js b/modules/ve-syntaxhighlight/ve.ui.MWSyntaxHighlightInspectorTool.js index 8df12c4..2eb42d6 100644 --- a/modules/ve-syntaxhighlight/ve.ui.MWSyntaxHighlightInspectorTool.js +++ b/modules/ve-syntaxhighlight/ve.ui.MWSyntaxHighlightInspectorTool.js @@ -5,8 +5,6 @@ * @license The MIT License (MIT); see LICENSE.txt */ -/*global ve, OO */ - /** * MediaWiki UserInterface syntax highlight tool. * diff --git a/package.json b/package.json index 1213ca9..3b8521c 100644 --- a/package.json +++ b/package.json @@ -7,12 +7,12 @@ "test": "grunt test" }, "devDependencies": { + "eslint-config-wikimedia": "0.3.0", "grunt": "1.0.1", "grunt-banana-checker": "0.5.0", - "grunt-contrib-jshint": "1.0.0", "grunt-contrib-watch": "1.0.0", - "grunt-jscs": "2.8.0", - "grunt-jsonlint": "1.0.7", + "grunt-eslint": "19.0.0", + "grunt-jsonlint": "1.0.8", "grunt-stylelint": "0.6.0", "stylelint-config-wikimedia": "0.3.0" } -- To view, visit https://gerrit.wikimedia.org/r/322412 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I503a57bed2ee6bb648697d6245af0b0286b5f3ec Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SyntaxHighlight_GeSHi Gerrit-Branch: master Gerrit-Owner: Esanders <esand...@wikimedia.org> Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits