Skip to content

Comments

fix(linter/plugins): report accept out of range column indexes in loc#18199

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/01-18-fix_linter_plugins_report_accept_out_of_range_column_indexes_in_loc_
Jan 19, 2026
Merged

fix(linter/plugins): report accept out of range column indexes in loc#18199
graphite-app[bot] merged 1 commit intomainfrom
om/01-18-fix_linter_plugins_report_accept_out_of_range_column_indexes_in_loc_

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Jan 18, 2026

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.

Copy link
Member Author

overlookmotel commented Jan 18, 2026


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-bug Category - Bug label Jan 18, 2026
@overlookmotel overlookmotel force-pushed the om/01-18-fix_linter_plugins_report_accept_out_of_range_column_indexes_in_loc_ branch from 297d069 to 27cf9a1 Compare January 18, 2026 22:46
@overlookmotel overlookmotel force-pushed the om/01-18-feat_linter_plugins_support_commonjs_source_type_in_ruletester_ branch from 83866f8 to e95a4fe Compare January 18, 2026 22:46
@overlookmotel overlookmotel marked this pull request as ready for review January 18, 2026 22:52
Copilot AI review requested due to automatic review settings January 18, 2026 22:52
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 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 getOffsetFromLineColumn function in report.ts that allows negative/out-of-range column values as long as the computed offset is valid
  • Enhanced the report function 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.

@overlookmotel overlookmotel force-pushed the om/01-18-fix_linter_plugins_report_accept_out_of_range_column_indexes_in_loc_ branch from 27cf9a1 to 8aa9c18 Compare January 18, 2026 23:01
@overlookmotel overlookmotel force-pushed the om/01-18-feat_linter_plugins_support_commonjs_source_type_in_ruletester_ branch from e95a4fe to 84b352d Compare January 18, 2026 23:01
@overlookmotel overlookmotel self-assigned this Jan 18, 2026
@graphite-app graphite-app bot force-pushed the om/01-18-feat_linter_plugins_support_commonjs_source_type_in_ruletester_ branch from 84b352d to 8773a73 Compare January 18, 2026 23:17
@graphite-app graphite-app bot force-pushed the om/01-18-fix_linter_plugins_report_accept_out_of_range_column_indexes_in_loc_ branch from 8aa9c18 to 38c37eb Compare January 18, 2026 23:17
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Jan 19, 2026
Copy link
Member

Boshen commented Jan 19, 2026

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.
@graphite-app graphite-app bot force-pushed the om/01-18-feat_linter_plugins_support_commonjs_source_type_in_ruletester_ branch from 8773a73 to 7c86fc3 Compare January 19, 2026 04:39
@graphite-app graphite-app bot force-pushed the om/01-18-fix_linter_plugins_report_accept_out_of_range_column_indexes_in_loc_ branch from 38c37eb to 4d68448 Compare January 19, 2026 04:40
Base automatically changed from om/01-18-feat_linter_plugins_support_commonjs_source_type_in_ruletester_ to main January 19, 2026 04:45
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 19, 2026
@graphite-app graphite-app bot merged commit 4d68448 into main Jan 19, 2026
20 checks passed
@graphite-app graphite-app bot deleted the om/01-18-fix_linter_plugins_report_accept_out_of_range_column_indexes_in_loc_ branch January 19, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter A-linter-plugins Area - Linter JS plugins C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants