fix(linter): check is_reference_to_global_variable in no-array-constructor rule#7067
Merged
camc314 merged 3 commits intooxc-project:mainfrom Nov 2, 2024
Conversation
Contributor
Your org has enabled the Graphite merge queue for merging into mainAdd the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
CodSpeed Performance ReportMerging #7067 will not alter performanceComparing Summary
|
camchenry
approved these changes
Nov 2, 2024
Co-authored-by: Cam McHenry <[email protected]>
camc314
approved these changes
Nov 2, 2024
camc314
approved these changes
Nov 2, 2024
camchenry
approved these changes
Nov 2, 2024
Boshen
added a commit
that referenced
this pull request
Nov 3, 2024
## [0.11.0] - 2024-11-03 - 9fd9f4f linter: [**BREAKING**] Sync sindresorhus/globals; removed Object.prototype properties from builtin and es* globals (#6991) (Boshen) ### Features - 6b619da editor: Listen to config file changes and trigger a didChangeConfiguration update (#6964) (Nicholas Rayburn) - 7872927 editor/vscode: Support window/showMessage event (#7085) (Nicholas Rayburn) - 2184588 linter: Do not bail for unmatched rules yet (#7093) (Boshen) - a6fcd81 linter: Add `import/no-commonjs` rule (#6978) (Dmitry Zakharov) - 1691cab linter: Support user-configurable secrets for `oxc-security/api-keys` (#5938) (DonIsaac) - 610621c linter: Implement `react/style-prop-object` (#6342) (Albert Kaaman) - 1e2f012 linter: Add `oxc/no-map-spread` (#6751) (DonIsaac) - 1c66473 linter: Implement `eslint/prefer-object-has-own` (#6905) (tomoya yanagibashi) ### Bug Fixes - ebf3753 editor: Fix onConfigChange to send the correct config for didChangeConfiguration notification (#6962) (Nicholas Rayburn) - 79bf74a linter: Check is_reference_to_global_variable in `no-array-constructor` (#7067) (Naoya Yoshizawa) - 38d1f78 linter: Remove confusing help text for now (#7081) (Cam McHenry) - 147e2e4 linter: Allow replacing rule when none are enabled yet (#7014) (camchenry) - 7aa496a linter: Remove unsafe fixer of `no-useless-spread` (#6655) (dalaoshu) - f5a7134 linter/no-unused-vars: False positive for discarded reads within sequences (#6907) (DonIsaac) ### Documentation - 4551baa linter: Document `rules` (#6983) (Boshen) ### Refactor - a8dc75d linter: Remove unused CLI result types (#7088) (camchenry) - 8f1460e linter: Move `LintPlugins` from `LintOptions` to `LintConfig` (#6932) (DonIsaac) ### Testing - c35d3f2 linter: Improve test failure output (#6975) (camchenry) --------- Co-authored-by: Boshen <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-constructorrule.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=