betterer
betterer copied to clipboard
First code line in Editors is "1", but in betterer "0". Code navigation is not precise
Describe the bug All code editors i've checked (Webstorm, Sublime, VS Code) count the code lines starting from number 1. Betterer reports display first line of code as 0. So there is one line difference between what we see in editor and what reporter reports.
To Reproduce
import { typescript } from '@betterer/typescript'
export default {
'stricter typescript compilation': () =>
typescript('tsconfig.json', {
strict: true,
noImplicitAny: true,
strictNullChecks: true,
strictFunctionTypes: true,
strictPropertyInitialization: false,
useDefineForClassFields: false,
}).include('./test-file.ts'),
}
test-file.ts
function a1(b1) {
console.error(b1)
}
function a2(b2) {
console.error(b2)
}
function a3(b3) {
console.error(b3)
}
Expected behavior
Betterer should point to exact place of the issue, so that developers can use file.ts:<line_number> to go to editor straight to issue to fix it.
Screenshots

Versions (please complete the following information):
System:
- OS: macOS 11.6
- Memory: 20.64 MB / 16.00 GB
Binaries:
- Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
- Yarn: 1.22.17 - /usr/local/bin/yarn
- npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
Languages:
- Bash: 3.2.57 - /bin/bash
Betterer:
- 5.1.5
As I deep dive into the code, the line and column is initially designed as zero-based index. If we change to 1-based index, it would cause breaking change I think.