Files
oxc-project__oxc/apps/oxlint/src-js/plugins/fix.ts
overlookmotel 55be9feb3a refactor(linter/plugins): pass fix/suggestion offsets to Rust as i64s (#19159)
Follow-on after #19092.

That PR added 1 to offsets of fixes before sending them to Rust side, to support offset `-1` (legal when fix is to remove a BOM).

Upon reflection, I think that solution is too complicated and confusing. Instead, represent `start` and `end` offsets of fixes as `i64`s in `JsFix`. This supports `-1` as an offset, and also the full range of valid `u32` values. Check on Rust side that the values are in range before converting to `u32`s.

This also makes for better error messages for invalid offsets - no more inexplicable "Failed to deserialize JSON returned by `lintFile`" errors.
2026-02-08 21:04:50 +00:00

8.1 KiB