Skip to content

Commit c7a4905

Browse files
authored
Update config schema (#5)
* Fixes #4 - Added reference link - Added `buildMode` property - Added default value into `luaLibImport`, `luaTarget`, `noImplicitSelf`, `noHeader` and `sourceMapTraceback` property - Modified description of `luaPlugins` property - Prettified - Added title and description for the schema - Added (mixined) the default tsconfig.json schema - Removed default properties (they are already described in the default tsconfig.json schema) * Fixed comma
1 parent 929fdf8 commit c7a4905

File tree

1 file changed

+36
-30
lines changed

1 file changed

+36
-30
lines changed

tsconfig-schema.json

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,28 @@
11
{
2+
"title": "tsconfig.json with TSTL",
3+
"description": "JSON schema for the TypeScript compiler's configuration file with TSTL",
24
"$schema": "http://json-schema.org/draft-07/schema",
5+
"allOf": [
6+
{
7+
"$ref": "https://json.schemastore.org/tsconfig"
8+
}
9+
],
310
"properties": {
4-
"compilerOptions": {
5-
"properties": {
6-
"plugins": {
7-
"items": {
8-
"properties": {
9-
"transform": { "type": "string" },
10-
"import": { "type": "string" },
11-
"after": { "type": "boolean" },
12-
"afterDeclarations": { "type": "boolean" },
13-
"type": {
14-
"oneOf": [
15-
{ "const": "program" },
16-
{ "const": "config" },
17-
{ "const": "checker" },
18-
{ "const": "raw" },
19-
{ "const": "compilerOptions" }
20-
]
21-
}
22-
}
23-
}
24-
}
25-
}
26-
},
2711
"tstl": {
28-
"description": "TypeScriptToLua options.",
12+
"description": "TypeScriptToLua compiler options.",
2913
"type": "object",
14+
"definitions": {
15+
"//": {
16+
"reference": "https://typescripttolua.github.io/docs/configuration#custom-options"
17+
}
18+
},
3019
"properties": {
20+
"buildMode": {
21+
"description": "Use buildMode: \"library\" to build publishable library packages.",
22+
"type": "string",
23+
"default": "library",
24+
"enum": ["default", "library"]
25+
},
3126
"luaBundle": {
3227
"description": "The name of the lua file to bundle output lua to. Requires luaBundleEntry.",
3328
"type": "string"
@@ -39,34 +34,45 @@
3934
"luaLibImport": {
4035
"description": "Specifies how js standard features missing in lua are imported.",
4136
"type": "string",
37+
"default": "require",
4238
"enum": ["none", "always", "inline", "require"]
4339
},
4440
"luaTarget": {
45-
"description": "Specify Lua target version.",
41+
"description": "Specifies the Lua version you want to generate code for.",
4642
"type": "string",
43+
"default": "universal",
4744
"enum": ["5.1", "5.2", "5.3", "JIT"]
4845
},
4946
"noImplicitSelf": {
50-
"description": "If \"this\" is implicitly considered an any type, do not generate a self parameter.",
51-
"type": "boolean"
47+
"description": "If true, treats all project files as if they were prefixed with\n/** @noSelfInFile **/.",
48+
"type": "boolean",
49+
"default": false
5250
},
5351
"noHeader": {
5452
"description": "Specify if a header will be added to compiled files.",
55-
"type": "boolean"
53+
"type": "boolean",
54+
"default": false
5655
},
5756
"sourceMapTraceback": {
5857
"description": "Applies the source map to show source TS files and lines in error tracebacks.",
58+
"default": false,
5959
"type": "boolean"
6060
},
6161
"luaPlugins": {
6262
"description": "List of TypeScriptToLua plugins.",
6363
"type": "array",
6464
"items": {
65+
"description": "Describes TypeScriptToLua plugin",
6566
"type": "object",
6667
"required": ["name"],
6768
"properties": {
68-
"name": { "type": "string" },
69-
"import": { "type": "string" }
69+
"name": {
70+
"description": "Path to the JS file, that contains the plugin code",
71+
"type": "string"
72+
},
73+
"import": {
74+
"type": "string"
75+
}
7076
}
7177
}
7278
}

0 commit comments

Comments
 (0)