Skip to content

Commit d69f089

Browse files
authored
adding schema (#1302)
* adding schema * prettier
1 parent 7ff29f0 commit d69f089

File tree

1 file changed

+106
-0
lines changed

1 file changed

+106
-0
lines changed

tsconfig-schema.json

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
{
2+
"title": "tsconfig.json with TSTL",
3+
"description": "JSON schema for the TypeScript compiler's configuration file with TSTL",
4+
"$schema": "http://json-schema.org/draft-07/schema",
5+
"allOf": [
6+
{
7+
"$ref": "https://json.schemastore.org/tsconfig"
8+
}
9+
],
10+
"properties": {
11+
"tstl": {
12+
"description": "TypeScriptToLua compiler options.",
13+
"type": "object",
14+
"definitions": {
15+
"//": {
16+
"reference": "https://typescripttolua.github.io/docs/configuration#custom-options"
17+
}
18+
},
19+
"properties": {
20+
"buildMode": {
21+
"description": "Use buildMode: \"library\" to build publishable library packages.",
22+
"type": "string",
23+
"default": "library",
24+
"enum": ["default", "library"]
25+
},
26+
"lua51AllowTryCatchInAsyncAwait": {
27+
"description": "Disable the warning that try/catch is not allowed in async functions in Lua 5.1, in case you are using a patched 5.1 lua version that supports this.",
28+
"type": "boolean",
29+
"default": false
30+
},
31+
"luaBundle": {
32+
"description": "The name of the lua file to bundle output lua to. Requires luaBundleEntry.",
33+
"type": "string"
34+
},
35+
"luaBundleEntry": {
36+
"description": "The entry *.ts file that will be executed when entering the luaBundle. Requires luaBundle.",
37+
"type": "string"
38+
},
39+
"luaLibImport": {
40+
"description": "Specifies how js standard features missing in lua are imported.",
41+
"type": "string",
42+
"default": "require",
43+
"enum": ["none", "always", "inline", "require"]
44+
},
45+
"luaTarget": {
46+
"description": "Specifies the Lua version you want to generate code for.",
47+
"type": "string",
48+
"default": "universal",
49+
"enum": ["5.1", "5.2", "5.3", "JIT"]
50+
},
51+
"noImplicitGlobalVariables": {
52+
"description": "Always declare all root-level variables as local, even if the file is not a module and they would be global in TypeScript.",
53+
"type": "boolean",
54+
"default": false
55+
},
56+
"noImplicitSelf": {
57+
"description": "If true, treats all project files as if they were prefixed with\n/** @noSelfInFile **/.",
58+
"type": "boolean",
59+
"default": false
60+
},
61+
"noHeader": {
62+
"description": "Specify if a header will be added to compiled files.",
63+
"type": "boolean",
64+
"default": false
65+
},
66+
"noResolvePaths": {
67+
"description": "An array of import paths that should not be resolved but copied verbatim to output lua.",
68+
"type": "array"
69+
},
70+
"sourceMapTraceback": {
71+
"description": "Applies the source map to show source TS files and lines in error tracebacks.",
72+
"default": false,
73+
"type": "boolean"
74+
},
75+
"tstlVerbose": {
76+
"description": "Give verbose tstl output, helpful when diagnosing tstl issues.",
77+
"type": "boolean",
78+
"default": false
79+
},
80+
"luaPlugins": {
81+
"description": "List of TypeScriptToLua plugins.",
82+
"type": "array",
83+
"items": {
84+
"description": "Describes TypeScriptToLua plugin",
85+
"type": "object",
86+
"required": ["name"],
87+
"properties": {
88+
"name": {
89+
"description": "Path to the JS file, that contains the plugin code",
90+
"type": "string"
91+
},
92+
"import": {
93+
"type": "string"
94+
}
95+
}
96+
}
97+
}
98+
},
99+
"dependencies": {
100+
"luaBundle": ["luaBundleEntry"],
101+
"luaBundleEntry": ["luaBundle"]
102+
}
103+
}
104+
},
105+
"allowTrailingCommas": true
106+
}

0 commit comments

Comments
 (0)