Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Nov 8, 2025

#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.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI C-bug Category - Bug labels Nov 8, 2025
Copy link
Member Author

overlookmotel commented Nov 8, 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.

@overlookmotel overlookmotel marked this pull request as ready for review November 8, 2025 14:25
Copilot AI review requested due to automatic review settings November 8, 2025 14:25
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 adds ESLint compatibility support for the createOnce API by implementing a shim FILE_CONTEXT object in index.ts that mirrors the main implementation. The shim provides limited context functionality (only cwd property and extend method) available during createOnce calls, while throwing errors for other properties that should not be accessed at that stage.

  • Exports FileContext type from context.ts for reuse in index.ts
  • Implements a FILE_CONTEXT shim in index.ts for ESLint compatibility
  • Updates createContextAndVisitor to use the new FILE_CONTEXT as prototype

Reviewed Changes

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

File Description
apps/oxlint/src-js/plugins/context.ts Exports FileContext type and adds a comment noting the need to sync getCwd implementation with the ESLint shim
apps/oxlint/src-js/index.ts Adds ESLint-compatible FILE_CONTEXT shim for createOnce calls, imports necessary types, and updates createContextAndVisitor to use the new prototype

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

@overlookmotel overlookmotel force-pushed the 11-08-fix_linter_plugins_allow_access_to_cwd_in_createonce_in_eslint_interop_mode branch from 24b5f8e to ee9287b Compare November 8, 2025 14:40
@overlookmotel overlookmotel self-assigned this Nov 8, 2025
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Nov 8, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 8, 2025

Merge activity

…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.
@graphite-app graphite-app bot force-pushed the 11-08-fix_linter_plugins_allow_access_to_cwd_in_createonce_in_eslint_interop_mode branch from ee9287b to 7409630 Compare November 8, 2025 14:46
@graphite-app graphite-app bot merged commit 7409630 into main Nov 8, 2025
18 checks passed
@graphite-app graphite-app bot deleted the 11-08-fix_linter_plugins_allow_access_to_cwd_in_createonce_in_eslint_interop_mode branch November 8, 2025 14:52
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 8, 2025
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-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants