UNPKG

10.6 kBJSONView Raw
1{
2 "$ref": "#/definitions/TsConfigSchema",
3 "$schema": "http://json-schema.org/draft-07/schema#",
4 "definitions": {
5 "ModuleTypes": {
6 "type": "object"
7 },
8 "TsConfigOptions": {
9 "description": "Must be an interface to support `typescript-json-schema`.",
10 "properties": {
11 "compiler": {
12 "default": "typescript",
13 "description": "Specify a custom TypeScript compiler.",
14 "type": "string"
15 },
16 "compilerHost": {
17 "default": false,
18 "description": "Use TypeScript's compiler host API instead of the language service API.",
19 "type": "boolean"
20 },
21 "compilerOptions": {
22 "additionalProperties": true,
23 "allOf": [
24 {
25 "$ref": "https://schemastore.azurewebsites.net/schemas/json/tsconfig.json#definitions/compilerOptionsDefinition/properties/compilerOptions"
26 }
27 ],
28 "description": "JSON object to merge with TypeScript `compilerOptions`.",
29 "properties": {},
30 "type": "object"
31 },
32 "emit": {
33 "default": false,
34 "description": "Emit output files into `.ts-node` directory.",
35 "type": "boolean"
36 },
37 "esm": {
38 "description": "Enable native ESM support.\n\nFor details, see https://typestrong.org/ts-node/docs/imports#native-ecmascript-modules",
39 "type": "boolean"
40 },
41 "experimentalReplAwait": {
42 "description": "Allows the usage of top level await in REPL.\n\nUses node's implementation which accomplishes this with an AST syntax transformation.\n\nEnabled by default when tsconfig target is es2018 or above. Set to false to disable.\n\n**Note**: setting to `true` when tsconfig target is too low will throw an Error. Leave as `undefined`\nto get default, automatic behavior.",
43 "type": "boolean"
44 },
45 "experimentalResolver": {
46 "description": "Enable experimental features that re-map imports and require calls to support:\n`baseUrl`, `paths`, `rootDirs`, `.js` to `.ts` file extension mappings,\n`outDir` to `rootDir` mappings for composite projects and monorepos.\n\nFor details, see https://github.com/TypeStrong/ts-node/issues/1514",
47 "type": "boolean"
48 },
49 "experimentalSpecifierResolution": {
50 "description": "Like node's `--experimental-specifier-resolution`, , but can also be set in your `tsconfig.json` for convenience.\n\nFor details, see https://nodejs.org/dist/latest-v18.x/docs/api/esm.html#customizing-esm-specifier-resolution-algorithm",
51 "enum": [
52 "explicit",
53 "node"
54 ],
55 "type": "string"
56 },
57 "experimentalTsImportSpecifiers": {
58 "description": "Allow using voluntary `.ts` file extension in import specifiers.\n\nTypically, in ESM projects, import specifiers must have an emit extension, `.js`, `.cjs`, or `.mjs`,\nand we automatically map to the corresponding `.ts`, `.cts`, or `.mts` source file. This is the\nrecommended approach.\n\nHowever, if you really want to use `.ts` in import specifiers, and are aware that this may\nbreak tooling, you can enable this flag.",
59 "type": "boolean"
60 },
61 "files": {
62 "default": false,
63 "description": "Load \"files\" and \"include\" from `tsconfig.json` on startup.\n\nDefault is to override `tsconfig.json` \"files\" and \"include\" to only include the entrypoint script.",
64 "type": "boolean"
65 },
66 "ignore": {
67 "default": [
68 "(?:^|/)node_modules/"
69 ],
70 "description": "Paths which should not be compiled.\n\nEach string in the array is converted to a regular expression via `new RegExp()` and tested against source paths prior to compilation.\n\nSource paths are normalized to posix-style separators, relative to the directory containing `tsconfig.json` or to cwd if no `tsconfig.json` is loaded.\n\nDefault is to ignore all node_modules subdirectories.",
71 "items": {
72 "type": "string"
73 },
74 "type": "array"
75 },
76 "ignoreDiagnostics": {
77 "description": "Ignore TypeScript warnings by diagnostic code.",
78 "items": {
79 "type": [
80 "string",
81 "number"
82 ]
83 },
84 "type": "array"
85 },
86 "logError": {
87 "default": false,
88 "description": "Logs TypeScript errors to stderr instead of throwing exceptions.",
89 "type": "boolean"
90 },
91 "moduleTypes": {
92 "$ref": "#/definitions/ModuleTypes",
93 "description": "Override certain paths to be compiled and executed as CommonJS or ECMAScript modules.\nWhen overridden, the tsconfig \"module\" and package.json \"type\" fields are overridden, and\nthe file extension is ignored.\nThis is useful if you cannot use .mts, .cts, .mjs, or .cjs file extensions;\nit achieves the same effect.\n\nEach key is a glob pattern following the same rules as tsconfig's \"include\" array.\nWhen multiple patterns match the same file, the last pattern takes precedence.\n\n`cjs` overrides matches files to compile and execute as CommonJS.\n`esm` overrides matches files to compile and execute as native ECMAScript modules.\n`package` overrides either of the above to default behavior, which obeys package.json \"type\" and\ntsconfig.json \"module\" options."
94 },
95 "preferTsExts": {
96 "default": false,
97 "description": "Re-order file extensions so that TypeScript imports are preferred.\n\nFor example, when both `index.js` and `index.ts` exist, enabling this option causes `require('./index')` to resolve to `index.ts` instead of `index.js`",
98 "type": "boolean"
99 },
100 "pretty": {
101 "default": false,
102 "description": "Use pretty diagnostic formatter.",
103 "type": "boolean"
104 },
105 "require": {
106 "description": "Modules to require, like node's `--require` flag.\n\nIf specified in `tsconfig.json`, the modules will be resolved relative to the `tsconfig.json` file.\n\nIf specified programmatically, each input string should be pre-resolved to an absolute path for\nbest results.",
107 "items": {
108 "type": "string"
109 },
110 "type": "array"
111 },
112 "scope": {
113 "default": false,
114 "description": "Scope compiler to files within `scopeDir`.",
115 "type": "boolean"
116 },
117 "scopeDir": {
118 "default": "First of: `tsconfig.json` \"rootDir\" if specified, directory containing `tsconfig.json`, or cwd if no `tsconfig.json` is loaded.",
119 "type": "string"
120 },
121 "skipIgnore": {
122 "default": false,
123 "description": "Skip ignore check, so that compilation will be attempted for all files with matching extensions.",
124 "type": "boolean"
125 },
126 "swc": {
127 "description": "Transpile with swc instead of the TypeScript compiler, and skip typechecking.\n\nEquivalent to setting both `transpileOnly: true` and `transpiler: 'ts-node/transpilers/swc'`\n\nFor complete instructions: https://typestrong.org/ts-node/docs/transpilers",
128 "type": "boolean"
129 },
130 "transpileOnly": {
131 "default": false,
132 "description": "Use TypeScript's faster `transpileModule`.",
133 "type": "boolean"
134 },
135 "transpiler": {
136 "anyOf": [
137 {
138 "items": [
139 {
140 "type": "string"
141 },
142 {
143 "additionalProperties": true,
144 "properties": {},
145 "type": "object"
146 }
147 ],
148 "maxItems": 2,
149 "minItems": 2,
150 "type": "array"
151 },
152 {
153 "type": "string"
154 }
155 ],
156 "description": "Specify a custom transpiler for use with transpileOnly"
157 },
158 "typeCheck": {
159 "default": true,
160 "description": "**DEPRECATED** Specify type-check is enabled (e.g. `transpileOnly == false`).",
161 "type": "boolean"
162 }
163 },
164 "type": "object"
165 },
166 "TsConfigSchema": {
167 "allOf": [
168 {
169 "$ref": "https://schemastore.azurewebsites.net/schemas/json/tsconfig.json"
170 }
171 ],
172 "description": "tsconfig schema which includes \"ts-node\" options.",
173 "properties": {
174 "ts-node": {
175 "$ref": "#/definitions/TsConfigOptions",
176 "description": "ts-node options. See also: https://typestrong.org/ts-node/docs/configuration\n\nts-node offers TypeScript execution and REPL for node.js, with source map support."
177 }
178 },
179 "type": "object"
180 }
181 }
182}
183