Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Nov 8, 2025

Implement Context#languageOptions.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI C-enhancement Category - New feature or request labels Nov 8, 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 8, 2025 13:41
Copilot AI review requested due to automatic review settings November 8, 2025 13:41
@overlookmotel overlookmotel self-assigned this Nov 8, 2025
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Nov 8, 2025
Copy link
Member Author

Merge activity

  • Nov 8, 1:42 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.

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 implements support for languageOptions in the oxlint plugin context API, bringing it closer to ESLint compatibility. This allows plugin rules to access information about how a file was parsed, including source type, ECMAScript version, parser options, and globals.

Key changes:

  • Added languageOptions property to the plugin context with sourceType, ecmaVersion, parserOptions, and globals properties
  • Created PARSER_OPTIONS and LANGUAGE_OPTIONS singleton objects to efficiently provide language configuration
  • Exported LanguageOptions type from the main index for plugin consumers

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
apps/oxlint/src-js/plugins/context.ts Implements languageOptions and parserOptions objects with getters for source type, ECMAScript version, parser, and globals
apps/oxlint/src-js/index.ts Exports the new LanguageOptions type for plugin authors
apps/oxlint/test/fixtures/languageOptions/plugin.ts Test plugin that reports all language options to verify functionality
apps/oxlint/test/fixtures/languageOptions/.oxlintrc.json Configuration file for the language options test fixture
apps/oxlint/test/fixtures/languageOptions/files/index.{js,mjs,cjs} Test files with different module types (script vs module)
apps/oxlint/test/fixtures/languageOptions/output.snap.md Expected output showing correct language options for each file type
apps/oxlint/test/e2e.test.ts Adds test case for language options fixture

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

@overlookmotel overlookmotel merged commit 2f9735d into main Nov 8, 2025
25 checks passed
@overlookmotel overlookmotel deleted the 11-08-feat_linter_plugins_implement_context.languageoptions_ branch November 8, 2025 14:18
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