Skip to content

refactor(linter/plugins): reduce repeat code from createGlobalVariable#18318

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/01-21-refactor_linter_plugins_reduce_repeat_code_from_createglobalvariable_
Jan 21, 2026
Merged

refactor(linter/plugins): reduce repeat code from createGlobalVariable#18318
graphite-app[bot] merged 1 commit intomainfrom
om/01-21-refactor_linter_plugins_reduce_repeat_code_from_createglobalvariable_

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Jan 21, 2026

Pure refactor. Clean up the code to reduce repetition.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI A-linter-plugins Area - Linter JS plugins C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Jan 21, 2026
Copy link
Member Author

overlookmotel commented Jan 21, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@overlookmotel overlookmotel marked this pull request as ready for review January 21, 2026 01:11
Copilot AI review requested due to automatic review settings January 21, 2026 01:11
@overlookmotel overlookmotel self-assigned this Jan 21, 2026
@overlookmotel overlookmotel removed the request for review from camc314 January 21, 2026 01:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the createGlobalVariable function to eliminate code duplication by inverting the control flow. Previously, the same four properties were set in two separate code paths (when a variable exists vs. when it doesn't exist). The refactor consolidates this by creating the variable only if it doesn't exist, then always setting the properties afterwards.

Changes:

  • Inverted conditional logic from if (variable !== undefined) to if (variable === undefined)
  • Removed duplicate property assignments by placing them after the conditional block
  • Inlined the implicitGlobalSetting variable directly into the property assignment

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Jan 21, 2026
Copy link
Member Author

overlookmotel commented Jan 21, 2026

Merge activity

…le` (#18318)

Pure refactor. Clean up the code to reduce repetition.
@graphite-app graphite-app bot force-pushed the om/01-21-fix_linter_plugins_set_all_properties_on_global_vars_objects branch from 6a5b103 to 9e359d4 Compare January 21, 2026 01:31
@graphite-app graphite-app bot force-pushed the om/01-21-refactor_linter_plugins_reduce_repeat_code_from_createglobalvariable_ branch from 753d0f3 to 31bbe39 Compare January 21, 2026 01:32
Base automatically changed from om/01-21-fix_linter_plugins_set_all_properties_on_global_vars_objects to main January 21, 2026 01:38
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 21, 2026
@graphite-app graphite-app bot merged commit 31bbe39 into main Jan 21, 2026
20 checks passed
@graphite-app graphite-app bot deleted the om/01-21-refactor_linter_plugins_reduce_repeat_code_from_createglobalvariable_ branch January 21, 2026 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter A-linter-plugins Area - Linter JS plugins C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments