TypeScript API Program has method getSyntacticDiagnostics to get syntactic errors. But if there is no Program, just SourceFile how can I get the same kind of information?
I created SourceFile through
function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean, scriptKind?: ScriptKind): SourceFile;