From f9f01cf6b7bde8d012001978f92e70e899c4c2af Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Wed, 6 Feb 2019 01:26:47 +0000 Subject: [PATCH] build: Update eslint-config-wikimedia 0.10.1 Change-Id: I71b5c0a1b499865b56ef6957427cae7c97609d73 --- Gruntfile.js | 3 +++ modules/jquery.wikiEditor.dialogs.config.js | 1 - modules/jquery.wikiEditor.js | 6 +++--- modules/jquery.wikiEditor.toolbar.config.js | 4 ---- package.json | 4 ++-- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 376bb02e..59b4c3fe 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -8,6 +8,9 @@ module.exports = function ( grunt ) { grunt.initConfig( { eslint: { + options: { + reportUnusedDisableDirectives: true + }, all: [ '**/*.js', '!node_modules/**', diff --git a/modules/jquery.wikiEditor.dialogs.config.js b/modules/jquery.wikiEditor.dialogs.config.js index c93c34d6..f4b71152 100644 --- a/modules/jquery.wikiEditor.dialogs.config.js +++ b/modules/jquery.wikiEditor.dialogs.config.js @@ -973,7 +973,6 @@ end: end } ); $textarea.textSelection( 'scrollToCaretPosition' ); $( this ).data( 'offset', end ); - // eslint-disable-next-line jquery/no-event-shorthand $textarea[ 0 ].focus(); } } ); diff --git a/modules/jquery.wikiEditor.js b/modules/jquery.wikiEditor.js index 1d6ca1bb..cb5814fc 100644 --- a/modules/jquery.wikiEditor.js +++ b/modules/jquery.wikiEditor.js @@ -426,7 +426,7 @@ * Save text selection */ saveSelection: function () { - context.$textarea.focus(); + context.$textarea.trigger( 'focus' ); context.savedSelection = { selectionStart: context.$textarea[ 0 ].selectionStart, selectionEnd: context.$textarea[ 0 ].selectionEnd @@ -438,7 +438,7 @@ */ restoreSelection: function () { if ( context.savedSelection ) { - context.$textarea.focus(); + context.$textarea.trigger( 'focus' ); context.$textarea[ 0 ].setSelectionRange( context.savedSelection.selectionStart, context.savedSelection.selectionEnd ); context.savedSelection = null; } @@ -478,7 +478,7 @@ context.$textarea.prop( 'scrollTop', $( '#wpScrolltop' ).val() ); // Restore focus and cursor if needed if ( hasFocus ) { - context.$textarea.focus(); + context.$textarea.trigger( 'focus' ); context.$textarea.textSelection( 'setSelection', { start: cursorPos[ 0 ], end: cursorPos[ 1 ] } ); } diff --git a/modules/jquery.wikiEditor.toolbar.config.js b/modules/jquery.wikiEditor.toolbar.config.js index 41f03cb7..edb161e3 100644 --- a/modules/jquery.wikiEditor.toolbar.config.js +++ b/modules/jquery.wikiEditor.toolbar.config.js @@ -23,10 +23,8 @@ action: { type: 'encapsulate', options: { - // eslint-disable-next-line quotes pre: "'''", periMsg: 'wikieditor-toolbar-tool-bold-example', - // eslint-disable-next-line quotes post: "'''" } } @@ -41,10 +39,8 @@ action: { type: 'encapsulate', options: { - // eslint-disable-next-line quotes pre: "''", periMsg: 'wikieditor-toolbar-tool-italic-example', - // eslint-disable-next-line quotes post: "''" } } diff --git a/package.json b/package.json index ad79c10a..329ce476 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,9 @@ "test": "grunt test" }, "devDependencies": { - "eslint-config-wikimedia": "0.10.0", + "eslint-config-wikimedia": "0.10.1", "grunt": "1.0.3", - "grunt-banana-checker": "0.6.0", + "grunt-banana-checker": "0.7.0", "grunt-eslint": "21.0.0", "grunt-jsonlint": "1.1.0", "grunt-stylelint": "0.10.1",