-
-
Notifications
You must be signed in to change notification settings - Fork 185
Expand file tree
/
Copy pathafterEmit.ts
More file actions
23 lines (20 loc) · 681 Bytes
/
afterEmit.ts
File metadata and controls
23 lines (20 loc) · 681 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import * as ts from "typescript";
import * as tstl from "../../../src";
const plugin: tstl.Plugin = {
afterEmit(program: ts.Program, options: tstl.CompilerOptions, emitHost: tstl.EmitHost, result: tstl.EmitFile[]) {
void program;
void options;
void emitHost;
void result;
const diagnostic = {
category: ts.DiagnosticCategory.Message,
messageText: "After emit diagnostic message!",
code: 1234,
file: program.getSourceFiles()[0],
start: undefined,
length: undefined,
} satisfies ts.Diagnostic;
return [diagnostic];
},
};
export default plugin;