-
Notifications
You must be signed in to change notification settings - Fork 0
/
tsconfig.json
185 lines (169 loc) · 10.7 KB
/
tsconfig.json
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
{ // https://www.typescriptlang.org/tsconfig
"compilerOptions": {
//──────────────────────────────────────────────────────────────────────
// Type Checking
//──────────────────────────────────────────────────────────────────────
"noImplicitAny": false,
"noPropertyAccessFromIndexSignature": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
// The strict flag enables a wide range of type checking behavior that
// results in stronger guarantees of program correctness. Turning this
// on is equivalent to enabling all of the strict mode family options,
// which are outlined below. You can then turn off individual strict
// mode family checks as needed.
// Future versions of TypeScript may introduce additional stricter
// checking under this flag, so upgrades of TypeScript might result in
// new type errors in your program. When appropriate and possible, a
// corresponding flag will be added to disable that behavior.
"strict": true,
"strictFunctionTypes": true,
// When strictNullChecks is false, null and undefined are effectively
// ignored by the language. This can lead to unexpected errors at
// runtime.
// When strictNullChecks is true, null and undefined have their own
// distinct types and you’ll get a type error if you try to use them
// where a concrete value is expected.
// NOTE: Setting it to true gives errors which are NOT really errors in lib/xp/node.ts
"strictNullChecks": false,
//──────────────────────────────────────────────────────────────────────
// Modules
//──────────────────────────────────────────────────────────────────────
"baseUrl": ".",
"module": "commonjs",
"moduleResolution": "node",
"paths": {
// Production (should be commented in when commiting)
"@enonic/js-utils": ["."],
"@enonic/js-utils/*": ["./*"],
"/lib/xp/*": ["./node_modules/@enonic-types/lib-*"],
// Development (should be commented out when commiting)
// "@enonic-types/core": ["../xp/modules/lib/core/index.d.ts"],
// "/lib/xp/app": ["../xp/modules/lib/lib-app/src/main/resources/lib/xp/app.ts"],
// "/lib/xp/auth": ["../xp/modules/lib/lib-auth/src/main/resources/lib/xp/auth.ts"],
// "/lib/xp/content": ["../xp/modules/lib/lib-content/src/main/resources/lib/xp/content.ts"],
// "/lib/xp/event": ["../xp/modules/lib/lib-event/src/main/resources/lib/xp/event.ts"],
// "/lib/xp/io": ["../xp/modules/lib/lib-io/src/main/resources/lib/xp/io.ts"],
// "/lib/xp/mail": ["../xp/modules/lib/lib-mail/src/main/resources/lib/xp/mail.ts"],
// "/lib/xp/node": ["../xp/modules/lib/lib-node/src/main/resources/lib/xp/node.ts"],
// "/lib/xp/portal": ["../xp/modules/lib/lib-portal/src/main/resources/lib/xp/portal.ts"],
// "/lib/xp/repo": ["../xp/modules/lib/lib-repo/src/main/resources/lib/xp/repo.ts"],
// "/lib/xp/schema": ["../xp/modules/lib/lib-schema/src/main/resources/lib/xp/schema.ts"],
// "/lib/xp/value": ["../xp/modules/lib/lib-value/src/main/resources/lib/xp/value.ts"],
},
"resolveJsonModule": true,
// It's important to set rootDir, or it will be inferred:
// The inferred value for rootDir is the longest common path of all non-declaration input files
"rootDir": ".",
//"rootDir": "..", // This affects the output!
// Using rootDirs, you can inform the compiler that there are many
// “virtual” directories acting as a single root. This allows the
// compiler to resolve relative module imports within these “virtual”
// directories, as if they were merged in to one directory.
//"rootDirs": [
// ".",
// "node_modules",
// "test"
//],
// By default all visible ”@types” packages are included in your compilation.
// Packages in node_modules/@types of any enclosing folder are considered visible.
// For example, that means packages within ./node_modules/@types/,
// ../node_modules/@types/, ../../node_modules/@types/, and so on.
// If typeRoots is specified, only packages under typeRoots will be included.
"typeRoots": [
"./node_modules/@types",
"./node_modules/@enonic-types",
],
// By default all visible ”@types” packages are included in your compilation.
// Packages in node_modules/@types of any enclosing folder are considered visible.
// For example, that means packages within ./node_modules/@types/,
// ../node_modules/@types/, ../../node_modules/@types/, and so on.
// If types is specified, only packages listed will be included in the global scope.
// This feature differs from typeRoots in that it is about specifying only the exact
// types you want included, whereas typeRoots supports saying you want particular folders.
// "types": [
// //"node", // Since @enonic/js-utils is supposed to run anywhere we can't depend on node...
// "@enonic-types/global",
// ],
//──────────────────────────────────────────────────────────────────────
// Emit
//──────────────────────────────────────────────────────────────────────
"declaration": true,
"declarationDir": "./",
"declarationMap": false,
"downlevelIteration": true,
"importHelpers": true,
"inlineSourceMap": false,
"inlineSources": false,
"noEmitOnError": true,
"outDir": "dist/cjs",
"removeComments": true,
"sourceMap": false,
//──────────────────────────────────────────────────────────────────────
// JavaScript Support
//──────────────────────────────────────────────────────────────────────
"allowJs": false,
//──────────────────────────────────────────────────────────────────────
// Interop Constraints
//──────────────────────────────────────────────────────────────────────
"forceConsistentCasingInFileNames": true,
"verbatimModuleSyntax": false, // TODO Set to true and fix errors?
//──────────────────────────────────────────────────────────────────────
// Language and Environment
//──────────────────────────────────────────────────────────────────────
// "target": "ES5", // target set in tsup.config.ts
//──────────────────────────────────────────────────────────────────────
// Compiler Diagnostics
//──────────────────────────────────────────────────────────────────────
"listEmittedFiles": false,
"listFiles": false,
//──────────────────────────────────────────────────────────────────────
// Output Formatting
//──────────────────────────────────────────────────────────────────────
"noErrorTruncation": true,
//──────────────────────────────────────────────────────────────────────
// Completeness
//──────────────────────────────────────────────────────────────────────
// Skip type checking of declaration files.
//
// This can save time during compilation at the expense of type-system
// accuracy. For example, two libraries could define two copies of the
// same type in an inconsistent way. Rather than doing a full check of
// all d.ts files, TypeScript will type check the code you specifically
// refer to in your app’s source code.
"skipLibCheck": true,
},
// Specifies an array of filenames or patterns that should be skipped when
// resolving include.
// Important: exclude only changes which files are included as a result of
// the include setting. A file specified by exclude can still become part of
// your codebase due to an import statement in your code, a types inclusion,
// a /// <reference directive, or being specified in the files list.
// It is not a mechanism that prevents a file from being included in the
// codebase - it simply changes what the include setting finds.
"exclude": [
"./build/**/*",
"./docs/**/*",
"./dist/**/*",
"./node_modules/**/*",
"./test/**/*"
],
// Specifies an allowlist of files to include in the program.
// An error occurs if any of the files can’t be found.
// This is useful when you only have a small number of files and don’t need
// to use a glob to reference many files. If you need that then use include.
//"files": [
// "index.ts"
//],
// Specifies an array of filenames or patterns to include in the program.
// These filenames are resolved relative to the directory containing the
// tsconfig.json file.
"include": [
// Make sure default types matches Nashorn
"./node_modules/typescript/lib/lib.es5.d.ts",
// This produces the same amount of files as "files":["index.ts"].
// Maybe because the index file references everything...
"./**/*.ts",
]
}