From c0751a67874ea67f2808a56626137a69f6e91ce9 Mon Sep 17 00:00:00 2001 From: DevDengChao <2325690622@qq.com> Date: Fri, 7 Jan 2022 15:09:07 +0800 Subject: [PATCH 1/4] refactor: reformat tsconfig.json --- src/schemas/json/tsconfig.json | 38 +++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/src/schemas/json/tsconfig.json b/src/schemas/json/tsconfig.json index ae6710e78a2..10d30ee030c 100644 --- a/src/schemas/json/tsconfig.json +++ b/src/schemas/json/tsconfig.json @@ -180,7 +180,10 @@ }, "declarationDir": { "description": "Specify the output directory for generated declaration files.", - "type": ["string", "null"], + "type": [ + "string", + "null" + ], "markdownDescription": "Specify the output directory for generated declaration files.\n\nSee more: https://www.typescriptlang.org/tsconfig#declarationDir" }, "diagnostics": { @@ -240,7 +243,13 @@ }, "jsx": { "description": "Specify what JSX code is generated.", - "enum": ["preserve", "react", "react-jsx", "react-jsxdev", "react-native"] + "enum": [ + "preserve", + "react", + "react-jsx", + "react-jsxdev", + "react-native" + ] }, "reactNamespace": { "description": "Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit.", @@ -308,7 +317,10 @@ "type": "string", "anyOf": [ { - "enum": ["Classic", "Node"] + "enum": [ + "Classic", + "Node" + ] }, { "pattern": "^(([Nn]ode)|([Cc]lassic))$" @@ -322,7 +334,10 @@ "type": "string", "anyOf": [ { - "enum": ["crlf", "lf"] + "enum": [ + "crlf", + "lf" + ] }, { "pattern": "^(CRLF|LF|crlf|lf)$" @@ -840,7 +855,11 @@ "importsNotUsedAsValues": { "description": "Specify emit/checking behavior for imports that are only used for types.", "default": "remove", - "enum": ["remove", "preserve", "error"] + "enum": [ + "remove", + "preserve", + "error" + ] }, "alwaysStrict": { "description": "Ensure 'use strict' is always emitted.", @@ -1038,7 +1057,9 @@ "type": "boolean" }, "ignore": { - "default": ["(?:^|/)node_modules/"], + "default": [ + "(?:^|/)node_modules/" + ], "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.", "items": { "type": "string" @@ -1048,7 +1069,10 @@ "ignoreDiagnostics": { "description": "Ignore TypeScript warnings by diagnostic code.", "items": { - "type": ["string", "number"] + "type": [ + "string", + "number" + ] }, "type": "array" }, From 28f0e7f2e6a414c5cdf41caca5b5624cb48bac53 Mon Sep 17 00:00:00 2001 From: DevDengChao <2325690622@qq.com> Date: Fri, 7 Jan 2022 15:10:37 +0800 Subject: [PATCH 2/4] fix: pattern dose not include "ES2022" for "module" in tsconfig.json --- src/schemas/json/tsconfig.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/schemas/json/tsconfig.json b/src/schemas/json/tsconfig.json index 10d30ee030c..7876b18781f 100644 --- a/src/schemas/json/tsconfig.json +++ b/src/schemas/json/tsconfig.json @@ -301,13 +301,13 @@ "ES2020", "ESNext", "None", - "es2022", - "node12", - "nodenext" + "ES2022", + "Node12", + "NodeNext" ] }, { - "pattern": "^([Cc][Oo][Mm][Mm][Oo][Nn][Jj][Ss]|[AaUu][Mm][Dd]|[Ss][Yy][Ss][Tt][Ee][Mm]|[Ee][Ss]([356]|201[567]|2020|[Nn][Ee][Xx][Tt])|[Nn][Oo][Nn][Ee])$" + "pattern": "^([Cc][Oo][Mm][Mm][Oo][Nn][Jj][Ss]|[AaUu][Mm][Dd]|[Ss][Yy][Ss][Tt][Ee][Mm]|[Ee][Ss]([356]|201[567]|202[0|2]|[Nn][Ee][Xx][Tt])|[Nn][Oo][Nn][Ee])$" } ], "markdownDescription": "Specify what module code is generated.\n\nSee more: https://www.typescriptlang.org/tsconfig#module" From 3491b4a4d58ae013dc95747749dcb4f8e705f6ba Mon Sep 17 00:00:00 2001 From: DevDengChao <2325690622@qq.com> Date: Fri, 7 Jan 2022 15:12:27 +0800 Subject: [PATCH 3/4] test: "ES2022" for "module" in tsconfig.json --- src/test/tsconfig/tsconfig-test.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/tsconfig/tsconfig-test.json b/src/test/tsconfig/tsconfig-test.json index 3c8457e6812..a848c92743d 100644 --- a/src/test/tsconfig/tsconfig-test.json +++ b/src/test/tsconfig/tsconfig-test.json @@ -1,6 +1,6 @@ { "compilerOptions": { "target": "ES2022", - "module": "CommonJS" + "module": "ES2022" } } From b49526ac05cd5d4b7e2befa8199a841228921737 Mon Sep 17 00:00:00 2001 From: dengchao <2325690622@qq.com> Date: Sat, 8 Jan 2022 15:12:17 +0800 Subject: [PATCH 4/4] refactor: optimize pattern --- src/schemas/json/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schemas/json/tsconfig.json b/src/schemas/json/tsconfig.json index 7876b18781f..18462a7ca67 100644 --- a/src/schemas/json/tsconfig.json +++ b/src/schemas/json/tsconfig.json @@ -307,7 +307,7 @@ ] }, { - "pattern": "^([Cc][Oo][Mm][Mm][Oo][Nn][Jj][Ss]|[AaUu][Mm][Dd]|[Ss][Yy][Ss][Tt][Ee][Mm]|[Ee][Ss]([356]|201[567]|202[0|2]|[Nn][Ee][Xx][Tt])|[Nn][Oo][Nn][Ee])$" + "pattern": "^([Cc][Oo][Mm][Mm][Oo][Nn][Jj][Ss]|[AaUu][Mm][Dd]|[Ss][Yy][Ss][Tt][Ee][Mm]|[Ee][Ss]([356]|20(1[567]|2[02])|[Nn][Ee][Xx][Tt])|[Nn][Oo][Nn][Ee])$" } ], "markdownDescription": "Specify what module code is generated.\n\nSee more: https://www.typescriptlang.org/tsconfig#module"