Skip to content

Commit

Permalink
feat(lint): remove global undefined variable shadow
Browse files Browse the repository at this point in the history
Modernize code using eslint advisory introduced in GH-2596. This PR focuses on fixing no-shadow-restricted-names rule.

Discussed in #2589 (comment), it fixes the rule cleanly and the impact on the total JS size is minimal (<1%).
  • Loading branch information
mvorisek authored Dec 20, 2022
1 parent b0a1399 commit 2753e1d
Show file tree
Hide file tree
Showing 26 changed files with 25 additions and 26 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ module.exports = {
eqeqeq: 'off', // about 20 errors to be fixed manually
'global-require': 'off', // about 30 errors to be fixed manually
'no-shadow': 'off', // about 220 errors to be fixed manually
'no-shadow-restricted-names': 'off', // TODO https://github.com/fomantic/Fomantic-UI/pull/2604
'prefer-arrow-callback': 'off', // about 350 errors (all autofixable)
},
reportUnusedDisableDirectives: true,
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/behaviors/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/

(function ($, window, document, undefined) {
(function ($, window, document) {
'use strict';

function isWindow(obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/behaviors/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/

(function ($, window, document, undefined) {
(function ($, window, document) {
'use strict';

function isFunction(obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/behaviors/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/

(function ($, window, document, undefined) {
(function ($, window, document) {
'use strict';

function isFunction(obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/behaviors/visibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/

(function ($, window, document, undefined) {
(function ($, window, document) {
'use strict';

function isFunction(obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/globals/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/

(function ($, window, document, undefined) {
(function ($, window, document) {
'use strict';

function isFunction(obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/

(function ($, window, document, undefined) {
(function ($, window, document) {
'use strict';

function isFunction(obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/

(function ($, window, document, undefined) {
(function ($, window, document) {
'use strict';

function isFunction(obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/

(function ($, window, document, undefined) {
(function ($, window, document) {
'use strict';

function isFunction(obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/dimmer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/

(function ($, window, document, undefined) {
(function ($, window, document) {
'use strict';

function isFunction(obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/

(function ($, window, document, undefined) {
(function ($, window, document) {
'use strict';

function isFunction(obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/

(function ($, window, document, undefined) {
(function ($, window, document) {
'use strict';

function isFunction(obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/flyout.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/

(function ($, window, document, undefined) {
(function ($, window, document) {
'use strict';

function isFunction(obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/

(function ($, window, document, undefined) {
(function ($, window, document) {
'use strict';

function isFunction(obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/nag.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/

(function ($, window, document, undefined) {
(function ($, window, document) {
'use strict';

function isFunction(obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/

(function ($, window, document, undefined) {
(function ($, window, document) {
'use strict';

function isFunction(obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/

(function ($, window, document, undefined) {
(function ($, window, document) {
'use strict';

function isFunction(obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/rating.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/

(function ($, window, document, undefined) {
(function ($, window, document) {
'use strict';

function isFunction(obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/

(function ($, window, document, undefined) {
(function ($, window, document) {
'use strict';

function isFunction(obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/shape.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/

(function ($, window, document, undefined) {
(function ($, window, document) {
'use strict';

function isFunction(obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/

(function ($, window, document, undefined) {
(function ($, window, document) {
'use strict';

function isFunction(obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/

(function ($, window, document, undefined) {
(function ($, window, document) {
'use strict';

function isFunction(obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/sticky.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/

(function ($, window, document, undefined) {
(function ($, window, document) {
'use strict';

function isFunction(obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/

(function ($, window, document, undefined) {
(function ($, window, document) {
'use strict';

function isWindow(obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/

(function ($, window, document, undefined) {
(function ($, window, document) {
'use strict';

function isFunction(obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/modules/transition.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/

(function ($, window, document, undefined) {
(function ($, window, document) {
'use strict';

function isFunction(obj) {
Expand Down

0 comments on commit 2753e1d

Please sign in to comment.