Commit 7562959e by Huan Wang Committed by Torkel Ödegaard

toolkit linter line number off by one (#19782)

it is actually an intended feature by tslint:
https://github.com/palantir/tslint/issues/4528

So adding 1 to the line number here in the plugin
parent 0b1913af
......@@ -152,9 +152,11 @@ export const lintPlugin = useSpinner<Fixable>('Linting', async ({ fix }) => {
failures.forEach(f => {
// tslint:disable-next-line
console.log(
`${f.getRuleSeverity() === 'warning' ? 'WARNING' : 'ERROR'}: ${f.getFileName().split('src')[1]}[${
f.getStartPosition().getLineAndCharacter().line
}:${f.getStartPosition().getLineAndCharacter().character}]: ${f.getFailure()}`
`${f.getRuleSeverity() === 'warning' ? 'WARNING' : 'ERROR'}: ${
f.getFileName().split('src')[1]
}[${f.getStartPosition().getLineAndCharacter().line + 1}:${
f.getStartPosition().getLineAndCharacter().character
}]: ${f.getFailure()}`
);
});
console.log('\n');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment