From 7fbb5e990eb4ed2106c47b06819ba217ea95b268 Mon Sep 17 00:00:00 2001 From: xjm <xjm@65776.no-reply.drupal.org> Date: Tue, 24 Oct 2017 12:07:10 -0500 Subject: [PATCH] Issue #2916294 by dawehner: JS codestyle: no-useless-escape --- core/.eslintrc.passing.json | 1 - core/misc/tableresponsive.es6.js | 2 +- core/misc/tableresponsive.js | 2 +- core/modules/ckeditor/js/ckeditor.admin.es6.js | 2 +- core/modules/locale/locale.bulk.es6.js | 2 +- core/modules/locale/locale.bulk.js | 2 +- core/modules/quickedit/js/editors/formEditor.es6.js | 2 +- core/modules/quickedit/js/editors/formEditor.js | 2 +- core/modules/quickedit/js/views/EditorView.es6.js | 2 +- core/modules/quickedit/js/views/EditorView.js | 2 +- core/modules/quickedit/js/views/FieldToolbarView.es6.js | 2 +- core/modules/quickedit/js/views/FieldToolbarView.js | 2 +- core/modules/tour/js/tour.es6.js | 4 ++-- core/modules/tour/js/tour.js | 4 ++-- 14 files changed, 15 insertions(+), 16 deletions(-) diff --git a/core/.eslintrc.passing.json b/core/.eslintrc.passing.json index 8489a7d06186..d33b7cb17750 100644 --- a/core/.eslintrc.passing.json +++ b/core/.eslintrc.passing.json @@ -1,7 +1,6 @@ { "extends": "./.eslintrc.json", "rules": { - "no-useless-escape": "off", "no-use-before-define": "off", "no-throw-literal": "off", "no-shadow": "off", diff --git a/core/misc/tableresponsive.es6.js b/core/misc/tableresponsive.es6.js index 69d72679f955..8d1ae0115e77 100644 --- a/core/misc/tableresponsive.es6.js +++ b/core/misc/tableresponsive.es6.js @@ -144,7 +144,7 @@ // should be returned to the same state it was in before the columns // were revealed, so it is necessary to remove the display none value // from the style attribute. - const match = /^display\s*\:\s*none$/; + const match = /^display\s*:\s*none$/; for (let i = 0; i < properties.length; i++) { const prop = properties[i]; prop.trim(); diff --git a/core/misc/tableresponsive.js b/core/misc/tableresponsive.js index b955012cb3b6..d4fa6315cc11 100644 --- a/core/misc/tableresponsive.js +++ b/core/misc/tableresponsive.js @@ -79,7 +79,7 @@ var properties = $cell.attr('style').split(';'); var newProps = []; - var match = /^display\s*\:\s*none$/; + var match = /^display\s*:\s*none$/; for (var i = 0; i < properties.length; i++) { var prop = properties[i]; prop.trim(); diff --git a/core/modules/ckeditor/js/ckeditor.admin.es6.js b/core/modules/ckeditor/js/ckeditor.admin.es6.js index c875fd64a09c..4cf6a63e44be 100644 --- a/core/modules/ckeditor/js/ckeditor.admin.es6.js +++ b/core/modules/ckeditor/js/ckeditor.admin.es6.js @@ -194,7 +194,7 @@ .find('input') .addClass('error') .attr('aria-invalid', 'true'); - $(`<div class=\"description\" >${Drupal.t('Please provide a name for the button group.')}</div>`).insertAfter(form.elements[0]); + $(`<div class="description" >${Drupal.t('Please provide a name for the button group.')}</div>`).insertAfter(form.elements[0]); } return true; } diff --git a/core/modules/locale/locale.bulk.es6.js b/core/modules/locale/locale.bulk.es6.js index 1d72a0bad792..4fe32c3470fa 100644 --- a/core/modules/locale/locale.bulk.es6.js +++ b/core/modules/locale/locale.bulk.es6.js @@ -23,7 +23,7 @@ .on('change', function () { // If the filename is fully the language code or the filename // ends with a language code, pre-select that one. - const matches = $(this).val().match(/([^.][\.]*)([\w-]+)\.po$/); + const matches = $(this).val().match(/([^.][.]*)([\w-]+)\.po$/); if (matches && $langcode.find(`option[value="${matches[2]}"]`).length) { $langcode.val(matches[2]); } diff --git a/core/modules/locale/locale.bulk.js b/core/modules/locale/locale.bulk.js index f0ad15f963ec..dd84cf793c0b 100644 --- a/core/modules/locale/locale.bulk.js +++ b/core/modules/locale/locale.bulk.js @@ -12,7 +12,7 @@ if ($form.length) { var $langcode = $form.find('.langcode-input'); $form.find('.file-import-input').on('change', function () { - var matches = $(this).val().match(/([^.][\.]*)([\w-]+)\.po$/); + var matches = $(this).val().match(/([^.][.]*)([\w-]+)\.po$/); if (matches && $langcode.find('option[value="' + matches[2] + '"]').length) { $langcode.val(matches[2]); } diff --git a/core/modules/quickedit/js/editors/formEditor.es6.js b/core/modules/quickedit/js/editors/formEditor.es6.js index be658d37a954..c12308403d9c 100644 --- a/core/modules/quickedit/js/editors/formEditor.es6.js +++ b/core/modules/quickedit/js/editors/formEditor.es6.js @@ -92,7 +92,7 @@ const fieldModel = this.fieldModel; // Generate a DOM-compatible ID for the form container DOM element. - const id = `quickedit-form-for-${fieldModel.id.replace(/[\/\[\]]/g, '_')}`; + const id = `quickedit-form-for-${fieldModel.id.replace(/[/[\]]/g, '_')}`; // Render form container. const $formContainer = $(Drupal.theme('quickeditFormContainer', { diff --git a/core/modules/quickedit/js/editors/formEditor.js b/core/modules/quickedit/js/editors/formEditor.js index c4d875047435..8a872edc57ef 100644 --- a/core/modules/quickedit/js/editors/formEditor.js +++ b/core/modules/quickedit/js/editors/formEditor.js @@ -57,7 +57,7 @@ loadForm: function loadForm() { var fieldModel = this.fieldModel; - var id = 'quickedit-form-for-' + fieldModel.id.replace(/[\/\[\]]/g, '_'); + var id = 'quickedit-form-for-' + fieldModel.id.replace(/[/[\]]/g, '_'); var $formContainer = $(Drupal.theme('quickeditFormContainer', { id: id, diff --git a/core/modules/quickedit/js/views/EditorView.es6.js b/core/modules/quickedit/js/views/EditorView.es6.js index 12908943ada5..1a1a9845d53d 100644 --- a/core/modules/quickedit/js/views/EditorView.es6.js +++ b/core/modules/quickedit/js/views/EditorView.es6.js @@ -185,7 +185,7 @@ save() { const fieldModel = this.fieldModel; const editorModel = this.model; - const backstageId = `quickedit_backstage-${this.fieldModel.id.replace(/[\/\[\]\_\s]/g, '-')}`; + const backstageId = `quickedit_backstage-${this.fieldModel.id.replace(/[/[\]_\s]/g, '-')}`; function fillAndSubmitForm(value) { const $form = $(`#${backstageId}`).find('form'); diff --git a/core/modules/quickedit/js/views/EditorView.js b/core/modules/quickedit/js/views/EditorView.js index a4b05f45ea6a..f69238c2a34d 100644 --- a/core/modules/quickedit/js/views/EditorView.js +++ b/core/modules/quickedit/js/views/EditorView.js @@ -73,7 +73,7 @@ save: function save() { var fieldModel = this.fieldModel; var editorModel = this.model; - var backstageId = 'quickedit_backstage-' + this.fieldModel.id.replace(/[\/\[\]\_\s]/g, '-'); + var backstageId = 'quickedit_backstage-' + this.fieldModel.id.replace(/[/[\]_\s]/g, '-'); function fillAndSubmitForm(value) { var $form = $('#' + backstageId).find('form'); diff --git a/core/modules/quickedit/js/views/FieldToolbarView.es6.js b/core/modules/quickedit/js/views/FieldToolbarView.es6.js index 13e0457b5d32..12d23170b962 100644 --- a/core/modules/quickedit/js/views/FieldToolbarView.es6.js +++ b/core/modules/quickedit/js/views/FieldToolbarView.es6.js @@ -47,7 +47,7 @@ this.$root = this.$el; // Generate a DOM-compatible ID for the form container DOM element. - this._id = `quickedit-toolbar-for-${this.model.id.replace(/[\/\[\]]/g, '_')}`; + this._id = `quickedit-toolbar-for-${this.model.id.replace(/[/[\]]/g, '_')}`; this.listenTo(this.model, 'change:state', this.stateChange); }, diff --git a/core/modules/quickedit/js/views/FieldToolbarView.js b/core/modules/quickedit/js/views/FieldToolbarView.js index 578526b20bc8..0405f40da4ea 100644 --- a/core/modules/quickedit/js/views/FieldToolbarView.js +++ b/core/modules/quickedit/js/views/FieldToolbarView.js @@ -19,7 +19,7 @@ this.$root = this.$el; - this._id = 'quickedit-toolbar-for-' + this.model.id.replace(/[\/\[\]]/g, '_'); + this._id = 'quickedit-toolbar-for-' + this.model.id.replace(/[/[\]]/g, '_'); this.listenTo(this.model, 'change:state', this.stateChange); }, diff --git a/core/modules/tour/js/tour.es6.js b/core/modules/tour/js/tour.es6.js index f3b11072b1ac..669a82db71a8 100644 --- a/core/modules/tour/js/tour.es6.js +++ b/core/modules/tour/js/tour.es6.js @@ -154,8 +154,8 @@ }, // HTML segments for tip layout. template: { - link: '<a href=\"#close\" class=\"joyride-close-tip\">×</a>', - button: '<a href=\"#\" class=\"button button--primary joyride-next-tip\"></a>', + link: '<a href="#close" class="joyride-close-tip">×</a>', + button: '<a href="#" class="button button--primary joyride-next-tip"></a>', }, }); this.model.set({ isActive: true, activeTour: $tour }); diff --git a/core/modules/tour/js/tour.js b/core/modules/tour/js/tour.js index f20796a43681..afe1b14bd72c 100644 --- a/core/modules/tour/js/tour.js +++ b/core/modules/tour/js/tour.js @@ -71,8 +71,8 @@ }, template: { - link: '<a href=\"#close\" class=\"joyride-close-tip\">×</a>', - button: '<a href=\"#\" class=\"button button--primary joyride-next-tip\"></a>' + link: '<a href="#close" class="joyride-close-tip">×</a>', + button: '<a href="#" class="button button--primary joyride-next-tip"></a>' } }); this.model.set({ isActive: true, activeTour: $tour }); -- GitLab