@apple/tree-sitter-pkl 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/scanner.c ADDED
@@ -0,0 +1,285 @@
1
+ #include <tree_sitter/parser.h>
2
+ #include <stdio.h>
3
+
4
+ enum TokenType {
5
+ // sequence of "normal" characters in single line string with one pound sign
6
+ SL1_STRING_CHARS,
7
+ // sequence of "normal" characters in single line string with two pound signs
8
+ SL2_STRING_CHARS,
9
+ // sequence of "normal" characters in single line string with three pound signs
10
+ SL3_STRING_CHARS,
11
+ // sequence of "normal" characters in single line string with four pound signs
12
+ SL4_STRING_CHARS,
13
+ // sequence of "normal" characters in single line string with five pound signs
14
+ SL5_STRING_CHARS,
15
+ // sequence of "normal" characters in single line string with six pound signs
16
+ SL6_STRING_CHARS,
17
+ // sequence of "normal" characters in multiline string without pound sign
18
+ ML_STRING_CHARS,
19
+ // sequence of "normal" characters in multiline string with one pound sign
20
+ ML1_STRING_CHARS,
21
+ // sequence of "normal" characters in multiline string with two pound signs
22
+ ML2_STRING_CHARS,
23
+ // sequence of "normal" characters in multiline string with three pound signs
24
+ ML3_STRING_CHARS,
25
+ // sequence of "normal" characters in multiline string with four pound signs
26
+ ML4_STRING_CHARS,
27
+ // sequence of "normal" characters in multiline string with five pound signs
28
+ ML5_STRING_CHARS,
29
+ // sequence of "normal" characters in multiline string with six pound signs
30
+ ML6_STRING_CHARS,
31
+ // `[` as used in subscript expressions
32
+ OPEN_SQUARE_BRACKET,
33
+ // `[` as used in object entries
34
+ OPEN_ENTRY_BRACKET,
35
+ };
36
+
37
+ void *tree_sitter_pkl_external_scanner_create() { return NULL; }
38
+ void tree_sitter_pkl_external_scanner_destroy(void *p) {}
39
+ void tree_sitter_pkl_external_scanner_reset(void *p) {}
40
+ unsigned tree_sitter_pkl_external_scanner_serialize(void *p, char *buffer) { return 0; }
41
+ void tree_sitter_pkl_external_scanner_deserialize(void *p, const char *b, unsigned n) {}
42
+
43
+ static void advance(TSLexer *lexer) { lexer->advance(lexer, false); }
44
+
45
+ static bool parse_slx_string_chars(TSLexer *lexer, int num_pounds) {
46
+ bool has_content = false;
47
+ switch(num_pounds) {
48
+ case 1:
49
+ lexer->result_symbol = SL1_STRING_CHARS;
50
+ break;
51
+ case 2:
52
+ lexer->result_symbol = SL2_STRING_CHARS;
53
+ break;
54
+ case 3:
55
+ lexer->result_symbol = SL3_STRING_CHARS;
56
+ break;
57
+ case 4:
58
+ lexer->result_symbol = SL4_STRING_CHARS;
59
+ break;
60
+ case 5:
61
+ lexer->result_symbol = SL5_STRING_CHARS;
62
+ break;
63
+ case 6:
64
+ lexer->result_symbol = SL6_STRING_CHARS;
65
+ break;
66
+ default:
67
+ lexer->result_symbol = SL6_STRING_CHARS;
68
+ break;
69
+ }
70
+
71
+ while (true) {
72
+ next_iter:
73
+ switch (lexer->lookahead) {
74
+ case '"':
75
+ case '\\':
76
+ lexer->mark_end(lexer);
77
+ advance(lexer);
78
+ for (int i = 0; i < num_pounds; i++) {
79
+ if (lexer->lookahead != '#') {
80
+ has_content = true;
81
+ goto next_iter;
82
+ }
83
+ advance(lexer);
84
+ }
85
+ return has_content;
86
+ case '\n':
87
+ case '\r':
88
+ case 0:
89
+ lexer->mark_end(lexer);
90
+ return has_content;
91
+ default:
92
+ has_content = true;
93
+ advance(lexer);
94
+ }
95
+ }
96
+ }
97
+
98
+ static bool parse_ml_string_chars(TSLexer *lexer) {
99
+ bool has_content = false;
100
+ lexer->result_symbol = ML_STRING_CHARS;
101
+
102
+ while (true) {
103
+ switch (lexer->lookahead) {
104
+ case '"':
105
+ lexer->mark_end(lexer);
106
+ advance(lexer);
107
+ if (lexer->lookahead == '"') {
108
+ advance(lexer);
109
+ if (lexer->lookahead == '"') {
110
+ return has_content;
111
+ }
112
+ }
113
+ has_content = true;
114
+ break;
115
+ case '\\':
116
+ case 0:
117
+ lexer->mark_end(lexer);
118
+ return has_content;
119
+ default:
120
+ has_content = true;
121
+ advance(lexer);
122
+ }
123
+ }
124
+ }
125
+
126
+ static bool parse_mlx_string_chars(TSLexer *lexer, int num_pounds) {
127
+ bool has_content = false;
128
+ switch(num_pounds) {
129
+ case 1:
130
+ lexer->result_symbol = ML1_STRING_CHARS;
131
+ break;
132
+ case 2:
133
+ lexer->result_symbol = ML2_STRING_CHARS;
134
+ break;
135
+ case 3:
136
+ lexer->result_symbol = ML3_STRING_CHARS;
137
+ break;
138
+ case 4:
139
+ lexer->result_symbol = ML4_STRING_CHARS;
140
+ break;
141
+ case 5:
142
+ lexer->result_symbol = ML5_STRING_CHARS;
143
+ break;
144
+ case 6:
145
+ lexer->result_symbol = ML6_STRING_CHARS;
146
+ break;
147
+ default:
148
+ lexer->result_symbol = ML6_STRING_CHARS;
149
+ break;
150
+ }
151
+
152
+ while (true) {
153
+ next_iter:
154
+ switch (lexer->lookahead) {
155
+ case '"': {
156
+ lexer->mark_end(lexer);
157
+ int quote_count = 0;
158
+ do {
159
+ quote_count += 1;
160
+ advance(lexer);
161
+ } while (lexer->lookahead == '"');
162
+ if (quote_count < 3) {
163
+ has_content = true;
164
+ break;
165
+ }
166
+ for (int i = 0; i < num_pounds; i++) {
167
+ if (lexer->lookahead != '#') {
168
+ has_content = true;
169
+ goto next_iter;
170
+ }
171
+ advance(lexer);
172
+ }
173
+ return has_content;
174
+ }
175
+ case '\\':
176
+ lexer->mark_end(lexer);
177
+ advance(lexer);
178
+ for (int i = 0; i < num_pounds; i++) {
179
+ if (lexer->lookahead != '#') {
180
+ has_content = true;
181
+ goto next_iter;
182
+ }
183
+ advance(lexer);
184
+ }
185
+ return has_content;
186
+ case 0:
187
+ lexer->mark_end(lexer);
188
+ return has_content;
189
+ default:
190
+ has_content = true;
191
+ advance(lexer);
192
+ }
193
+ }
194
+ }
195
+
196
+ bool parse_square_bracket_variant(TSLexer *lexer, bool open_square_bracket, bool open_entry_bracket) {
197
+ while (
198
+ lexer->lookahead == ' ' ||
199
+ lexer->lookahead == '\t' ||
200
+ (open_entry_bracket && (
201
+ lexer->lookahead == ';' ||
202
+ lexer->lookahead == '\n'
203
+ ))
204
+ ) {
205
+ open_square_bracket = open_square_bracket && (lexer->lookahead != '\n' && lexer->lookahead != ';');
206
+ lexer->advance(lexer, true);
207
+ }
208
+ if (lexer->lookahead == '[') {
209
+ lexer->result_symbol = open_square_bracket ? OPEN_SQUARE_BRACKET : OPEN_ENTRY_BRACKET;
210
+ lexer->advance(lexer, false);
211
+ if (lexer->lookahead != '[') {
212
+ lexer->mark_end(lexer);
213
+ return true;
214
+ }
215
+ }
216
+ return false;
217
+ }
218
+
219
+ bool tree_sitter_pkl_external_scanner_scan(void *payload, TSLexer *lexer, const bool *valid_symbols) {
220
+ bool sl1 = valid_symbols[SL1_STRING_CHARS];
221
+ bool sl2 = valid_symbols[SL2_STRING_CHARS];
222
+ bool sl3 = valid_symbols[SL3_STRING_CHARS];
223
+ bool sl4 = valid_symbols[SL4_STRING_CHARS];
224
+ bool sl5 = valid_symbols[SL5_STRING_CHARS];
225
+ bool sl6 = valid_symbols[SL6_STRING_CHARS];
226
+ bool ml = valid_symbols[ML_STRING_CHARS];
227
+ bool ml1 = valid_symbols[ML1_STRING_CHARS];
228
+ bool ml2 = valid_symbols[ML2_STRING_CHARS];
229
+ bool ml3 = valid_symbols[ML3_STRING_CHARS];
230
+ bool ml4 = valid_symbols[ML4_STRING_CHARS];
231
+ bool ml5 = valid_symbols[ML5_STRING_CHARS];
232
+ bool ml6 = valid_symbols[ML6_STRING_CHARS];
233
+ bool osb = valid_symbols[OPEN_SQUARE_BRACKET];
234
+ bool oeb = valid_symbols[OPEN_ENTRY_BRACKET];
235
+
236
+ if (sl1 && sl2 && sl3 && sl4 && sl5 && sl6 && ml && ml1 && ml2 && ml3 && ml4 && ml5 && ml6 && osb && oeb) {
237
+ // error recovery mode -> don't match any string chars
238
+ return false;
239
+ }
240
+
241
+ if (ml) {
242
+ return parse_ml_string_chars(lexer);
243
+ }
244
+ if (sl1) {
245
+ return parse_slx_string_chars(lexer, 1);
246
+ }
247
+ if (ml1) {
248
+ return parse_mlx_string_chars(lexer, 1);
249
+ }
250
+ if (sl2) {
251
+ return parse_slx_string_chars(lexer, 2);
252
+ }
253
+ if (ml2) {
254
+ return parse_mlx_string_chars(lexer, 2);
255
+ }
256
+ if (sl3) {
257
+ return parse_slx_string_chars(lexer, 3);
258
+ }
259
+ if (ml3) {
260
+ return parse_mlx_string_chars(lexer, 3);
261
+ }
262
+ if (sl4) {
263
+ return parse_slx_string_chars(lexer, 4);
264
+ }
265
+ if (ml4) {
266
+ return parse_mlx_string_chars(lexer, 4);
267
+ }
268
+ if (sl5) {
269
+ return parse_slx_string_chars(lexer, 5);
270
+ }
271
+ if (ml5) {
272
+ return parse_mlx_string_chars(lexer, 5);
273
+ }
274
+ if (sl6) {
275
+ return parse_slx_string_chars(lexer, 6);
276
+ }
277
+ if (ml6) {
278
+ return parse_mlx_string_chars(lexer, 6);
279
+ }
280
+ if (osb || oeb) {
281
+ return parse_square_bracket_variant(lexer, osb, oeb);
282
+ }
283
+ return false;
284
+ }
285
+
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { glob as _glob } from 'glob'
17
+ import * as fs from 'fs/promises'
18
+ import { promisify } from 'util'
19
+ import * as path from 'path'
20
+ import { spawn as _spawn } from 'child_process'
21
+
22
+ const glob = promisify(_glob);
23
+ const spawn = promisify(_spawn);
24
+
25
+ const testDir = '../pkl/pkl-core/src/test/files/LanguageSnippetTests/input';
26
+ const pattern = '**/*.pkl';
27
+ const treeSitterCmd = 'node_modules/.bin/tree-sitter';
28
+
29
+ (async () => {
30
+ await fs.rmdir('corpus/snippetTests/', { recursive: true });
31
+
32
+ const srcFiles = await glob(`${testDir}/${pattern}`);
33
+ for (const srcFile of srcFiles) {
34
+ const contents = await fs.readFile(srcFile, { encoding: 'utf-8' })
35
+ const testName = srcFile.replace(testDir + '/', '').replace(/.pkl$/, '')
36
+ const output = `==========\n${testName}\n==========\n\n${contents.trim()}\n\n---\n\n`
37
+ const dest = `corpus/snippetTests/${testName}.txt`;
38
+ // const destExists = await fs.
39
+ await fs.mkdir(path.dirname(dest), { recursive: true });
40
+ await fs.writeFile(dest, output, { encoding: 'utf-8' });
41
+ }
42
+
43
+ await spawn(treeSitterCmd, ['test', '--update'], { stdio: 'inherit' });
44
+ })();
@@ -0,0 +1,224 @@
1
+ #ifndef TREE_SITTER_PARSER_H_
2
+ #define TREE_SITTER_PARSER_H_
3
+
4
+ #ifdef __cplusplus
5
+ extern "C" {
6
+ #endif
7
+
8
+ #include <stdbool.h>
9
+ #include <stdint.h>
10
+ #include <stdlib.h>
11
+
12
+ #define ts_builtin_sym_error ((TSSymbol)-1)
13
+ #define ts_builtin_sym_end 0
14
+ #define TREE_SITTER_SERIALIZATION_BUFFER_SIZE 1024
15
+
16
+ typedef uint16_t TSStateId;
17
+
18
+ #ifndef TREE_SITTER_API_H_
19
+ typedef uint16_t TSSymbol;
20
+ typedef uint16_t TSFieldId;
21
+ typedef struct TSLanguage TSLanguage;
22
+ #endif
23
+
24
+ typedef struct {
25
+ TSFieldId field_id;
26
+ uint8_t child_index;
27
+ bool inherited;
28
+ } TSFieldMapEntry;
29
+
30
+ typedef struct {
31
+ uint16_t index;
32
+ uint16_t length;
33
+ } TSFieldMapSlice;
34
+
35
+ typedef struct {
36
+ bool visible;
37
+ bool named;
38
+ bool supertype;
39
+ } TSSymbolMetadata;
40
+
41
+ typedef struct TSLexer TSLexer;
42
+
43
+ struct TSLexer {
44
+ int32_t lookahead;
45
+ TSSymbol result_symbol;
46
+ void (*advance)(TSLexer *, bool);
47
+ void (*mark_end)(TSLexer *);
48
+ uint32_t (*get_column)(TSLexer *);
49
+ bool (*is_at_included_range_start)(const TSLexer *);
50
+ bool (*eof)(const TSLexer *);
51
+ };
52
+
53
+ typedef enum {
54
+ TSParseActionTypeShift,
55
+ TSParseActionTypeReduce,
56
+ TSParseActionTypeAccept,
57
+ TSParseActionTypeRecover,
58
+ } TSParseActionType;
59
+
60
+ typedef union {
61
+ struct {
62
+ uint8_t type;
63
+ TSStateId state;
64
+ bool extra;
65
+ bool repetition;
66
+ } shift;
67
+ struct {
68
+ uint8_t type;
69
+ uint8_t child_count;
70
+ TSSymbol symbol;
71
+ int16_t dynamic_precedence;
72
+ uint16_t production_id;
73
+ } reduce;
74
+ uint8_t type;
75
+ } TSParseAction;
76
+
77
+ typedef struct {
78
+ uint16_t lex_state;
79
+ uint16_t external_lex_state;
80
+ } TSLexMode;
81
+
82
+ typedef union {
83
+ TSParseAction action;
84
+ struct {
85
+ uint8_t count;
86
+ bool reusable;
87
+ } entry;
88
+ } TSParseActionEntry;
89
+
90
+ struct TSLanguage {
91
+ uint32_t version;
92
+ uint32_t symbol_count;
93
+ uint32_t alias_count;
94
+ uint32_t token_count;
95
+ uint32_t external_token_count;
96
+ uint32_t state_count;
97
+ uint32_t large_state_count;
98
+ uint32_t production_id_count;
99
+ uint32_t field_count;
100
+ uint16_t max_alias_sequence_length;
101
+ const uint16_t *parse_table;
102
+ const uint16_t *small_parse_table;
103
+ const uint32_t *small_parse_table_map;
104
+ const TSParseActionEntry *parse_actions;
105
+ const char * const *symbol_names;
106
+ const char * const *field_names;
107
+ const TSFieldMapSlice *field_map_slices;
108
+ const TSFieldMapEntry *field_map_entries;
109
+ const TSSymbolMetadata *symbol_metadata;
110
+ const TSSymbol *public_symbol_map;
111
+ const uint16_t *alias_map;
112
+ const TSSymbol *alias_sequences;
113
+ const TSLexMode *lex_modes;
114
+ bool (*lex_fn)(TSLexer *, TSStateId);
115
+ bool (*keyword_lex_fn)(TSLexer *, TSStateId);
116
+ TSSymbol keyword_capture_token;
117
+ struct {
118
+ const bool *states;
119
+ const TSSymbol *symbol_map;
120
+ void *(*create)(void);
121
+ void (*destroy)(void *);
122
+ bool (*scan)(void *, TSLexer *, const bool *symbol_whitelist);
123
+ unsigned (*serialize)(void *, char *);
124
+ void (*deserialize)(void *, const char *, unsigned);
125
+ } external_scanner;
126
+ const TSStateId *primary_state_ids;
127
+ };
128
+
129
+ /*
130
+ * Lexer Macros
131
+ */
132
+
133
+ #define START_LEXER() \
134
+ bool result = false; \
135
+ bool skip = false; \
136
+ bool eof = false; \
137
+ int32_t lookahead; \
138
+ goto start; \
139
+ next_state: \
140
+ lexer->advance(lexer, skip); \
141
+ start: \
142
+ skip = false; \
143
+ lookahead = lexer->lookahead;
144
+
145
+ #define ADVANCE(state_value) \
146
+ { \
147
+ state = state_value; \
148
+ goto next_state; \
149
+ }
150
+
151
+ #define SKIP(state_value) \
152
+ { \
153
+ skip = true; \
154
+ state = state_value; \
155
+ goto next_state; \
156
+ }
157
+
158
+ #define ACCEPT_TOKEN(symbol_value) \
159
+ result = true; \
160
+ lexer->result_symbol = symbol_value; \
161
+ lexer->mark_end(lexer);
162
+
163
+ #define END_STATE() return result;
164
+
165
+ /*
166
+ * Parse Table Macros
167
+ */
168
+
169
+ #define SMALL_STATE(id) id - LARGE_STATE_COUNT
170
+
171
+ #define STATE(id) id
172
+
173
+ #define ACTIONS(id) id
174
+
175
+ #define SHIFT(state_value) \
176
+ {{ \
177
+ .shift = { \
178
+ .type = TSParseActionTypeShift, \
179
+ .state = state_value \
180
+ } \
181
+ }}
182
+
183
+ #define SHIFT_REPEAT(state_value) \
184
+ {{ \
185
+ .shift = { \
186
+ .type = TSParseActionTypeShift, \
187
+ .state = state_value, \
188
+ .repetition = true \
189
+ } \
190
+ }}
191
+
192
+ #define SHIFT_EXTRA() \
193
+ {{ \
194
+ .shift = { \
195
+ .type = TSParseActionTypeShift, \
196
+ .extra = true \
197
+ } \
198
+ }}
199
+
200
+ #define REDUCE(symbol_val, child_count_val, ...) \
201
+ {{ \
202
+ .reduce = { \
203
+ .type = TSParseActionTypeReduce, \
204
+ .symbol = symbol_val, \
205
+ .child_count = child_count_val, \
206
+ __VA_ARGS__ \
207
+ }, \
208
+ }}
209
+
210
+ #define RECOVER() \
211
+ {{ \
212
+ .type = TSParseActionTypeRecover \
213
+ }}
214
+
215
+ #define ACCEPT_INPUT() \
216
+ {{ \
217
+ .type = TSParseActionTypeAccept \
218
+ }}
219
+
220
+ #ifdef __cplusplus
221
+ }
222
+ #endif
223
+
224
+ #endif // TREE_SITTER_PARSER_H_
package/tsconfig.json ADDED
@@ -0,0 +1,101 @@
1
+ {
2
+ "compilerOptions": {
3
+ /* Visit https://aka.ms/tsconfig.json to read more about this file */
4
+
5
+ /* Projects */
6
+ // "incremental": true, /* Enable incremental compilation */
7
+ // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
8
+ // "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */
9
+ // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */
10
+ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
11
+ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12
+
13
+ /* Language and Environment */
14
+ "target": "esnext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
15
+ // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
16
+ // "jsx": "preserve", /* Specify what JSX code is generated. */
17
+ // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
18
+ // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
19
+ // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */
20
+ // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
21
+ // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */
22
+ // "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */
23
+ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
24
+ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
25
+
26
+ /* Modules */
27
+ "module": "CommonJS", /* Specify what module code is generated. */
28
+ // "rootDir": "./", /* Specify the root folder within your source files. */
29
+ // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
30
+ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
31
+ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
32
+ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
33
+ // "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
34
+ // "types": [], /* Specify type package names to be included without being referenced in a source file. */
35
+ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
36
+ // "resolveJsonModule": true, /* Enable importing .json files */
37
+ // "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
38
+
39
+ /* JavaScript Support */
40
+ // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */
41
+ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
42
+ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
43
+
44
+ /* Emit */
45
+ // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
46
+ // "declarationMap": true, /* Create sourcemaps for d.ts files. */
47
+ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
48
+ // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
49
+ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
50
+ // "outDir": "./", /* Specify an output folder for all emitted files. */
51
+ // "removeComments": true, /* Disable emitting comments. */
52
+ // "noEmit": true, /* Disable emitting files from a compilation. */
53
+ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
54
+ // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
55
+ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
56
+ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
57
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
58
+ // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
59
+ // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
60
+ // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
61
+ // "newLine": "crlf", /* Set the newline character for emitting files. */
62
+ // "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */
63
+ // "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */
64
+ // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
65
+ // "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */
66
+ // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
67
+ // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
68
+
69
+ /* Interop Constraints */
70
+ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
71
+ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
72
+ "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */
73
+ // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
74
+ "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
75
+
76
+ /* Type Checking */
77
+ "strict": true, /* Enable all strict type-checking options. */
78
+ // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */
79
+ // "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */
80
+ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
81
+ // "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */
82
+ // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
83
+ // "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */
84
+ // "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */
85
+ // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
86
+ // "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */
87
+ // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
88
+ // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
89
+ // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
90
+ // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
91
+ // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
92
+ // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
93
+ // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */
94
+ // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
95
+ // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
96
+
97
+ /* Completeness */
98
+ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
99
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */
100
+ },
101
+ }