Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Dec 11, 2025

This check is unnecessary as in order to obtain languageOptions, you have to go through context.languageOptions getter which already does the check.

If user hold onto the returned languageOptions object and accesses globals on it in a tick in between linting files, they'll just get null anyway.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI A-linter-plugins Area - Linter JS plugins labels Dec 11, 2025
Copy link
Member Author

overlookmotel commented Dec 11, 2025


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.

@github-actions github-actions bot added the C-performance Category - Solution not expected to change functional behavior, only performance label Dec 11, 2025
@overlookmotel overlookmotel marked this pull request as ready for review December 11, 2025 12:52
Copilot AI review requested due to automatic review settings December 11, 2025 12:52
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 removes a redundant filePath === null check from the globals getter within LANGUAGE_OPTIONS. The check is unnecessary because the context.languageOptions getter already validates that filePath is not null before returning the LANGUAGE_OPTIONS object. This improves code quality by eliminating redundant defensive programming that doesn't add value.

Key changes:

  • Removed 4 lines containing a redundant null check for filePath in the LANGUAGE_OPTIONS.globals getter

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

@graphite-app
Copy link
Contributor

graphite-app bot commented Dec 11, 2025

Merge activity

This check is unnecessary as in order to obtain `languageOptions`, you have to go through `context.languageOptions` getter which already does the check.

If user hold onto the returned `languageOptions` object and accesses `globals` on it in a tick in between linting files, they'll just get `null` anyway.
@graphite-app graphite-app bot force-pushed the 12-11-style_linter_plugins_use_block_for_multi-line_if_statement branch from a83f4ed to 886e938 Compare December 11, 2025 13:09
@graphite-app graphite-app bot force-pushed the 12-11-perf_linter_plugins_remove_unnecessary_check branch from 6342619 to 4f9d17f Compare December 11, 2025 13:10
Base automatically changed from 12-11-style_linter_plugins_use_block_for_multi-line_if_statement to main December 11, 2025 13:15
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 11, 2025
@graphite-app graphite-app bot merged commit 4f9d17f into main Dec 11, 2025
19 checks passed
@graphite-app graphite-app bot deleted the 12-11-perf_linter_plugins_remove_unnecessary_check branch December 11, 2025 13:16
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-performance Category - Solution not expected to change functional behavior, only performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants