Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Nov 8, 2025

extend method exists on ESLint's FileContext type. Replicate it here (copying impl from ESLint).

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI 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.

@github-actions github-actions bot added the C-enhancement Category - New feature or request label Nov 8, 2025
@overlookmotel overlookmotel marked this pull request as ready for review November 8, 2025 12:08
Copilot AI review requested due to automatic review settings November 8, 2025 12:08
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 a new extend method to the FILE_CONTEXT object that enables creating extended context objects with additional properties while maintaining prototypal inheritance. This supports patterns where plugins need to wrap or extend the context object with additional functionality.

Key Changes

  • Added assign and create destructured imports from Object for use in the new method
  • Implemented an extend method on FILE_CONTEXT that creates frozen context objects with extended properties

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

@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 8, 2025

Merge activity

`extend` method exists on ESLint's `FileContext` type. Replicate it here (copying impl from ESLint).
@graphite-app graphite-app bot force-pushed the 11-08-feat_linter_plugins_add_extend_method_to_file_context_ branch from 500413f to 5822cb4 Compare November 8, 2025 13:04
@graphite-app graphite-app bot merged commit 5822cb4 into main Nov 8, 2025
18 checks passed
@graphite-app graphite-app bot deleted the 11-08-feat_linter_plugins_add_extend_method_to_file_context_ branch November 8, 2025 13:10
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

0-merge Merge with Graphite Merge Queue A-cli Area - CLI A-linter Area - Linter C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants