-
Notifications
You must be signed in to change notification settings - Fork 0
/
ModuleListOptions.ts
50 lines (49 loc) 路 1.33 KB
/
ModuleListOptions.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
42
43
44
45
46
47
48
49
50
import { type Options as FormatOptions } from "prettier";
import type { Mode } from "./Mode";
/**
* Plugin options.
*/
export type ModuleListOptions = {
/**
* Specifies how the modules are listed and exported.
*
* @defaultValue "full-dynamic"
*/
mode?: Mode | Mode["language"];
/**
* Path to the folder containing the modules to list.
*
* @defaultValue `"."`
*/
rootPath?: string;
/**
* Module file name extensions to include. Files with other extensions are ignored.
*
* @defaultValue `["js", "ts", "jsx", "tsx"]`
*/
includeExtensions?: string[];
/**
* Regular expression that matches file names to include. Files that do not match will be excluded.
*
* @defaultValue `/(?:)/`
*/
include?: RegExp;
/**
* Regular expression that matches file names to exclude. Files that match the `include` regular expression but match the `exclude` regular expression will be excluded.
*
* @defaultValue `/\.(?:tests?|spec)\.[^.]+$/`
*/
exclude?: RegExp;
/**
* Path to the module into wich the module list is written.
*
* @defaultValue `${rootPath}/main.ts`.
*/
outputPath?: string;
/**
* Prettier options. If explicitely set to false, the code is not formatted.
*
* @see {@link FormatOptions} for the list of options.
*/
formatOptions?: FormatOptions | false;
};