fix(linter/plugins): report accept out of range column indexes in loc#18199
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. |
297d069 to
27cf9a1
Compare
83866f8 to
e95a4fe
Compare
There was a problem hiding this comment.
Pull request overview
This PR fixes the report function to accept out-of-range column indexes in location data, specifically to support ESLint's func-call-spacing rule which sometimes reports errors with column: -1. The fix relaxes the validation logic while still ensuring the resulting offsets are within valid bounds.
Changes:
- Implemented a new local
getOffsetFromLineColumnfunction inreport.tsthat allows negative/out-of-range column values as long as the computed offset is valid - Enhanced the
reportfunction to store original location data for conformance tests - Updated conformance test logic to use original location values when available
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| apps/oxlint/src-js/plugins/report.ts | Added relaxed getOffsetFromLineColumn function, updated location handling in report, added conformance test support for original locations |
| apps/oxlint/src-js/plugins/location.ts | Exported debugAssertLinesIsInitialized function for use in new location validation logic |
| apps/oxlint/src-js/package/rule_tester.ts | Updated test result mapping to use original location data in conformance builds |
| apps/oxlint/conformance/snapshot.md | Reflects 14 additional passing tests, with func-call-spacing now fully passing (moved from partially passing) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
27cf9a1 to
8aa9c18
Compare
e95a4fe to
84b352d
Compare
84b352d to
8773a73
Compare
8aa9c18 to
38c37eb
Compare
Merge activity
|
… `loc` (#18199) ESLint's `func-call-spacing` rule sometimes reports errors with `loc` containing `column: -1`. As ESLint doesn't complain, probably other plugins do the same too. Make the checks for validity of `loc` in `report` more relaxed, to support this behavior.
8773a73 to
7c86fc3
Compare
38c37eb to
4d68448
Compare

ESLint's
func-call-spacingrule sometimes reports errors withloccontainingcolumn: -1. As ESLint doesn't complain, probably other plugins do the same too.Make the checks for validity of
locinreportmore relaxed, to support this behavior.