From this docs: https://github.com/Microsoft/TypeScript-wiki/blob/main/Using-the-Compiler-API.md#traversing-the-ast-with-a-little-linter, I can get the line number of the node in the given Abstract Syntax Tree.
function report(node: ts.Node, message: string) {
const { line, character } = sourceFile.getLineAndCharacterOfPosition(node.getStart());
console.log(`${sourceFile.fileName} (${line + 1},${character + 1}): ${message}`);
}
Is there a way to get the line number of this node in the original typescript file?