Problem/Motivation
The eslint rules used in #3239134: Refactor (if feasible) uses of the jQuery val function to use VanillaJS is not catching all usage of .val() it is still used in the following files:
core/misc/states.es6.js
return this.val() === '';
return this.filter(':checked').val() || false;
return this.val();
return this.filter(':checked').val() || false;
return this.val();
core/modules/ckeditor/js/models/Model.es6.js
this.get('$textarea').val(
core/modules/color/preview.es6.js
form.find('.color-palette input[name="palette[base]"]').val(),
form.find('.color-palette input[name="palette[text]"]').val(),
form.find('.color-palette input[name="palette[link]"]').val(),
.val(),
.val(),
core/modules/filter/filter.filter_html.admin.es6.js
this.$allowedHTMLFormItem.val(
this.$allowedHTMLFormItem.val(this._generateSetting(this.userTags));
// This one is a legitimate use
core/modules/quickedit/js/views/EditorView.es6.js
.val(value);
core/themes/claro/js/vertical-tabs.es6.js
.val(this.details.attr('id'));
We should also open an issue in the upstream project.
Steps to reproduce
Proposed resolution
Update states.js
Do not change jquery.form.js because it is excluded from eslint
Remaining tasks
Open an issue in the upstream project.