Skip to content

feat(lint): remove global undefined variable shadow #2604

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 20, 2022

Conversation

mvorisek
Copy link
Contributor

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%).

@mvorisek mvorisek changed the title fix no-shadow-restricted-names semimanually Do not shadow undefined variable Dec 12, 2022
@mvorisek mvorisek changed the title Do not shadow undefined variable Remove global undefined variable shadow Dec 12, 2022
@lubber-de
Copy link
Member

@fomantic/maintainers @fomantic/admins

What's your opinion about this? See comments regarding negative minimizer impact here
#2589 (comment)

@lubber-de lubber-de added lang/javascript Anything involving JavaScript state/awaiting-reviews Pull requests which are waiting for reviews labels Dec 12, 2022
@mvorisek mvorisek force-pushed the no_undefined_shadow branch from 78bd406 to 1620c2a Compare December 14, 2022 11:51
@mvorisek
Copy link
Contributor Author

The undefined can be still redefined in parent/including context in theory, but every other global variable like Proxy or window can, so this cannot be the reason to keep it. The size increase of less than 1% is really negligible and can be gained easily with other changes.

Copy link
Member

@lubber-de lubber-de left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lubber-de lubber-de changed the title Remove global undefined variable shadow feat(lint): remove global undefined variable shadow Dec 20, 2022
@lubber-de lubber-de merged commit 2753e1d into fomantic:develop Dec 20, 2022
@lubber-de lubber-de added type/ci Anything related to CI/CD type/lint eslint / stylelint related changes only and removed state/awaiting-reviews Pull requests which are waiting for reviews labels Dec 20, 2022
@lubber-de lubber-de added this to the 2.9.1 milestone Dec 20, 2022
@mvorisek mvorisek deleted the no_undefined_shadow branch December 20, 2022 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/javascript Anything involving JavaScript type/ci Anything related to CI/CD type/lint eslint / stylelint related changes only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants