auto-translate-json-library 1.2.9 → 1.3.1

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/lib.ts DELETED
@@ -1,219 +0,0 @@
1
- // The module 'vscode' contains the VS Code extensibility API
2
- // Import the module and reference it with the alias vscode in your code below
3
- import { Files, IFiles } from "./files";
4
- import { FolderFiles } from "./folderFiles";
5
-
6
- import { AWSTranslate } from "./aws";
7
- import { AzureTranslate } from "./azure";
8
- import { Configuration } from "./config";
9
- import { DeepLTranslate } from "./deepl";
10
- import { GoogleTranslate } from "./google";
11
- import { OpenAITranslate } from "./openai";
12
- import { ITranslate, TranslationFile } from "./translate.interface";
13
- import { Util } from "./util";
14
-
15
- export async function translate(
16
- sourceFile: string,
17
- config: Configuration,
18
- ): Promise<void> {
19
- // set the delimiters for named arguments
20
- const startDelimiter = config.startDelimiter || "{";
21
- if (startDelimiter) {
22
- Util.startDelimiter = startDelimiter;
23
- }
24
-
25
- const endDelimiter = config.endDelimiter || "}";
26
- if (endDelimiter) {
27
- Util.endDelimiter = endDelimiter;
28
- }
29
-
30
- let translateEngine: ITranslate;
31
-
32
- if (config.translationKeyInfo.kind === "google") {
33
- translateEngine = await GoogleTranslate.initialize(
34
- config.translationKeyInfo.apiKey,
35
- );
36
- } else if (config.translationKeyInfo.kind === "aws") {
37
- translateEngine = new AWSTranslate(
38
- config.translationKeyInfo.accessKeyId,
39
- config.translationKeyInfo.secretAccessKey,
40
- config.translationKeyInfo.region,
41
- );
42
- } else if (config.translationKeyInfo.kind === "azure") {
43
- translateEngine = new AzureTranslate(
44
- config.translationKeyInfo.secretKey,
45
- config.translationKeyInfo.region,
46
- );
47
- } else if (config.translationKeyInfo.kind === "deepLFree") {
48
- translateEngine = new DeepLTranslate(
49
- config.translationKeyInfo.secretKey,
50
- "free",
51
- );
52
- } else if (config.translationKeyInfo.kind === "deepLPro") {
53
- translateEngine = new DeepLTranslate(
54
- config.translationKeyInfo.secretKey,
55
- "pro",
56
- );
57
- } else if (config.translationKeyInfo.kind === "openai") {
58
- translateEngine = new OpenAITranslate(config.translationKeyInfo.apiKey);
59
- } else {
60
- console.warn(
61
- "You must provide a Google, AWS, Azure, deepL, openai parameters first in the extension settings.",
62
- );
63
- return;
64
- }
65
-
66
- const fileMode = config.mode;
67
- const files = readFiles(sourceFile, fileMode);
68
- if (files === null) {
69
- return;
70
- }
71
-
72
- // enforce source locale if provided in settings
73
- if (config.sourceLocale !== files.sourceLocale) {
74
- console.log(
75
- `You must use the ${config.sourceLocale}.json file due to your Source Locale setting.`,
76
- );
77
- return;
78
- }
79
-
80
- const keepTranslations = config.keepTranslations === "keep";
81
- const keepExtras = config.keepExtraTranslations === "keep";
82
-
83
- // load source JSON
84
- let source: TranslationFile;
85
- try {
86
- source = await files.loadJsonFromLocale(files.sourceLocale);
87
- } catch (error) {
88
- if (error instanceof Error) {
89
- console.log(error, "Source file malformed");
90
- }
91
- return;
92
- }
93
-
94
- // Iterate target Locales
95
- files.targetLocales.forEach(async (targetLocale, _index, _array) => {
96
- try {
97
- const isValid = await translateEngine.isValidLocale(targetLocale);
98
- if (!isValid) {
99
- throw Error(`${targetLocale} is not supported. Skipping.`);
100
- }
101
-
102
- const targetOriginal = await files.loadJsonFromLocale(targetLocale);
103
-
104
- // Iterate source terms
105
- const targetNew = await recurseNode(
106
- source,
107
- targetOriginal,
108
- keepTranslations,
109
- keepExtras,
110
- files.sourceLocale,
111
- targetLocale,
112
- translateEngine,
113
- config.ignorePrefix,
114
- );
115
-
116
- // save target
117
- files.saveJsonToLocale(targetLocale, targetNew);
118
-
119
- const feedback = `Translated locale '${targetLocale}'`;
120
- console.log(feedback);
121
- } catch (error) {
122
- if (error instanceof Error) {
123
- console.error(error);
124
- }
125
- return;
126
- }
127
- });
128
- }
129
-
130
- const readFiles: (filePath: string, mode: "file" | "folder") => IFiles | null =
131
- (filePath: string, mode: string) => {
132
- try {
133
- const files: IFiles =
134
- mode === "file" ? new Files(filePath) : new FolderFiles(filePath);
135
-
136
- // log locale info
137
- console.log(`Source locale = ${files.sourceLocale}`);
138
- console.log(`Target locales = ${files.targetLocales}`);
139
-
140
- return files;
141
- } catch (error) {
142
- if (error instanceof Error) {
143
- console.error(error);
144
- }
145
- return null;
146
- }
147
- };
148
-
149
- async function recurseNode(
150
- source: TranslationFile,
151
- original: TranslationFile,
152
- keepTranslations: boolean | null,
153
- keepExtras: boolean | null,
154
- sourceLocale: string,
155
- locale: string,
156
- translateEngine: ITranslate,
157
- ignorePrefix = "",
158
- isArray = false,
159
- ): Promise<TranslationFile> {
160
- // biome-ignore lint/suspicious/noExplicitAny: <explanation>
161
- const destination: any = isArray ? [] : {};
162
-
163
- // defaults
164
- if (keepTranslations === null) {
165
- keepTranslations = true;
166
- }
167
- if (keepExtras === null) {
168
- keepExtras = true;
169
- }
170
-
171
- for (const term in source) {
172
- const node = source[term];
173
-
174
- if (node instanceof Object && node !== null) {
175
- destination[term] = await recurseNode(
176
- node,
177
- original[term] ?? {},
178
- keepTranslations,
179
- keepExtras,
180
- sourceLocale,
181
- locale,
182
- translateEngine,
183
- ignorePrefix,
184
- node instanceof Array,
185
- );
186
- } else {
187
- // if we already have a translation, keep it
188
- if (keepTranslations && original[term]) {
189
- destination[term] = original[term];
190
- } else if (typeof node === "number" || typeof node === "boolean") {
191
- // numbers and booleans do not need translations
192
- destination[term] = node;
193
- } else {
194
- if (
195
- ignorePrefix === "" ||
196
- (ignorePrefix !== "" && !term.startsWith(ignorePrefix))
197
- ) {
198
- const translation = await translateEngine
199
- .translateText(node, sourceLocale, locale)
200
- .catch((err) => console.error(err));
201
- destination[term] = translation;
202
- } else {
203
- delete destination[term];
204
- }
205
- }
206
- }
207
- }
208
-
209
- if (keepExtras) {
210
- // add back in any terms that were not in source
211
- for (const term in original) {
212
- if (!destination[term]) {
213
- destination[term] = original[term];
214
- }
215
- }
216
- }
217
-
218
- return destination;
219
- }
package/src/openai.ts DELETED
@@ -1,167 +0,0 @@
1
- import { OpenAI } from "openai";
2
- import { ITranslate } from "./translate.interface";
3
- import { Util } from "./util";
4
-
5
- const supportedLanguages: { [key: string]: string } = {
6
- af: "Afrikaans",
7
- sq: "Albanian",
8
- am: "Amharic",
9
- ar: "Arabic",
10
- hy: "Armenian",
11
- az: "Azerbaijani",
12
- eu: "Basque",
13
- be: "Belarusian",
14
- bn: "Bengali",
15
- bs: "Bosnian",
16
- bg: "Bulgarian",
17
- ca: "Catalan",
18
- ceb: "Cebuano",
19
- "zh-CN": "Chinese (Simplified)",
20
- "zh-TW": "Chinese (Traditional)",
21
- co: "Corsican",
22
- hr: "Croatian",
23
- cs: "Czech",
24
- da: "Danish",
25
- nl: "Dutch",
26
- en: "English",
27
- eo: "Esperanto",
28
- et: "Estonian",
29
- fi: "Finnish",
30
- fr: "French",
31
- fy: "Frisian",
32
- gl: "Galician",
33
- ka: "Georgian",
34
- de: "German",
35
- el: "Greek",
36
- gu: "Gujarati",
37
- ht: "Haitian Creole",
38
- ha: "Hausa",
39
- haw: "Hawaiian",
40
- he: "Hebrew",
41
- hi: "Hindi",
42
- hmn: "Hmong",
43
- hu: "Hungarian",
44
- is: "Icelandic",
45
- ig: "Igbo",
46
- id: "Indonesian",
47
- ga: "Irish",
48
- it: "Italian",
49
- ja: "Japanese",
50
- jv: "Javanese",
51
- kn: "Kannada",
52
- kk: "Kazakh",
53
- km: "Khmer",
54
- ko: "Korean",
55
- ku: "Kurdish",
56
- ky: "Kyrgyz",
57
- lo: "Lao",
58
- la: "Latin",
59
- lv: "Latvian",
60
- lt: "Lithuanian",
61
- lb: "Luxembourgish",
62
- mk: "Macedonian",
63
- mg: "Malagasy",
64
- ms: "Malay",
65
- ml: "Malayalam",
66
- mt: "Maltese",
67
- mi: "Maori",
68
- mr: "Marathi",
69
- mn: "Mongolian",
70
- my: "Myanmar (Burmese)",
71
- ne: "Nepali",
72
- no: "Norwegian",
73
- ny: "Nyanja (Chichewa)",
74
- or: "Odia (Oriya)",
75
- ps: "Pashto",
76
- fa: "Persian",
77
- pl: "Polish",
78
- pt: "Portuguese",
79
- pa: "Punjabi",
80
- ro: "Romanian",
81
- ru: "Russian",
82
- sm: "Samoan",
83
- gd: "Scots Gaelic",
84
- sr: "Serbian",
85
- st: "Sesotho",
86
- sn: "Shona",
87
- sd: "Sindhi",
88
- si: "Sinhala (Sinhalese)",
89
- sk: "Slovak",
90
- sl: "Slovenian",
91
- so: "Somali",
92
- es: "Spanish",
93
- su: "Sundanese",
94
- sw: "Swahili",
95
- sv: "Swedish",
96
- tl: "Tagalog (Filipino)",
97
- tg: "Tajik",
98
- ta: "Tamil",
99
- tt: "Tatar",
100
- te: "Telugu",
101
- th: "Thai",
102
- tr: "Turkish",
103
- tk: "Turkmen",
104
- uk: "Ukrainian",
105
- ur: "Urdu",
106
- ug: "Uyghur",
107
- uz: "Uzbek",
108
- vi: "Vietnamese",
109
- cy: "Welsh",
110
- xh: "Xhosa",
111
- yi: "Yiddish",
112
- yo: "Yoruba",
113
- zu: "Zulu",
114
- };
115
-
116
- export class OpenAITranslate implements ITranslate {
117
- private openai;
118
- constructor(apiKey: string) {
119
- const configuration = {
120
- apiKey: apiKey,
121
- };
122
- this.openai = new OpenAI(configuration);
123
- }
124
- isValidLocale(targetLocale: string): boolean {
125
- return targetLocale in supportedLanguages;
126
- }
127
- async translateText(
128
- text: string,
129
- sourceLocale: string,
130
- targetLocale: string,
131
- ): Promise<string> {
132
- if (sourceLocale !== "en") {
133
- throw Error(
134
- `${sourceLocale} is not supported.Currently we support just English `,
135
- );
136
- }
137
-
138
- let result = "";
139
- let args;
140
- ({ args, text } = Util.replaceContextVariables(text));
141
- const prompt = `You will be provided with a sentence in English, and your task is to translate it into ${
142
- supportedLanguages[targetLocale] as string
143
- }:\n${text}\n.`;
144
- const response = await this.openai.chat.completions.create({
145
- model: "text-davinci-003",
146
- messages: [{ role: "system", content: prompt }],
147
- temperature: 0.2,
148
- max_tokens: 250,
149
- top_p: 1.0,
150
- n: 1,
151
- frequency_penalty: 0.0,
152
- presence_penalty: 0.0,
153
- });
154
-
155
- if (response.choices[0].message.content !== null) {
156
- result = Util.replaceArgumentsWithNumbers(
157
- args,
158
- response.choices[0].message.content,
159
- );
160
- result = result.replace(/^\n+|\n+$/g, "");
161
- } else {
162
- console.error(`can not translate text with prompt :${prompt}`);
163
- result = Util.replaceArgumentsWithNumbers(args, result);
164
- }
165
- return result;
166
- }
167
- }
@@ -1,13 +0,0 @@
1
- export interface ITranslate {
2
- isValidLocale(targetLocale: string): boolean;
3
- translateText(
4
- text: string,
5
- sourceLocale: string,
6
- targetLocale: string,
7
- ): Promise<string>;
8
- }
9
-
10
- export interface TranslationFile {
11
- // biome-ignore lint/suspicious/noExplicitAny: <explanation>
12
- [key: string]: any;
13
- }
package/src/util.ts DELETED
@@ -1,57 +0,0 @@
1
- // biome-ignore lint/complexity/noStaticOnlyClass: <explanation>
2
- export class Util {
3
- private static _startDelimiter = "{";
4
- private static _endDelimiter = "}";
5
- private static pattern = new RegExp(
6
- `${Util._startDelimiter}(.*?)${Util._endDelimiter}`,
7
- "g",
8
- );
9
-
10
- public static set startDelimiter(value: string) {
11
- Util._startDelimiter = value;
12
- // update regex
13
- Util.pattern = new RegExp(
14
- `${Util._startDelimiter}(.*?)${Util._endDelimiter}`,
15
- "g",
16
- );
17
- }
18
-
19
- public static set endDelimiter(value: string) {
20
- Util._endDelimiter = value;
21
- // update regex
22
- Util.pattern = new RegExp(
23
- `${Util._startDelimiter}(.*?)${Util._endDelimiter}`,
24
- "g",
25
- );
26
- }
27
- public static replaceArgumentsWithNumbers(
28
- args: RegExpMatchArray | null,
29
- result: string,
30
- ) {
31
- if (args) {
32
- let i = 0;
33
- for (const arg of args) {
34
- result = result.replace(
35
- Util._startDelimiter + i + Util._endDelimiter,
36
- arg,
37
- );
38
- i++;
39
- }
40
- }
41
- return result;
42
- }
43
-
44
- public static replaceContextVariables(text: string) {
45
- const args = text.match(Util.pattern);
46
-
47
- // replace arguments with numbers
48
- if (args) {
49
- let i = 0;
50
- for (const arg of args) {
51
- text = text.replace(arg, Util._startDelimiter + i + Util._endDelimiter);
52
- i++;
53
- }
54
- }
55
- return { args, text };
56
- }
57
- }
@@ -1,22 +0,0 @@
1
- {
2
- "hello.txt": "Hello, world!",
3
- "@@ignore.me": "Ignore me",
4
-
5
- "accountLayout": {
6
- "myProfile": "My profile",
7
- "myAddressBook": "My address book",
8
- "vouchers": "Vouchers",
9
- "myOrders": "My orders",
10
- "myWishlist": "My wishlist",
11
- "comparedList": "Compared list"
12
- },
13
- "trackOrder": {
14
- "estimatedDelivery": "Estimated delivery",
15
- "estimated": "Estimated",
16
- "enterCode": "Enter the track code of your order",
17
- "trackOrder": "Track Your Order",
18
- "orderStatus": "Status of the Order",
19
- "haveAnOrder": "Have an order? Want to know where your order is now?",
20
- "knowProgress": "Know the progress of your product delivery."
21
- }
22
- }
File without changes
@@ -1,21 +0,0 @@
1
- {
2
- "hello.txt": "Bonjour tout le monde !",
3
- "@@ignore.me": "Ignore-moi",
4
- "accountLayout": {
5
- "myProfile": "Mon profil",
6
- "myAddressBook": "Mon carnet d'adresses",
7
- "vouchers": "Bons d'achat",
8
- "myOrders": "Mes commandes",
9
- "myWishlist": "Ma liste d'envies",
10
- "comparedList": "Liste comparée"
11
- },
12
- "trackOrder": {
13
- "estimatedDelivery": "Livraison estimée",
14
- "estimated": "Estimé",
15
- "enterCode": "Entrez le code de suivi de votre commande",
16
- "trackOrder": "Suivez votre commande",
17
- "orderStatus": "État de la commande",
18
- "haveAnOrder": "Vous avez une commande ? Vous voulez savoir où se trouve actuellement votre commande ?",
19
- "knowProgress": "Suivez l'avancement de la livraison de vos produits."
20
- }
21
- }
@@ -1,21 +0,0 @@
1
- {
2
- "hello.txt": "Zdravo, svet!",
3
- "@@ignore.me": "Ignoriši me",
4
- "accountLayout": {
5
- "myProfile": "Moj profil",
6
- "myAddressBook": "Moj adresar",
7
- "vouchers": "Vaučeri",
8
- "myOrders": "Moje naređenja",
9
- "myWishlist": "Moja lista želja",
10
- "comparedList": "Upoređena lista"
11
- },
12
- "trackOrder": {
13
- "estimatedDelivery": "Procenjena isporuka",
14
- "estimated": "Procenjeno",
15
- "enterCode": "Unesite kod numere vaše porudžbine",
16
- "trackOrder": "Pratite svoju porudžbinu",
17
- "orderStatus": "Status naloga",
18
- "haveAnOrder": "Imate nalog? Želite da znate gde je vaša narudžba sada?",
19
- "knowProgress": "Znajte napredak isporuke proizvoda."
20
- }
21
- }
@@ -1,9 +0,0 @@
1
- {
2
- "dashboard": "Armaturenbrett",
3
- "pricing": "Preisgestaltung",
4
- "sign-in": "anmelden",
5
- "settings": "Einstellungen",
6
- "language": "Sprache",
7
- "get-credit": "Holen Sie sich Kredit",
8
- "logout": "Ausloggen"
9
- }
@@ -1,3 +0,0 @@
1
- {
2
- "credit-usage": "Kreditverwendung"
3
- }
@@ -1,9 +0,0 @@
1
- {
2
- "dashboard": "Dashboard",
3
- "pricing": "Pricing",
4
- "sign-in": "Sign in",
5
- "settings": "Settings",
6
- "language": "Language",
7
- "get-credit": "Get credit",
8
- "logout": "Logout"
9
- }
@@ -1,3 +0,0 @@
1
- {
2
- "credit-usage": "Credit usage"
3
- }
package/tsconfig.json DELETED
@@ -1,104 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- /* Visit https://aka.ms/tsconfig to read more about this file */
4
-
5
- /* Projects */
6
- // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
7
- // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
8
- // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
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": "es2016", /* 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
- // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
26
-
27
- /* Modules */
28
- "module": "commonjs", /* Specify what module code is generated. */
29
- // "rootDir": "./", /* Specify the root folder within your source files. */
30
- // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
31
- // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
32
- // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
33
- // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
34
- // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
35
- // "types": [], /* Specify type package names to be included without being referenced in a source file. */
36
- // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
37
- // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
38
- // "resolveJsonModule": true, /* Enable importing .json files. */
39
- // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
40
-
41
- /* JavaScript Support */
42
- // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
43
- // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
44
- // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
45
-
46
- /* Emit */
47
- "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
48
- // "declarationMap": true, /* Create sourcemaps for d.ts files. */
49
- // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
50
- // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
51
- // "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. */
52
- "outDir": "build", /* Specify an output folder for all emitted files. */
53
- // "removeComments": true, /* Disable emitting comments. */
54
- // "noEmit": true, /* Disable emitting files from a compilation. */
55
- // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
56
- // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
57
- // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
58
- // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
59
- // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
60
- // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
61
- // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
62
- // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
63
- // "newLine": "crlf", /* Set the newline character for emitting files. */
64
- // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
65
- // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
66
- // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
67
- // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
68
- // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
69
- // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
70
-
71
- /* Interop Constraints */
72
- // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
73
- // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
74
- "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
75
- // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
76
- "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
77
-
78
- /* Type Checking */
79
- "strict": true, /* Enable all strict type-checking options. */
80
- // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
81
- // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
82
- // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
83
- // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
84
- // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
85
- // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
86
- // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
87
- // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
88
- // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
89
- // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
90
- // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
91
- // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
92
- // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
93
- // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
94
- // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
95
- // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
96
- // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
97
- // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
98
-
99
- /* Completeness */
100
- // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
101
- "skipLibCheck": true,
102
- "resolveJsonModule": true /* Skip type checking all .d.ts files. */,
103
- }
104
- }