From 5cac43ddd34705cd69af6b19af7935afb19a7c21 Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Wed, 6 Feb 2019 01:34:32 +0000 Subject: [PATCH] build: Update eslint-config-wikimedia to 0.11.0 Change-Id: I99fd10fbcce5d5e6b87b6e3faeb7b18c4e573ef7 --- .gitignore | 1 + Gruntfile.js | 4 ++++ modules/ext.codeEditor.js | 1 + modules/jquery.codeEditor.js | 10 ++++++---- package.json | 2 +- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index f4a48da7..f4e28032 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ node_modules/ vendor/ ace-git/ composer.lock +.eslintcache # Editors *.kate-swp diff --git a/Gruntfile.js b/Gruntfile.js index eee7bc58..921ee1e9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -18,6 +18,10 @@ module.exports = function ( grunt ) { grunt.initConfig( { eslint: { + options: { + reportUnusedDisableDirectives: true, + cache: true + }, all: [ '**/*.js', '!node_modules/**', diff --git a/modules/ext.codeEditor.js b/modules/ext.codeEditor.js index 7f77ff31..f9db4270 100644 --- a/modules/ext.codeEditor.js +++ b/modules/ext.codeEditor.js @@ -22,6 +22,7 @@ */ $( function () { + // eslint-disable-next-line no-jquery/no-global-selector var $wpTextbox1 = $( '#wpTextbox1' ); // Code is supposed to be always LTR. See bug 39364. diff --git a/modules/jquery.codeEditor.js b/modules/jquery.codeEditor.js index 60bc834e..bdfdef41 100644 --- a/modules/jquery.codeEditor.js +++ b/modules/jquery.codeEditor.js @@ -1,5 +1,6 @@ /* Ace syntax-highlighting code editor extension for wikiEditor */ /* global ace */ +/* eslint-disable no-jquery/no-global-selector */ ( function () { $.wikiEditor.modules.codeEditor = { /** @@ -358,6 +359,7 @@ // Ace doesn't like replacing a textarea directly. // We'll stub this out to sit on top of it... // line-height is needed to compensate for oddity in WikiEditor extension, which zeroes the line-height on a parent container + // eslint-disable-next-line no-jquery/no-parse-html-literal container = context.$codeEditorContainer = $( '
' ).insertAfter( box ); editdiv = container.find( '.editor' ); @@ -506,9 +508,9 @@ delayedUpdate, editor = context.codeEditor, lang = ace.require( 'ace/lib/lang' ), - $errors = $( '0' ), - $warnings = $( '0' ), - $infos = $( '0' ), + $errors = $( '' ).addClass( 'codeEditor-status-worker-cell ace_gutter-cell ace_error' ).text( '0' ), + $warnings = $( '' ).addClass( 'codeEditor-status-worker-cell ace_gutter-cell ace_warning' ).text( '0' ), + $infos = $( '' ).addClass( 'codeEditor-status-worker-cell ace_gutter-cell ace_info' ).text( '0' ), $message = $( '
' ).addClass( 'codeEditor-status-message' ), $lineAndMode = $( '
' ).addClass( 'codeEditor-status-line' ), $workerStatus = $( '
' ) @@ -683,7 +685,7 @@ * @param {Object} extended */ saveAndExtend = function ( base, extended ) { - // eslint-disable-next-line jquery/no-map-util + // eslint-disable-next-line no-jquery/no-map-util $.map( extended, function ( func, name ) { var orig; if ( name in base ) { diff --git a/package.json b/package.json index f9a898a0..bace1c1a 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ }, "devDependencies": { "ace-builds": "1.2.9", - "eslint-config-wikimedia": "0.9.0", + "eslint-config-wikimedia": "0.11.0", "grunt": "1.0.3", "grunt-banana-checker": "0.6.0", "grunt-contrib-clean": "2.0.0",