Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(linter): check is_reference_to_global_variable in `no-array-const…
…ructor` (#7067) Hello, I am currently reading through the code as I work on contributing by creating some ESLint rules. Along the way, I noticed an incompatibility in certain cases within the `no-array-constructor` rule. In this PR, I added test cases and modified the code to include a check for is_reference_to_global_variable. The relevant ESLint behavior can be verified in the following playground. https://eslint.org/play/#eyJ0ZXh0IjoiLyplc2xpbnQgbm8tYXJyYXktY29uc3RydWN0b3I6IFwiZXJyb3JcIiovXG5cbi8vIGlmIGNvbW1lbnQgb3V0IGJlbG93LCBuZXh0IGxpbmUgYXMgZXJyb3JcbnZhciBBcnJheTsgbmV3IEFycmF5KCk7XG5cbm5ldyBBcnJheSgpOyIsIm9wdGlvbnMiOnsicnVsZXMiOnt9LCJsYW5ndWFnZU9wdGlvbnMiOnsic291cmNlVHlwZSI6Im1vZHVsZSIsInBhcnNlck9wdGlvbnMiOnsiZWNtYUZlYXR1cmVzIjp7fX19fX0=
- Loading branch information