-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
41 lines (36 loc) · 1.11 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { ts, PreProcessHandler, Plugin, PluginContext, Schema } from 'dtsgenerator';
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const packageJson: {
name: string;
version: string;
description: string;
// eslint-disable-next-line @typescript-eslint/no-var-requires
} = require('./package.json');
const doNothing: Plugin = {
meta: {
name: packageJson.name,
version: packageJson.version,
description: packageJson.description,
},
preProcess,
postProcess,
};
// eslint-disable-next-line @typescript-eslint/require-await
async function preProcess(
_pluginContext: PluginContext
): Promise<PreProcessHandler | undefined> {
return (contents: Schema[]): Schema[] => {
return contents;
};
}
// eslint-disable-next-line @typescript-eslint/require-await
async function postProcess(
_pluginContext: PluginContext
): Promise<ts.TransformerFactory<ts.SourceFile> | undefined> {
return (_context: ts.TransformationContext) => (
root: ts.SourceFile
): ts.SourceFile => {
return root;
};
}
export default doNothing;