From 1de5a96cd0609a518aa78ec556ccd2499b3e5893 Mon Sep 17 00:00:00 2001 From: xucheng46 Date: Fri, 13 Oct 2023 17:25:01 +0800 Subject: [PATCH] print all ArkTS error as warning Issue: https://gitee.com/openharmony/third_party_typescript/issues/I87Z3G Test: ets bundle tests Signed-off-by: xucheng46 Change-Id: I532eb27ff7c500733bc3390ddec308116e6849e3 --- compiler/package-lock.json | 2 +- compiler/src/ets_checker.ts | 3 ++- compiler/src/fast_build/ark_compiler/check_import_module.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/package-lock.json b/compiler/package-lock.json index f9da5ee87..30b1e0be1 100644 --- a/compiler/package-lock.json +++ b/compiler/package-lock.json @@ -4148,7 +4148,7 @@ }, "typescript": { "version": "file:deps/ohos-typescript-4.2.3-r2.tgz", - "integrity": "sha512-gXEQNp7qZgph/d8sjg/JLDVxpC4V1Fwe7XoIw5LJZPuhNgfEljjj4/UTFSdQJecfY49PkQQJlzX3QhAsSOWKww==", + "integrity": "sha512-c6UtogkygDVD16aJFx3fDZNrd+fMFWvgxm1tLYKouQjB68DQ3sbGxBbG8r1uxZKjJUq3o4BwLNt46ioESeHs4Q==", "requires": { "json5": "^2.2.3" } diff --git a/compiler/src/ets_checker.ts b/compiler/src/ets_checker.ts index 6f25281b8..d932779ca 100644 --- a/compiler/src/ets_checker.ts +++ b/compiler/src/ets_checker.ts @@ -945,7 +945,8 @@ function runArkTSLinter(): void { } function printArkTSLinterDiagnostic(diagnostic: ts.Diagnostic): void { - if (diagnostic.category === ts.DiagnosticCategory.Error && (isInOhModuleFile(diagnostic) || isInSDK(diagnostic) || isInApplicationsStandard(diagnostic))) { + // print all error as warning + if (diagnostic.category === ts.DiagnosticCategory.Error) { const originalCategory = diagnostic.category; diagnostic.category = ts.DiagnosticCategory.Warning; printDiagnostic(diagnostic); diff --git a/compiler/src/fast_build/ark_compiler/check_import_module.ts b/compiler/src/fast_build/ark_compiler/check_import_module.ts index 1cba038ce..9b3979fc2 100644 --- a/compiler/src/fast_build/ark_compiler/check_import_module.ts +++ b/compiler/src/fast_build/ark_compiler/check_import_module.ts @@ -37,7 +37,7 @@ export function checkIfJsImportingArkts(rollupObject: any): void { `ArkTS:ERROR ArkTS:ERROR File: ${id}\n` + `Importing ArkTS files in JS and TS files is forbidden.\n`; const logger: any = rollupObject.share.getLogger(GEN_ABC_PLUGIN_NAME); - compilerOptions.isCompatibleVersion ? logger.warn(yellow + errorMsg) : logger.error(red + errorMsg); + logger.warn(yellow + errorMsg); } } ); -- Gitee