Skip to content

refactor(linter/plugins): cwd set per file#18701

Merged
graphite-app[bot] merged 1 commit into
mainfrom
om/01-29-refactor_linter_plugins_cwd_set_per_file
Jan 30, 2026
Merged

refactor(linter/plugins): cwd set per file#18701
graphite-app[bot] merged 1 commit into
mainfrom
om/01-29-refactor_linter_plugins_cwd_set_per_file

Conversation

@overlookmotel
Copy link
Copy Markdown
Member

@overlookmotel overlookmotel commented Jan 29, 2026

Pass cwd into setupFileContext, so it can be set per file, rather than being a global setting.

This is preamble to #17809. This PR is some of the changes from that one split off, so the diff on #17809 is focused just on that one change.

This PR does nothing in itself, as currently process.cwd() is always passed to setupFileContext.

@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 29, 2026
Copy link
Copy Markdown
Member Author

overlookmotel commented Jan 29, 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.

Copy link
Copy Markdown
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

Refactors the oxlint JS plugin context setup so cwd can be set per file by passing it into setupFileContext, paving the way for workspace isolation work (see #17809).

Changes:

  • Update setupFileContext to accept (filePath, cwd) and clear cwd in resetFileContext.
  • Update the linter entrypoint (lintFileImpl) to pass a cwd value into setupFileContext.
  • Update affected tests to provide both an absolute file path and a cwd.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
apps/oxlint/test/tokens.test.ts Updates test setup to pass absolute path and cwd into setupFileContext.
apps/oxlint/test/isSpaceBetween.test.ts Updates parse helper to derive path from cwd + filename and pass cwd into setupFileContext.
apps/oxlint/src-js/plugins/lint.ts Passes cwd into setupFileContext (currently via a module-level constant).
apps/oxlint/src-js/plugins/context.ts Changes setupFileContext signature to accept per-file cwd and updates cwd getters/reset logic.

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

Comment thread apps/oxlint/src-js/plugins/lint.ts
@overlookmotel overlookmotel self-assigned this Jan 30, 2026
@graphite-app graphite-app Bot added the 0-merge Merge with Graphite Merge Queue label Jan 30, 2026
@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app Bot commented Jan 30, 2026

Merge activity

Pass `cwd` into `setupFileContext`, so it can be set per file, rather than being a global setting.

This is preamble to #17809. This PR is some of the changes from that one split off, so the diff on #17809 is focused just on that one change.

This PR does nothing in itself, as currently `process.cwd()` is always passed to `setupFileContext`.
@graphite-app graphite-app Bot force-pushed the om/01-29-refactor_linter_plugins_cwd_set_per_file branch from 24a259b to 3818486 Compare January 30, 2026 01:13
@graphite-app graphite-app Bot merged commit 3818486 into main Jan 30, 2026
19 checks passed
@graphite-app graphite-app Bot deleted the om/01-29-refactor_linter_plugins_cwd_set_per_file branch January 30, 2026 01:22
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Jan 30, 2026
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.

3 participants