Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Nov 5, 2025

Follow-on after #14814. Small perf optimization. cwd is either null or a string, so use cheaper === null check instead of ?? (which is equivalent to cwd === null || cwd === undefined).

Also rename the var, just for brevity.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI C-performance Category - Solution not expected to change functional behavior, only performance labels Nov 5, 2025
Copy link
Member Author


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 November 5, 2025 10:32
Copilot AI review requested due to automatic review settings November 5, 2025 10:32
@overlookmotel overlookmotel self-assigned this Nov 5, 2025
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Nov 5, 2025
Copy link
Member Author

overlookmotel commented Nov 5, 2025

Merge activity

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 current working directory caching mechanism in the Context class. The change removes the getInternal validation check when accessing context.cwd since the current working directory is a global property that can be safely accessed even within createOnce.

  • Renamed cachedCwd to cwd for clarity
  • Removed the getInternal() guard from the cwd getter to allow access in createOnce
  • Replaced nullish coalescing with an explicit null check

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

Follow-on after #14814. Small perf optimization. `cwd` is either `null` or a string, so use cheaper `=== null` check instead of `??` (which is equivalent to `cwd === null || cwd === undefined`).

Also rename the var, just for brevity.
@graphite-app graphite-app bot force-pushed the 11-04-perf_linter_plugins_faster_check_for_cwd_ branch from 074d0f0 to ee9f2f4 Compare November 5, 2025 10:38
@graphite-app graphite-app bot merged commit ee9f2f4 into main Nov 5, 2025
18 checks passed
@graphite-app graphite-app bot deleted the 11-04-perf_linter_plugins_faster_check_for_cwd_ branch November 5, 2025 10:44
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 5, 2025
@Boshen Boshen mentioned this pull request Nov 5, 2025
graphite-app bot pushed a commit that referenced this pull request Nov 8, 2025
…interop mode (#15488)

#15301 made `Context#cwd` available in `createOnce`. Make it available in ESLint compat mode too. Ditto the `extend` method added in #15477.

Define all other `Context` methods/getters on prototype of `Context` in ESLint compat mode, for completeness.
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 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