-
-
Notifications
You must be signed in to change notification settings - Fork 783
feat(napi/oxlint): add getFilename + getPhysicalFilename methods to Context
#12481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(napi/oxlint): add getFilename + getPhysicalFilename methods to Context
#12481
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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. |
d2a9782 to
f503e4e
Compare
|
|
||
| /** | ||
| * Get the absolute path of the file being linted. | ||
| * @deprecated Use `filename` instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think we should implement deprecated APIs, just for the sake of filling out the context object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured these methods are part of ESLint's API, so we should include them, even though they're deprecated. An older ESLint plugin might otherwise work quite happily with Oxlint, but it'd break if it uses these APIs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets chat in a bit? I don't quite agree, especially since we don't have full compat with eslint, i don't think we should fill out deprecated APIs, we shuold instead push plugin maintainers to use the new APIs.
More of my reasoning is adding something deprecated, means that we definitly will remove it at some point which means a breaking change ect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, we disagree here. I think we're aiming for ESLint compat, so we need to provide all ESLint's APIs, regardless of whether those APIs are deprecated or not.
But it's not important (yet). Feel free to close this if you disagree and we can always return to it later once we've confirmed that we are definitely going for ESLint compat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah sorry to be a pain. I think let's close for now and return once it's confirmed.
294ec37 to
bc54d3c
Compare
f503e4e to
8c4e05d
Compare
8c4e05d to
f49acdb
Compare
f49acdb to
e053438
Compare
ContextgetFilename + getPhysicalFilename methods to Context
CodSpeed Instrumentation Performance ReportMerging #12481 will not alter performanceComparing Summary
Footnotes |
e053438 to
edf72c3
Compare
1e097b1 to
2401976
Compare
edf72c3 to
77731f0
Compare
|
We may want to start opening issues in ESLint plugins still using getFilename/getPhysicalFilename if we intend to keep this decision (or maybe even start opening PRs to fix plugins where possible): Link to storybook eslint plugin source: https://github.com/storybookjs/storybook/blob/v10.0.5/code/lib/eslint-plugin/src/rules/default-exports.ts#L102 |
|
Personally, I think we should reverse the decision and implement these APIs. IMO it's no big deal - they're all just another access method for data that existing getters on Even if they disappear from ESLint in v10, there's no big problem I think with us supporting them indefinitely. Trying to get every ESLint plugin to update is going to be an impossible task. Let's just accept the world as it is, warts and all! Note: It's not just |
|
Lets chat monday? |

Add
getFilenameandgetPhysicalFilenamemethods toContext, to match ESLint's API.