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",