Skip to content

ts.transpileModule does not return diagnostics #17514

Closed
@alex-kinokon

Description

@alex-kinokon

TypeScript Version: 2.4.2

Code

import * as ts from 'typescript';

const module = ts.transpileModule('const a: string = 2; a = 0;', {
  reportDiagnostics: true,
});
console.log(module.diagnostics);

Expected behavior:
Reports [ts] Type '2' is not assignable to type 'string'.

Actual behavior:
Diagnostics is an empty array [].

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions