diff --git a/compiler/package-lock.json b/compiler/package-lock.json index 647d80027fa7c3f68e66a804cdda09a30e4b47f7..6ce814faaa6100ac581edbf567f2b54aba7370f3 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-bctLs0Jeb2po1894s30Jn+0gkwmp/d4l8iyKwQNAV8hkdPZKSkOF9YzaaoJJ69xuRiehvSDVB0k0PYBnQrZ65A==", + "integrity": "sha512-M4Axyf//rIMZSLliu1L9VCnv6G7w8zHvas/LVym78MKDtxPohezZ5mJ93RplXmPC/+0xgHTGqexnbuGmegViOg==", "requires": { "json5": "^2.2.3" } diff --git a/compiler/src/ets_checker.ts b/compiler/src/ets_checker.ts index f53efcff7ba5bf9ef47dab13e835f6ffb6ab8ca8..50c99a7b58ba743372aecdc5cbc0e21bf4616492 100644 --- a/compiler/src/ets_checker.ts +++ b/compiler/src/ets_checker.ts @@ -945,7 +945,7 @@ function runArkTSLinter(): void { } function printArkTSLinterDiagnostic(diagnostic: ts.Diagnostic): void { - if (diagnostic.category === ts.DiagnosticCategory.Error && (isInOhModuleFile(diagnostic) || isInSDK(diagnostic))) { + if (diagnostic.category === ts.DiagnosticCategory.Error && (isInOhModuleFile(diagnostic) || isInSDK(diagnostic) || isInApplicationsStandard(diagnostic))) { const originalCategory = diagnostic.category; diagnostic.category = ts.DiagnosticCategory.Warning; printDiagnostic(diagnostic); @@ -956,7 +956,11 @@ function printArkTSLinterDiagnostic(diagnostic: ts.Diagnostic): void { } function isInOhModuleFile(diagnostics: ts.Diagnostic): boolean { - return !!(diagnostics.file?.fileName.indexOf('/oh_modules/') !== -1); + return (diagnostics.file !== undefined) && (diagnostics.file.fileName.indexOf('/oh_modules/') !== -1); +} + +function isInApplicationsStandard(diagnostics: ts.Diagnostic): boolean { + return (diagnostics.file !== undefined) && (diagnostics.file.fileName.indexOf('/applications/standard/') !== -1); } function isInSDK(diagnostics: ts.Diagnostic): boolean { @@ -974,8 +978,7 @@ export function getArkTSLinterMode(): ArkTSLinterMode { } if (isStandardMode()) { - // change to STANDARD_MODE when we block the compilation - return ArkTSLinterMode.COMPATIBLE_MODE; + return ArkTSLinterMode.STANDARD_MODE; } return ArkTSLinterMode.COMPATIBLE_MODE; } 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 f7256d688815712f9a5cbd324a34d907b8e791a7..1cba038ce549af7fadf5b6c00cf2bf6a821e96d2 100644 --- a/compiler/src/fast_build/ark_compiler/check_import_module.ts +++ b/compiler/src/fast_build/ark_compiler/check_import_module.ts @@ -27,7 +27,7 @@ import { export function checkIfJsImportingArkts(rollupObject: any): void { ModuleSourceFile.getSourceFiles().forEach((sourceFile: ModuleSourceFile) => { const id: string = sourceFile.getModuleId(); - if (isJsSourceFile(id) && id.indexOf('/oh_modules/') === -1) { + if (isJsSourceFile(id) && id.indexOf('/oh_modules/') === -1 && id.indexOf('/applications/standard/') === -1) { const importMap = rollupObject.getModuleInfo(id).importedIdMaps; Object.values(importMap).forEach((requestFile: string) => { if (requestFile.endsWith(EXTNAME_ETS) || requestFile.endsWith(EXTNAME_D_ETS)) {