Skip to content

feat(napi/oxlint): add filename property to Context#12497

Merged
graphite-app[bot] merged 1 commit intomainfrom
07-24-feat_napi_oxlint_add_filename_property_to_context_
Jul 24, 2025
Merged

feat(napi/oxlint): add filename property to Context#12497
graphite-app[bot] merged 1 commit intomainfrom
07-24-feat_napi_oxlint_add_filename_property_to_context_

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Jul 24, 2025

Add filename property to Context, to match ESLint's API.

ESLint's docs do draw a distinction between filename and physicalFilename:

filename: (string) The filename associated with the source.
physicalFilename: (string) When linting a file, it provides the full path of the file on disk without any code block information. When linting text, it provides the value passed to —stdin-filename or <text> if not specified.

However, it's unclear to me if that difference applies in the context of Oxlint. So just make them both absolute file path for now. Testing ESLint locally, that's what both properties contain.

Copy link
Member Author

overlookmotel commented Jul 24, 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 July 24, 2025 11:01
@overlookmotel
Copy link
Member Author

@camc314 I've split this out from #12481, as I assume it's less controversial. But if it is controversial, let's not argue about it! Please just close this PR - I won't be offended.

Copy link
Contributor

@camc314 camc314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Jul 24, 2025
Copy link
Contributor

camc314 commented Jul 24, 2025

Merge activity

Add `filename` property to `Context`, to match ESLint's API.

[ESLint's docs](https://eslint.org/docs/latest/extend/custom-rules#the-context-object) do draw a distinction between `filename` and `physicalFilename`:

> `filename`: (string) The filename associated with the source.
> `physicalFilename`: (string) When linting a file, it provides the full path of the file on disk without any code block information. When linting text, it provides the value passed to `—stdin-filename` or `<text>` if not specified.

However, it's unclear to me if that difference applies in the context of Oxlint. So just make them both absolute file path for now. Testing ESLint locally, that's what both properties contain.
@graphite-app graphite-app bot force-pushed the 07-23-refactor_napi_oxlint_diagnostics_communicate_which_rule_via_rule_index_not_rule_id branch from 1f7cfe9 to 8c8c8bc Compare July 24, 2025 11:11
@graphite-app graphite-app bot force-pushed the 07-24-feat_napi_oxlint_add_filename_property_to_context_ branch from 1e097b1 to 2401976 Compare July 24, 2025 11:12
Base automatically changed from 07-23-refactor_napi_oxlint_diagnostics_communicate_which_rule_via_rule_index_not_rule_id to main July 24, 2025 11:19
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jul 24, 2025
@graphite-app graphite-app bot merged commit 2401976 into main Jul 24, 2025
16 checks passed
@graphite-app graphite-app bot deleted the 07-24-feat_napi_oxlint_add_filename_property_to_context_ branch July 24, 2025 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants