Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

refactor(rome_js_analyze): improve consistency of rules that concern globals #4654

Merged
merged 1 commit into from
Jul 4, 2023
Merged

refactor(rome_js_analyze): improve consistency of rules that concern globals #4654

merged 1 commit into from
Jul 4, 2023

Conversation

Conaclos
Copy link
Contributor

@Conaclos Conaclos commented Jul 4, 2023

Summary

This PR improves the consistency between rules that verifies the use of global identifiers.
All rules now correctly resolves recursive use of globalThis and window.

For example, the following code is now correctly reported by noConsoleLog:

globalThis["globalThis"].window.console.log("log");

Test Plan

New tests added.

@netlify
Copy link

netlify bot commented Jul 4, 2023

Deploy Preview for docs-rometools ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 78e34f1
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/64a4875be973ee000896d671
😎 Deploy Preview https://deploy-preview-4654--docs-rometools.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Conaclos Conaclos requested a review from ematipico July 4, 2023 12:52
@github-actions github-actions bot added A-Linter Area: linter A-Parser Area: parser labels Jul 4, 2023
Copy link
Contributor

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

The weird things of the JS world! 😄

crates/rome_js_syntax/src/expr_ext.rs Outdated Show resolved Hide resolved
crates/rome_js_syntax/src/expr_ext.rs Outdated Show resolved Hide resolved
crates/rome_js_syntax/src/expr_ext.rs Show resolved Hide resolved
crates/rome_js_syntax/src/static_value.rs Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@Conaclos Conaclos merged commit f65b0d9 into rome:main Jul 4, 2023
18 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Linter Area: linter A-Parser Area: parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants