Files
Nehemiya WickramasingheandGitHub 936a3bc8b6 breaking(code-frame): use 0-based columns to match Babel AST locations (#1… (#17849)
fix(code-frame): use 0-based columns to match Babel AST locations (#17316)

`codeFrameColumns` treated the `column` property as 1-based, but Babel
AST locations use 0-based columns. This caused the caret/underline to
be off by one character when passing AST `.loc` objects directly.

- Removed the `- 1` offset in marker spacing calculation
- Removed the `+ 1` in multiline start marker count
- Changed default column sentinel from `0` to `null` so that
  `column: 0` is treated as a valid position
- Updated falsiness checks (`!startColumn`) to null checks
- Removed `+ 1` workarounds in babel-core and babel-traverse callers

This is a breaking change for external consumers of `@babel/code-frame`
who passed 1-based columns manually.
2026-05-11 09:38:53 -04:00
..