diff options
| author | Greg <supahgreg@users.noreply.github.com> | 2025-10-13 23:39:24 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-13 23:39:24 -0500 |
| commit | 6505cbb592b91556ca25a2bf72ad1d8cb0b3bc2a (patch) | |
| tree | 8ab133cc17a329ef7d99d152b3f6b4edc3830509 /js/form | |
| parent | 0d2b1d601294802286aa26e5486c1c4fee92c05a (diff) | |
| parent | 8b46ab31a96b6b6129f624719ac33ddf761805f1 (diff) | |
Merge pull request #42 from tt-rss/bugfix/eslint-config-and-findings
Get ESLint 9.x working, make the new config stricter, address findings
Diffstat (limited to 'js/form')
| -rwxr-xr-x | js/form/ComboButton.js | 3 | ||||
| -rwxr-xr-x | js/form/DropDownButton.js | 3 | ||||
| -rwxr-xr-x | js/form/Select.js | 7 | ||||
| -rw-r--r-- | js/form/ValidationMultiSelect.js | 6 | ||||
| -rw-r--r-- | js/form/ValidationTextArea.js | 6 |
5 files changed, 10 insertions, 15 deletions
diff --git a/js/form/ComboButton.js b/js/form/ComboButton.js index 2ad4bf123..98386eead 100755 --- a/js/form/ComboButton.js +++ b/js/form/ComboButton.js @@ -1,5 +1,4 @@ -/* eslint-disable prefer-rest-params */ -/* global dijit, define */ +/* global define */ define(["dojo/_base/declare", "dijit/form/ComboButton"], function (declare) { return declare("fox.form.ComboButton", dijit.form.ComboButton, { startup: function() { diff --git a/js/form/DropDownButton.js b/js/form/DropDownButton.js index d5ea39726..60d8e86ef 100755 --- a/js/form/DropDownButton.js +++ b/js/form/DropDownButton.js @@ -1,5 +1,4 @@ -/* eslint-disable prefer-rest-params */ -/* global dijit, define */ +/* global define */ define(["dojo/_base/declare", "dijit/form/DropDownButton"], function (declare) { return declare("fox.form.DropDownButton", dijit.form.DropDownButton, { startup: function() { diff --git a/js/form/Select.js b/js/form/Select.js index 0c73cd52c..c44674e2a 100755 --- a/js/form/Select.js +++ b/js/form/Select.js @@ -1,4 +1,3 @@ -/* eslint-disable prefer-rest-params */ /* global define */ // FIXME: there probably is a better, more dojo-like notation for custom data- properties define(["dojo/_base/declare", @@ -15,7 +14,7 @@ define(["dojo/_base/declare", startup: function() { this.inherited(arguments); - if (this.attr('data-dropdown-skip-first') == 'true') { + if (this.attr('data-dropdown-skip-first') === 'true') { aspect.before(this, "_loadChildren", () => { this.options = this.options.splice(1); }); @@ -25,8 +24,8 @@ define(["dojo/_base/declare", onItemClick: function(/*item, menu*/) { // }, - _setValueAttr: function(/*anything*/ newValue, /*Boolean?*/ priorityChange){ - if (this.attr('data-prevent-value-change') == 'true' && newValue != '') + _setValueAttr: function(/*anything*/ newValue, /*Boolean? priorityChange */){ + if (this.attr('data-prevent-value-change') === 'true' && newValue !== '') return; this.inherited(arguments); diff --git a/js/form/ValidationMultiSelect.js b/js/form/ValidationMultiSelect.js index 4e7263c61..5a7918271 100644 --- a/js/form/ValidationMultiSelect.js +++ b/js/form/ValidationMultiSelect.js @@ -6,12 +6,12 @@ define(["dojo/_base/declare", "dojo/_base/lang", "dijit/form/MultiSelect", ], function(declare, lang, MultiSelect) { return declare('fox.form.ValidationMultiSelect', [MultiSelect], { - constructor: function(params){ + constructor: function(/* params */) { this.constraints = {}; this.baseClass += ' dijitValidationMultiSelect'; }, - validate: function(/*Boolean*/ isFocused){ - if (this.required && this.attr('value').length == 0) + validate: function(/*Boolean isFocused */) { + if (this.required && this.attr('value').length === 0) return false; return true; diff --git a/js/form/ValidationTextArea.js b/js/form/ValidationTextArea.js index c53260f40..a71a490c1 100644 --- a/js/form/ValidationTextArea.js +++ b/js/form/ValidationTextArea.js @@ -1,16 +1,14 @@ // https://stackoverflow.com/questions/19317258/how-to-use-dijit-textarea-validation-dojo-1-9 -/* eslint-disable no-new */ /* global define */ define(["dojo/_base/declare", "dojo/_base/lang", "dijit/form/SimpleTextarea", "dijit/form/ValidationTextBox"], function(declare, lang, SimpleTextarea, ValidationTextBox) { return declare('fox.form.ValidationTextArea', [SimpleTextarea, ValidationTextBox], { - constructor: function(params){ + constructor: function(/* params */) { this.constraints = {}; this.baseClass += ' dijitValidationTextArea'; }, - // eslint-disable-next-line no-template-curly-in-string templateString: "<textarea ${!nameAttrSetting} data-dojo-attach-point='focusNode,containerNode,textbox' autocomplete='off'></textarea>", validator: function(value, constraints) { //console.log(this, value, constraints); @@ -21,7 +19,7 @@ define(["dojo/_base/declare", "dojo/_base/lang", "dijit/form/SimpleTextarea", "d if (this.validregexp) { try { new RegExp("/" + value + "/"); - } catch (e) { + } catch { return false; } } |