aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2025-03-03 20:15:14 +0100
committerGitHub <noreply@github.com>2025-03-03 20:15:14 +0100
commit1da395de2e6759dfe9a7a199b03a39365e30f16c (patch)
treeb597281911de6cde1682932ca9c242c0f8b5841d /ui
parent302b488b9214e14830496578f7cf0aebcc33c132 (diff)
downloadjquery-ui-1da395de2e6759dfe9a7a199b03a39365e30f16c.tar.gz
jquery-ui-1da395de2e6759dfe9a7a199b03a39365e30f16c.zip
Build: Update ESLint to v9, migrate to flat config, lint dist files
Dist files linting is limited to checking if they're proper ES5. Closes gh-2336
Diffstat (limited to 'ui')
-rw-r--r--ui/.eslintrc.json42
-rw-r--r--ui/effect.js4
-rw-r--r--ui/effects/effect-explode.js2
-rw-r--r--ui/widgets/accordion.js2
-rw-r--r--ui/widgets/datepicker.js10
-rw-r--r--ui/widgets/progressbar.js2
-rw-r--r--ui/widgets/resizable.js2
-rw-r--r--ui/widgets/selectmenu.js2
-rw-r--r--ui/widgets/tabs.js4
9 files changed, 9 insertions, 61 deletions
diff --git a/ui/.eslintrc.json b/ui/.eslintrc.json
deleted file mode 100644
index eaba81af2..000000000
--- a/ui/.eslintrc.json
+++ /dev/null
@@ -1,42 +0,0 @@
-{
- "root": true,
-
- "extends": "jquery",
-
- "parserOptions": {
- "ecmaVersion": 5
- },
-
- "env": {
- "browser": true,
- "jquery": true,
- "node": false
- },
-
- "rules": {
- "strict": [ "error", "function" ],
-
- // The following rule is relaxed due to too many violations:
- "no-unused-vars": [ "error", { "vars": "all", "args": "after-used" } ],
-
- // Too many violations:
- "camelcase": "off",
- "no-nested-ternary": "off"
- },
-
- "globals": {
- "define": false,
- "Globalize": false
- },
-
- "overrides": [
- {
- "files": [ "i18n/**/*.js" ],
- "rules": {
-
- // We want to keep all the strings in separate single lines
- "max-len": "off"
- }
- }
- ]
-}
diff --git a/ui/effect.js b/ui/effect.js
index bbbb733c3..cb9ab8043 100644
--- a/ui/effect.js
+++ b/ui/effect.js
@@ -9,9 +9,7 @@
//>>label: Effects Core
//>>group: Effects
-/* eslint-disable max-len */
//>>description: Extends the internal jQuery effects. Includes morphing and easing. Required by all other effects.
-/* eslint-enable max-len */
//>>docs: https://api.jqueryui.com/category/effects-core/
//>>demos: https://jqueryui.com/effect/
@@ -320,7 +318,7 @@ if ( $.uiBackCompat === true ) {
try {
// eslint-disable-next-line no-unused-expressions
active.id;
- } catch ( e ) {
+ } catch ( _e ) {
active = document.body;
}
diff --git a/ui/effects/effect-explode.js b/ui/effects/effect-explode.js
index ed40833a8..da38b4d55 100644
--- a/ui/effects/effect-explode.js
+++ b/ui/effects/effect-explode.js
@@ -9,9 +9,7 @@
//>>label: Explode Effect
//>>group: Effects
-/* eslint-disable max-len */
//>>description: Explodes an element in all directions into n pieces. Implodes an element to its original wholeness.
-/* eslint-enable max-len */
//>>docs: https://api.jqueryui.com/explode-effect/
//>>demos: https://jqueryui.com/effect/
diff --git a/ui/widgets/accordion.js b/ui/widgets/accordion.js
index ff6e4631d..43a50db83 100644
--- a/ui/widgets/accordion.js
+++ b/ui/widgets/accordion.js
@@ -9,9 +9,7 @@
//>>label: Accordion
//>>group: Widgets
-/* eslint-disable max-len */
//>>description: Displays collapsible content panels for presenting information in a limited amount of space.
-/* eslint-enable max-len */
//>>docs: https://api.jqueryui.com/accordion/
//>>demos: https://jqueryui.com/accordion/
//>>css.structure: ../../themes/base/core.css
diff --git a/ui/widgets/datepicker.js b/ui/widgets/datepicker.js
index 323723b89..029f255e8 100644
--- a/ui/widgets/datepicker.js
+++ b/ui/widgets/datepicker.js
@@ -1,4 +1,4 @@
-/* eslint-disable max-len, camelcase */
+/* eslint-disable max-len */
/*!
* jQuery UI Datepicker @VERSION
* https://jqueryui.com
@@ -535,7 +535,7 @@ $.extend( Datepicker.prototype, {
_getInst: function( target ) {
try {
return $.data( target, "datepicker" );
- } catch ( err ) {
+ } catch ( _err ) {
throw "Missing instance data for this datepicker";
}
},
@@ -768,7 +768,7 @@ $.extend( Datepicker.prototype, {
$.datepicker._updateAlternate( inst );
$.datepicker._updateDatepicker( inst );
}
- } catch ( err ) {
+ } catch ( _err ) {
}
}
return true;
@@ -1540,7 +1540,7 @@ $.extend( Datepicker.prototype, {
try {
date = this.parseDate( dateFormat, dates, settings ) || defaultDate;
- } catch ( event ) {
+ } catch ( _err ) {
dates = ( noDefault ? "" : dates );
}
inst.selectedDay = date.getDate();
@@ -1569,7 +1569,7 @@ $.extend( Datepicker.prototype, {
try {
return $.datepicker.parseDate( $.datepicker._get( inst, "dateFormat" ),
offset, $.datepicker._getFormatConfig( inst ) );
- } catch ( e ) {
+ } catch ( _e ) {
// Ignore
}
diff --git a/ui/widgets/progressbar.js b/ui/widgets/progressbar.js
index 20e96440a..ad5366ade 100644
--- a/ui/widgets/progressbar.js
+++ b/ui/widgets/progressbar.js
@@ -9,9 +9,7 @@
//>>label: Progressbar
//>>group: Widgets
-/* eslint-disable max-len */
//>>description: Displays a status indicator for loading state, standard percentage, and other progress indicators.
-/* eslint-enable max-len */
//>>docs: https://api.jqueryui.com/progressbar/
//>>demos: https://jqueryui.com/progressbar/
//>>css.structure: ../../themes/base/core.css
diff --git a/ui/widgets/resizable.js b/ui/widgets/resizable.js
index 6f1e0ebde..012315283 100644
--- a/ui/widgets/resizable.js
+++ b/ui/widgets/resizable.js
@@ -104,7 +104,7 @@ $.widget( "ui.resizable", $.ui.mouse, {
el[ scroll ] = 1;
has = ( el[ scroll ] > 0 );
el[ scroll ] = 0;
- } catch ( e ) {
+ } catch ( _e ) {
// `el` might be a string, then setting `scroll` will throw
// an error in strict mode; ignore it.
diff --git a/ui/widgets/selectmenu.js b/ui/widgets/selectmenu.js
index f1b48fa60..749e33491 100644
--- a/ui/widgets/selectmenu.js
+++ b/ui/widgets/selectmenu.js
@@ -9,9 +9,7 @@
//>>label: Selectmenu
//>>group: Widgets
-/* eslint-disable max-len */
//>>description: Duplicates and extends the functionality of a native HTML select element, allowing it to be customizable in behavior and appearance far beyond the limitations of a native select.
-/* eslint-enable max-len */
//>>docs: https://api.jqueryui.com/selectmenu/
//>>demos: https://jqueryui.com/selectmenu/
//>>css.structure: ../../themes/base/core.css
diff --git a/ui/widgets/tabs.js b/ui/widgets/tabs.js
index 7b7907c32..49468feb3 100644
--- a/ui/widgets/tabs.js
+++ b/ui/widgets/tabs.js
@@ -73,10 +73,10 @@ $.widget( "ui.tabs", {
// Decoding may throw an error if the URL isn't UTF-8 (#9518)
try {
anchorUrl = decodeURIComponent( anchorUrl );
- } catch ( error ) {}
+ } catch ( _error ) {}
try {
locationUrl = decodeURIComponent( locationUrl );
- } catch ( error ) {}
+ } catch ( _error ) {}
return anchor.hash.length > 1 && anchorUrl === locationUrl;
};