From 302b13e698db5b8ca750de7c90d773c974ea9e75 Mon Sep 17 00:00:00 2001 From: sefayilmazunal Date: Tue, 29 Jul 2025 08:50:48 +0300 Subject: [PATCH] fixed autofix overlap on asynclock Description: fixed an issue where 2 autofixes overlapped with each other regarding asynlock Issue: ICPHYM Signed-off-by: sefayilmazunal --- ets2panda/linter/src/lib/TypeScriptLinter.ts | 12 +- .../linter/src/lib/autofixes/Autofixer.ts | 8 + ...arktsutils_locks_asynclock.ets.arkts2.json | 84 +- ...rktsutils_locks_asynclock.ets.autofix.json | 21 + ...arktsutils_locks_asynclock.ets.migrate.ets | 2 +- .../no_support_isconcurrent.ets.arkts2.json | 86 +- .../no_support_isconcurrent2.ets.arkts2.json | 56 +- .../main/collections_module.ets.arkts2.json | 394 +++++---- .../main/collections_module.ets.autofix.json | 792 +++++++++-------- .../test/main/no_import_concurrency.ets | 5 + .../no_import_concurrency.ets.arkts2.json | 48 +- .../no_import_concurrency.ets.autofix.json | 803 ++++++++++-------- .../no_import_concurrency.ets.migrate.ets | 5 + .../no_import_concurrency.ets.migrate.json | 92 +- .../test/main/oh_modules/@arkts.utils.d.ets | 7 +- .../property_access_by_index.ets.arkts2.json | 10 + .../property_access_by_index.ets.autofix.json | 21 + ...askpool_deprecated_usages2.ets.arkts2.json | 12 +- 18 files changed, 1437 insertions(+), 1021 deletions(-) diff --git a/ets2panda/linter/src/lib/TypeScriptLinter.ts b/ets2panda/linter/src/lib/TypeScriptLinter.ts index e535b3251a..d29e9dff2b 100644 --- a/ets2panda/linter/src/lib/TypeScriptLinter.ts +++ b/ets2panda/linter/src/lib/TypeScriptLinter.ts @@ -3848,10 +3848,10 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { private checkMethodType(allBaseTypes: ts.Type[], methodName: string, node: ts.MethodDeclaration, isStatic: boolean = false): void { for (const baseType of allBaseTypes) { let baseMethod: ts.Symbol | undefined; - const symbol = baseType.getSymbol(); + const symbol = baseType.getSymbol(); if (isStatic && symbol) { const constructorType = this.tsTypeChecker.getTypeOfSymbolAtLocation(symbol, node); - baseMethod = constructorType.getProperty(methodName) || + baseMethod = constructorType.getProperty(methodName) || symbol.members?.get(ts.escapeLeadingUnderscores(methodName)); } else { baseMethod = baseType.getProperty(methodName); @@ -3859,7 +3859,7 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { if (!baseMethod) { continue; } - const baseMethodDecl = baseMethod.declarations?.find(d => + const baseMethodDecl = baseMethod.declarations?.find(d => (ts.isMethodDeclaration(d) || ts.isMethodSignature(d)) && this.isSameDeclarationType(d.parent, baseType, isStatic) ) as ts.MethodDeclaration | ts.MethodSignature; @@ -4022,7 +4022,7 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { }); } } - return [...resolvedBaseClasses, ...interfaces]; + return [...resolvedBaseClasses, ...interfaces]; } private getStaticAllBaseTypes(classDecl: ts.ClassDeclaration): ts.Type[] | undefined { @@ -4144,7 +4144,7 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { ): boolean { const baseMethodType = this.getActualReturnType(baseMethod); const derivedMethodType = this.getActualReturnType(derivedMethod); - + if (baseMethodType && (baseMethodType.flags & ts.TypeFlags.TypeParameter)) { if (derivedMethodType && !(derivedMethodType.flags & ts.TypeFlags.TypeParameter)) { return true; @@ -10177,7 +10177,7 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { return; } - const moduleName = (importDeclaration.moduleSpecifier as ts.StringLiteral).text; + const moduleName = path.basename((importDeclaration.moduleSpecifier as ts.StringLiteral).text); const expectedImports = MODULE_IMPORTS[moduleName]; if (!expectedImports) { return; diff --git a/ets2panda/linter/src/lib/autofixes/Autofixer.ts b/ets2panda/linter/src/lib/autofixes/Autofixer.ts index 9d3a0c1732..3312a4767c 100644 --- a/ets2panda/linter/src/lib/autofixes/Autofixer.ts +++ b/ets2panda/linter/src/lib/autofixes/Autofixer.ts @@ -2517,6 +2517,14 @@ export class Autofixer { if (ts.isIdentifier(node) && !ts.isImportClause(node.parent) && !ts.isImportSpecifier(node.parent)) { const nodeSymbol = this.typeChecker.getSymbolAtLocation(node); if (nodeSymbol === originalSymbol) { + // Skip any identifier that is part of a 'locks' qualification + const parent = node.parent; + if ( + ts.isQualifiedName(parent) && parent.right.text === ARKTSUTILS_LOCKS_MEMBER || + ts.isPropertyAccessExpression(parent) && parent.name.text === ARKTSUTILS_LOCKS_MEMBER + ) { + return; + } fixes.push({ start: node.getStart(), end: node.getEnd(), diff --git a/ets2panda/linter/test/concurrent/no_support_arktsutils_locks_asynclock.ets.arkts2.json b/ets2panda/linter/test/concurrent/no_support_arktsutils_locks_asynclock.ets.arkts2.json index 31d218b8f0..1dc77c9110 100644 --- a/ets2panda/linter/test/concurrent/no_support_arktsutils_locks_asynclock.ets.arkts2.json +++ b/ets2panda/linter/test/concurrent/no_support_arktsutils_locks_asynclock.ets.arkts2.json @@ -1,38 +1,48 @@ { - "copyright": [ - "Copyright (c) 2025 Huawei Device Co., Ltd.", - "Licensed under the Apache License, Version 2.0 (the 'License');", - "you may not use this file except in compliance with the License.", - "You may obtain a copy of the License at", - "", - "http://www.apache.org/licenses/LICENSE-2.0", - "", - "Unless required by applicable law or agreed to in writing, software", - "distributed under the License is distributed on an 'AS IS' BASIS,", - "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", - "See the License for the specific language governing permissions and", - "limitations under the License." - ], - "result": [ - { - "line": 18, - "column": 28, - "endLine": 18, - "endColumn": 33, - "problem": "LimitedStdLibNoImportConcurrency", - "suggest": "", - "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", - "severity": "ERROR" - }, - { - "line": 20, - "column": 28, - "endLine": 20, - "endColumn": 33, - "problem": "LimitedStdLibNoImportConcurrency", - "suggest": "", - "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", - "severity": "ERROR" - } - ] -} \ No newline at end of file + "copyright": [ + "Copyright (c) 2025 Huawei Device Co., Ltd.", + "Licensed under the Apache License, Version 2.0 (the 'License');", + "you may not use this file except in compliance with the License.", + "You may obtain a copy of the License at", + "", + "http://www.apache.org/licenses/LICENSE-2.0", + "", + "Unless required by applicable law or agreed to in writing, software", + "distributed under the License is distributed on an 'AS IS' BASIS,", + "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", + "See the License for the specific language governing permissions and", + "limitations under the License." + ], + "result": [ + { + "line": 16, + "column": 10, + "endLine": 16, + "endColumn": 20, + "problem": "LimitedStdLibNoImportConcurrency", + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 28, + "endLine": 18, + "endColumn": 33, + "problem": "LimitedStdLibNoImportConcurrency", + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 28, + "endLine": 20, + "endColumn": 33, + "problem": "LimitedStdLibNoImportConcurrency", + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + } + ] +} diff --git a/ets2panda/linter/test/concurrent/no_support_arktsutils_locks_asynclock.ets.autofix.json b/ets2panda/linter/test/concurrent/no_support_arktsutils_locks_asynclock.ets.autofix.json index 34839afbd9..a9919d0164 100644 --- a/ets2panda/linter/test/concurrent/no_support_arktsutils_locks_asynclock.ets.autofix.json +++ b/ets2panda/linter/test/concurrent/no_support_arktsutils_locks_asynclock.ets.autofix.json @@ -14,6 +14,27 @@ "limitations under the License." ], "result": [ + { + "line": 16, + "column": 10, + "endLine": 16, + "endColumn": 20, + "problem": "LimitedStdLibNoImportConcurrency", + "autofix": [ + { + "start": 605, + "end": 664, + "replacementText": "", + "line": 16, + "column": 10, + "endLine": 16, + "endColumn": 20 + } + ], + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, { "line": 18, "column": 28, diff --git a/ets2panda/linter/test/concurrent/no_support_arktsutils_locks_asynclock.ets.migrate.ets b/ets2panda/linter/test/concurrent/no_support_arktsutils_locks_asynclock.ets.migrate.ets index e4b1c6ec60..1ee4ccf899 100644 --- a/ets2panda/linter/test/concurrent/no_support_arktsutils_locks_asynclock.ets.migrate.ets +++ b/ets2panda/linter/test/concurrent/no_support_arktsutils_locks_asynclock.ets.migrate.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import { ArkTSUtils } from '../main/oh_modules/@kit.ArkTS'; + let lock1 = new AsyncLock(); diff --git a/ets2panda/linter/test/concurrent/no_support_isconcurrent.ets.arkts2.json b/ets2panda/linter/test/concurrent/no_support_isconcurrent.ets.arkts2.json index 9b627b9d72..45c876de1f 100644 --- a/ets2panda/linter/test/concurrent/no_support_isconcurrent.ets.arkts2.json +++ b/ets2panda/linter/test/concurrent/no_support_isconcurrent.ets.arkts2.json @@ -13,36 +13,56 @@ "See the License for the specific language governing permissions and", "limitations under the License." ], - "result": [ - { - "line": 20, - "column": 1, - "endLine": 20, - "endColumn": 12, - "problem": "LimitedStdLibNoDoncurrentDecorator", - "suggest": "", - "rule": "Usage of standard library is restricted(arkts-limited-stdlib-no-concurrent-decorator)", - "severity": "ERROR" - }, - { - "line": 23, - "column": 32, - "endLine": 23, - "endColumn": 44, - "problem": "IsConcurrentDeprecated", - "suggest": "", - "rule": "isConcurrent is not supported (arkts-limited-stdlib-no-support-isConcurrent)", - "severity": "ERROR" - }, - { - "line": 25, - "column": 27, - "endLine": 25, - "endColumn": 39, - "problem": "IsConcurrentDeprecated", - "suggest": "", - "rule": "isConcurrent is not supported (arkts-limited-stdlib-no-support-isConcurrent)", - "severity": "ERROR" - } - ] -} \ No newline at end of file + "result": [ + { + "line": 16, + "column": 10, + "endLine": 16, + "endColumn": 18, + "problem": "LimitedStdLibNoImportConcurrency", + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 10, + "endLine": 17, + "endColumn": 24, + "problem": "LimitedStdLibNoImportConcurrency", + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 1, + "endLine": 20, + "endColumn": 12, + "problem": "LimitedStdLibNoDoncurrentDecorator", + "suggest": "", + "rule": "Usage of standard library is restricted(arkts-limited-stdlib-no-concurrent-decorator)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 32, + "endLine": 23, + "endColumn": 44, + "problem": "IsConcurrentDeprecated", + "suggest": "", + "rule": "isConcurrent is not supported (arkts-limited-stdlib-no-support-isConcurrent)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 27, + "endLine": 25, + "endColumn": 39, + "problem": "IsConcurrentDeprecated", + "suggest": "", + "rule": "isConcurrent is not supported (arkts-limited-stdlib-no-support-isConcurrent)", + "severity": "ERROR" + } + ] +} diff --git a/ets2panda/linter/test/concurrent/no_support_isconcurrent2.ets.arkts2.json b/ets2panda/linter/test/concurrent/no_support_isconcurrent2.ets.arkts2.json index bdaa7adb27..25c12086b0 100755 --- a/ets2panda/linter/test/concurrent/no_support_isconcurrent2.ets.arkts2.json +++ b/ets2panda/linter/test/concurrent/no_support_isconcurrent2.ets.arkts2.json @@ -13,26 +13,36 @@ "See the License for the specific language governing permissions and", "limitations under the License." ], - "result": [ - { - "line": 15, - "column": 10, - "endLine": 15, - "endColumn": 18, - "problem": "LimitedStdLibNoImportConcurrency", - "suggest": "", - "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", - "severity": "ERROR" - }, - { - "line": 25, - "column": 25, - "endLine": 25, - "endColumn": 32, - "problem": "LimitedVoidType", - "suggest": "", - "rule": "Type \"void\" has no instances.(arkts-limited-void-type)", - "severity": "ERROR" - } - ] -} \ No newline at end of file + "result": [ + { + "line": 15, + "column": 10, + "endLine": 15, + "endColumn": 18, + "problem": "LimitedStdLibNoImportConcurrency", + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 16, + "column": 10, + "endLine": 16, + "endColumn": 31, + "problem": "LimitedStdLibNoImportConcurrency", + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 25, + "endLine": 25, + "endColumn": 32, + "problem": "LimitedVoidType", + "suggest": "", + "rule": "Type \"void\" has no instances.(arkts-limited-void-type)", + "severity": "ERROR" + } + ] +} diff --git a/ets2panda/linter/test/main/collections_module.ets.arkts2.json b/ets2panda/linter/test/main/collections_module.ets.arkts2.json index 6fb86f244d..58f5329c10 100644 --- a/ets2panda/linter/test/main/collections_module.ets.arkts2.json +++ b/ets2panda/linter/test/main/collections_module.ets.arkts2.json @@ -13,186 +13,216 @@ "See the License for the specific language governing permissions and", "limitations under the License." ], - "result": [ - { - "line": 16, - "column": 10, - "endLine": 16, - "endColumn": 21, - "problem": "NoNeedStdLibSendableContainer", - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" - }, - { - "line": 18, - "column": 25, - "endLine": 18, - "endColumn": 41, - "problem": "NoNeedStdLibSendableContainer", - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" - }, - { - "line": 20, - "column": 25, - "endLine": 20, - "endColumn": 39, - "problem": "NoNeedStdLibSendableContainer", - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" - }, - { - "line": 26, - "column": 23, - "endLine": 26, - "endColumn": 40, - "problem": "NoNeedStdLibSendableContainer", - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" - }, - { - "line": 26, - "column": 55, - "endLine": 26, - "endColumn": 72, - "problem": "NoNeedStdLibSendableContainer", - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" - }, - { - "line": 28, - "column": 28, - "endLine": 28, - "endColumn": 50, - "problem": "NoNeedStdLibSendableContainer", - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" - }, - { - "line": 30, - "column": 28, - "endLine": 30, - "endColumn": 48, - "problem": "NoNeedStdLibSendableContainer", - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" - }, - { - "line": 32, - "column": 21, - "endLine": 32, - "endColumn": 43, - "problem": "NoNeedStdLibSendableContainer", - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" - }, - { - "line": 34, - "column": 23, - "endLine": 34, - "endColumn": 45, - "problem": "NoNeedStdLibSendableContainer", - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" - }, - { - "line": 34, - "column": 60, - "endLine": 34, - "endColumn": 82, - "problem": "NoNeedStdLibSendableContainer", - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" - }, - { - "line": 40, - "column": 22, - "endLine": 40, - "endColumn": 39, - "problem": "NoNeedStdLibSendableContainer", - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" - }, - { - "line": 41, - "column": 11, - "endLine": 41, - "endColumn": 50, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 41, - "column": 17, - "endLine": 41, - "endColumn": 32, - "problem": "NoNeedStdLibSendableContainer", - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" - }, - { - "line": 41, - "column": 29, - "endLine": 41, - "endColumn": 32, - "problem": "ClassAsObjectError", - "suggest": "", - "rule": "Classes cannot be used as objects (arkts-no-classes-as-obj)", - "severity": "ERROR" - }, - { - "line": 44, - "column": 28, - "endLine": 44, - "endColumn": 49, - "problem": "NoNeedStdLibSendableContainer", - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" - }, - { - "line": 45, - "column": 11, - "endLine": 45, - "endColumn": 58, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 45, - "column": 27, - "endLine": 45, - "endColumn": 48, - "problem": "DynamicCtorCall", - "suggest": "", - "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", - "severity": "ERROR" - }, - { - "line": 45, - "column": 27, - "endLine": 45, - "endColumn": 48, - "problem": "NoNeedStdLibSendableContainer", - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" - } - ] + "result": [ + { + "line": 16, + "column": 10, + "endLine": 16, + "endColumn": 21, + "problem": "LimitedStdLibNoImportConcurrency", + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 16, + "column": 10, + "endLine": 16, + "endColumn": 21, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 10, + "endLine": 18, + "endColumn": 41, + "problem": "LimitedStdLibNoImportConcurrency", + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 25, + "endLine": 18, + "endColumn": 41, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 10, + "endLine": 20, + "endColumn": 39, + "problem": "LimitedStdLibNoImportConcurrency", + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 25, + "endLine": 20, + "endColumn": 39, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 23, + "endLine": 26, + "endColumn": 40, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 55, + "endLine": 26, + "endColumn": 72, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 28, + "endLine": 28, + "endColumn": 50, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 28, + "endLine": 30, + "endColumn": 48, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 21, + "endLine": 32, + "endColumn": 43, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 23, + "endLine": 34, + "endColumn": 45, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 60, + "endLine": 34, + "endColumn": 82, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 40, + "column": 22, + "endLine": 40, + "endColumn": 39, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 41, + "column": 11, + "endLine": 41, + "endColumn": 50, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 41, + "column": 17, + "endLine": 41, + "endColumn": 32, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 41, + "column": 29, + "endLine": 41, + "endColumn": 32, + "problem": "ClassAsObjectError", + "suggest": "", + "rule": "Classes cannot be used as objects (arkts-no-classes-as-obj)", + "severity": "ERROR" + }, + { + "line": 44, + "column": 28, + "endLine": 44, + "endColumn": 49, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 45, + "column": 11, + "endLine": 45, + "endColumn": 58, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 45, + "column": 27, + "endLine": 45, + "endColumn": 48, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 45, + "column": 27, + "endLine": 45, + "endColumn": 48, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + } + ] } diff --git a/ets2panda/linter/test/main/collections_module.ets.autofix.json b/ets2panda/linter/test/main/collections_module.ets.autofix.json index 9be897f59e..0fecc45697 100644 --- a/ets2panda/linter/test/main/collections_module.ets.autofix.json +++ b/ets2panda/linter/test/main/collections_module.ets.autofix.json @@ -1,370 +1,478 @@ { - "copyright": [ - "Copyright (c) 2025 Huawei Device Co., Ltd.", - "Licensed under the Apache License, Version 2.0 (the 'License');", - "you may not use this file except in compliance with the License.", - "You may obtain a copy of the License at", - "", - "http://www.apache.org/licenses/LICENSE-2.0", - "", - "Unless required by applicable law or agreed to in writing, software", - "distributed under the License is distributed on an 'AS IS' BASIS,", - "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", - "See the License for the specific language governing permissions and", - "limitations under the License." - ], - "result": [ + "copyright": [ + "Copyright (c) 2025 Huawei Device Co., Ltd.", + "Licensed under the Apache License, Version 2.0 (the 'License');", + "you may not use this file except in compliance with the License.", + "You may obtain a copy of the License at", + "", + "http://www.apache.org/licenses/LICENSE-2.0", + "", + "Unless required by applicable law or agreed to in writing, software", + "distributed under the License is distributed on an 'AS IS' BASIS,", + "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", + "See the License for the specific language governing permissions and", + "limitations under the License." + ], + "result": [ + { + "line": 16, + "column": 10, + "endLine": 16, + "endColumn": 21, + "problem": "LimitedStdLibNoImportConcurrency", + "autofix": [ { - "line": 16, - "column": 10, - "endLine": 16, - "endColumn": 21, - "problem": "NoNeedStdLibSendableContainer", - "autofix": [ - { - "start": 605, - "end": 667, - "replacementText": "", - "line": 16, - "column": 10, - "endLine": 16, - "endColumn": 21 - } - ], - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" - }, + "start": 605, + "end": 667, + "replacementText": "", + "line": 16, + "column": 10, + "endLine": 16, + "endColumn": 21 + } + ], + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 16, + "column": 10, + "endLine": 16, + "endColumn": 21, + "problem": "NoNeedStdLibSendableContainer", + "autofix": [ { - "line": 18, - "column": 25, - "endLine": 18, - "endColumn": 41, - "problem": "NoNeedStdLibSendableContainer", - "autofix": [ - { - "start": 669, - "end": 751, - "replacementText": "", - "line": 18, - "column": 25, - "endLine": 18, - "endColumn": 41 - } - ], - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" - }, + "start": 605, + "end": 667, + "replacementText": "", + "line": 16, + "column": 10, + "endLine": 16, + "endColumn": 21 + } + ], + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 10, + "endLine": 18, + "endColumn": 41, + "problem": "LimitedStdLibNoImportConcurrency", + "autofix": [ { - "line": 20, - "column": 25, - "endLine": 20, - "endColumn": 39, - "problem": "NoNeedStdLibSendableContainer", - "autofix": [ - { - "start": 753, - "end": 825, - "replacementText": "", - "line": 20, - "column": 25, - "endLine": 20, - "endColumn": 39 - } - ], - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" + "start": 669, + "end": 751, + "replacementText": "", + "line": 18, + "column": 10, + "endLine": 18, + "endColumn": 41 }, { - "line": 26, - "column": 23, - "endLine": 26, - "endColumn": 40, - "problem": "NoNeedStdLibSendableContainer", - "autofix": [ - { - "start": 985, - "end": 1002, - "replacementText": "Array", - "line": 26, - "column": 23, - "endLine": 26, - "endColumn": 40 - } - ], - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" + "start": 1074, + "end": 1090, + "replacementText": "collections", + "line": 18, + "column": 10, + "endLine": 18, + "endColumn": 41 }, { - "line": 26, - "column": 55, - "endLine": 26, - "endColumn": 72, - "problem": "NoNeedStdLibSendableContainer", - "autofix": [ - { - "start": 1017, - "end": 1034, - "replacementText": "Array", - "line": 26, - "column": 55, - "endLine": 26, - "endColumn": 72 - } - ], - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" + "start": 1189, + "end": 1205, + "replacementText": "collections", + "line": 18, + "column": 10, + "endLine": 18, + "endColumn": 41 }, { - "line": 28, - "column": 28, - "endLine": 28, - "endColumn": 50, - "problem": "NoNeedStdLibSendableContainer", - "autofix": [ - { - "start": 1074, - "end": 1096, - "replacementText": "Array", - "line": 28, - "column": 28, - "endLine": 28, - "endColumn": 50 - } - ], - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" + "start": 1244, + "end": 1260, + "replacementText": "collections", + "line": 18, + "column": 10, + "endLine": 18, + "endColumn": 41 }, { - "line": 30, - "column": 28, - "endLine": 30, - "endColumn": 48, - "problem": "NoNeedStdLibSendableContainer", - "autofix": [ - { - "start": 1136, - "end": 1156, - "replacementText": "Array", - "line": 30, - "column": 28, - "endLine": 30, - "endColumn": 48 - } - ], - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" - }, + "start": 1281, + "end": 1297, + "replacementText": "collections", + "line": 18, + "column": 10, + "endLine": 18, + "endColumn": 41 + } + ], + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 25, + "endLine": 18, + "endColumn": 41, + "problem": "NoNeedStdLibSendableContainer", + "autofix": [ { - "line": 32, - "column": 21, - "endLine": 32, - "endColumn": 43, - "problem": "NoNeedStdLibSendableContainer", - "autofix": [ - { - "start": 1189, - "end": 1211, - "replacementText": "Array", - "line": 32, - "column": 21, - "endLine": 32, - "endColumn": 43 - } - ], - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" - }, + "start": 669, + "end": 751, + "replacementText": "", + "line": 18, + "column": 25, + "endLine": 18, + "endColumn": 41 + } + ], + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 10, + "endLine": 20, + "endColumn": 39, + "problem": "LimitedStdLibNoImportConcurrency", + "autofix": [ { - "line": 34, - "column": 23, - "endLine": 34, - "endColumn": 45, - "problem": "NoNeedStdLibSendableContainer", - "autofix": [ - { - "start": 1244, - "end": 1266, - "replacementText": "Array", - "line": 34, - "column": 23, - "endLine": 34, - "endColumn": 45 - } - ], - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" + "start": 753, + "end": 825, + "replacementText": "", + "line": 20, + "column": 10, + "endLine": 20, + "endColumn": 39 }, { - "line": 34, - "column": 60, - "endLine": 34, - "endColumn": 82, - "problem": "NoNeedStdLibSendableContainer", - "autofix": [ - { - "start": 1281, - "end": 1303, - "replacementText": "Array", - "line": 34, - "column": 60, - "endLine": 34, - "endColumn": 82 - } - ], - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" - }, + "start": 1136, + "end": 1150, + "replacementText": "collections", + "line": 20, + "column": 10, + "endLine": 20, + "endColumn": 39 + } + ], + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 25, + "endLine": 20, + "endColumn": 39, + "problem": "NoNeedStdLibSendableContainer", + "autofix": [ { - "line": 40, - "column": 22, - "endLine": 40, - "endColumn": 39, - "problem": "NoNeedStdLibSendableContainer", - "autofix": [ - { - "start": 1404, - "end": 1421, - "replacementText": "Array", - "line": 40, - "column": 22, - "endLine": 40, - "endColumn": 39 - } - ], - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" - }, + "start": 753, + "end": 825, + "replacementText": "", + "line": 20, + "column": 25, + "endLine": 20, + "endColumn": 39 + } + ], + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 23, + "endLine": 26, + "endColumn": 40, + "problem": "NoNeedStdLibSendableContainer", + "autofix": [ { - "line": 41, - "column": 11, - "endLine": 41, - "endColumn": 50, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, + "start": 985, + "end": 1002, + "replacementText": "Array", + "line": 26, + "column": 23, + "endLine": 26, + "endColumn": 40 + } + ], + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 55, + "endLine": 26, + "endColumn": 72, + "problem": "NoNeedStdLibSendableContainer", + "autofix": [ { - "line": 41, - "column": 17, - "endLine": 41, - "endColumn": 32, - "problem": "NoNeedStdLibSendableContainer", - "autofix": [ - { - "start": 1449, - "end": 1464, - "replacementText": "Map", - "line": 41, - "column": 17, - "endLine": 41, - "endColumn": 32 - } - ], - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" - }, + "start": 1017, + "end": 1034, + "replacementText": "Array", + "line": 26, + "column": 55, + "endLine": 26, + "endColumn": 72 + } + ], + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 28, + "endLine": 28, + "endColumn": 50, + "problem": "NoNeedStdLibSendableContainer", + "autofix": [ { - "line": 41, - "column": 29, - "endLine": 41, - "endColumn": 32, - "problem": "ClassAsObjectError", - "suggest": "", - "rule": "Classes cannot be used as objects (arkts-no-classes-as-obj)", - "severity": "ERROR" - }, + "start": 1074, + "end": 1096, + "replacementText": "Array", + "line": 28, + "column": 28, + "endLine": 28, + "endColumn": 50 + } + ], + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 28, + "endLine": 30, + "endColumn": 48, + "problem": "NoNeedStdLibSendableContainer", + "autofix": [ { - "line": 44, - "column": 28, - "endLine": 44, - "endColumn": 49, - "problem": "NoNeedStdLibSendableContainer", - "autofix": [ - { - "start": 1514, - "end": 1535, - "replacementText": "BitVector", - "line": 44, - "column": 28, - "endLine": 44, - "endColumn": 49 - }, - { - "start": 919, - "end": 919, - "replacementText": "\nimport { BitVector } from \"@arkts.collections\";\n", - "line": 44, - "column": 28, - "endLine": 44, - "endColumn": 49 - } - ], - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" - }, + "start": 1136, + "end": 1156, + "replacementText": "Array", + "line": 30, + "column": 28, + "endLine": 30, + "endColumn": 48 + } + ], + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 21, + "endLine": 32, + "endColumn": 43, + "problem": "NoNeedStdLibSendableContainer", + "autofix": [ + { + "start": 1189, + "end": 1211, + "replacementText": "Array", + "line": 32, + "column": 21, + "endLine": 32, + "endColumn": 43 + } + ], + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 23, + "endLine": 34, + "endColumn": 45, + "problem": "NoNeedStdLibSendableContainer", + "autofix": [ + { + "start": 1244, + "end": 1266, + "replacementText": "Array", + "line": 34, + "column": 23, + "endLine": 34, + "endColumn": 45 + } + ], + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 60, + "endLine": 34, + "endColumn": 82, + "problem": "NoNeedStdLibSendableContainer", + "autofix": [ { - "line": 45, - "column": 11, - "endLine": 45, - "endColumn": 58, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" + "start": 1281, + "end": 1303, + "replacementText": "Array", + "line": 34, + "column": 60, + "endLine": 34, + "endColumn": 82 + } + ], + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 40, + "column": 22, + "endLine": 40, + "endColumn": 39, + "problem": "NoNeedStdLibSendableContainer", + "autofix": [ + { + "start": 1404, + "end": 1421, + "replacementText": "Array", + "line": 40, + "column": 22, + "endLine": 40, + "endColumn": 39 + } + ], + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 41, + "column": 11, + "endLine": 41, + "endColumn": 50, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 41, + "column": 17, + "endLine": 41, + "endColumn": 32, + "problem": "NoNeedStdLibSendableContainer", + "autofix": [ + { + "start": 1449, + "end": 1464, + "replacementText": "Map", + "line": 41, + "column": 17, + "endLine": 41, + "endColumn": 32 + } + ], + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 41, + "column": 29, + "endLine": 41, + "endColumn": 32, + "problem": "ClassAsObjectError", + "suggest": "", + "rule": "Classes cannot be used as objects (arkts-no-classes-as-obj)", + "severity": "ERROR" + }, + { + "line": 44, + "column": 28, + "endLine": 44, + "endColumn": 49, + "problem": "NoNeedStdLibSendableContainer", + "autofix": [ + { + "start": 1514, + "end": 1535, + "replacementText": "BitVector", + "line": 44, + "column": 28, + "endLine": 44, + "endColumn": 49 }, { - "line": 45, - "column": 27, - "endLine": 45, - "endColumn": 48, - "problem": "DynamicCtorCall", - "suggest": "", - "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", - "severity": "ERROR" + "start": 919, + "end": 919, + "replacementText": "\nimport { BitVector } from \"@arkts.collections\";\n", + "line": 44, + "column": 28, + "endLine": 44, + "endColumn": 49 + } + ], + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 45, + "column": 11, + "endLine": 45, + "endColumn": 58, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 45, + "column": 27, + "endLine": 45, + "endColumn": 48, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 45, + "column": 27, + "endLine": 45, + "endColumn": 48, + "problem": "NoNeedStdLibSendableContainer", + "autofix": [ + { + "start": 1573, + "end": 1594, + "replacementText": "BitVector", + "line": 45, + "column": 27, + "endLine": 45, + "endColumn": 48 }, { - "line": 45, - "column": 27, - "endLine": 45, - "endColumn": 48, - "problem": "NoNeedStdLibSendableContainer", - "autofix": [ - { - "start": 1573, - "end": 1594, - "replacementText": "BitVector", - "line": 45, - "column": 27, - "endLine": 45, - "endColumn": 48 - }, - { - "start": 919, - "end": 919, - "replacementText": "\nimport { BitVector } from \"@arkts.collections\";\n", - "line": 45, - "column": 27, - "endLine": 45, - "endColumn": 48 - } - ], - "suggest": "", - "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", - "severity": "ERROR" + "start": 919, + "end": 919, + "replacementText": "\nimport { BitVector } from \"@arkts.collections\";\n", + "line": 45, + "column": 27, + "endLine": 45, + "endColumn": 48 } - ] + ], + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + } + ] } diff --git a/ets2panda/linter/test/main/no_import_concurrency.ets b/ets2panda/linter/test/main/no_import_concurrency.ets index 7602f347cf..1276903921 100644 --- a/ets2panda/linter/test/main/no_import_concurrency.ets +++ b/ets2panda/linter/test/main/no_import_concurrency.ets @@ -26,6 +26,8 @@ import { process as ps, collections as clt } from '@kit.ArkTS'; import process from '@ohos.process'; import aaa from '@ohos.taskpool' import aaaa from '@arkts.collections'; +import utils from './oh_modules/@arkts.utils' +import { ArkTSUtils } from './oh_modules/@kit.ArkTS'; aaa.getTaskPoolInfo() @@ -39,3 +41,6 @@ tsk.cancel(); aaaa.Set() clt.Set() fooAs.getFoo(); + +let lock1: utils.locks.AsyncLock = utils.locks.AsyncLock.request('lock1'); +let lock2 = new ArkTSUtils.locks.AsyncLock(); diff --git a/ets2panda/linter/test/main/no_import_concurrency.ets.arkts2.json b/ets2panda/linter/test/main/no_import_concurrency.ets.arkts2.json index f23fdd92f6..d3db5db40c 100644 --- a/ets2panda/linter/test/main/no_import_concurrency.ets.arkts2.json +++ b/ets2panda/linter/test/main/no_import_concurrency.ets.arkts2.json @@ -145,9 +145,29 @@ "severity": "ERROR" }, { - "line": 33, + "line": 29, + "column": 8, + "endLine": 29, + "endColumn": 13, + "problem": "LimitedStdLibNoImportConcurrency", + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 10, + "endLine": 30, + "endColumn": 20, + "problem": "LimitedStdLibNoImportConcurrency", + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 35, "column": 11, - "endLine": 33, + "endLine": 35, "endColumn": 20, "problem": "NumericSemantics", "suggest": "", @@ -155,14 +175,34 @@ "severity": "ERROR" }, { - "line": 33, + "line": 35, "column": 17, - "endLine": 33, + "endLine": 35, "endColumn": 20, "problem": "NumericSemantics", "suggest": "", "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" + }, + { + "line": 45, + "column": 42, + "endLine": 45, + "endColumn": 47, + "problem": "LimitedStdLibNoImportConcurrency", + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 46, + "column": 28, + "endLine": 46, + "endColumn": 33, + "problem": "LimitedStdLibNoImportConcurrency", + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" } ] } diff --git a/ets2panda/linter/test/main/no_import_concurrency.ets.autofix.json b/ets2panda/linter/test/main/no_import_concurrency.ets.autofix.json index ad3c6460fa..d013a85266 100644 --- a/ets2panda/linter/test/main/no_import_concurrency.ets.autofix.json +++ b/ets2panda/linter/test/main/no_import_concurrency.ets.autofix.json @@ -1,378 +1,471 @@ { - "copyright": [ - "Copyright (c) 2025 Huawei Device Co., Ltd.", - "Licensed under the Apache License, Version 2.0 (the 'License');", - "you may not use this file except in compliance with the License.", - "You may obtain a copy of the License at", - "", - "http://www.apache.org/licenses/LICENSE-2.0", - "", - "Unless required by applicable law or agreed to in writing, software", - "distributed under the License is distributed on an 'AS IS' BASIS,", - "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", - "See the License for the specific language governing permissions and", - "limitations under the License." - ], - "result": [ + "copyright": [ + "Copyright (c) 2025 Huawei Device Co., Ltd.", + "Licensed under the Apache License, Version 2.0 (the 'License');", + "you may not use this file except in compliance with the License.", + "You may obtain a copy of the License at", + "", + "http://www.apache.org/licenses/LICENSE-2.0", + "", + "Unless required by applicable law or agreed to in writing, software", + "distributed under the License is distributed on an 'AS IS' BASIS,", + "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", + "See the License for the specific language governing permissions and", + "limitations under the License." + ], + "result": [ + { + "line": 17, + "column": 21, + "endLine": 17, + "endColumn": 36, + "problem": "LimitedStdLibNoImportConcurrency", + "autofix": [ { - "line": 17, - "column": 21, - "endLine": 17, - "endColumn": 36, - "problem": "LimitedStdLibNoImportConcurrency", - "autofix": [ - { - "start": 629, - "end": 646, - "replacementText": "", - "line": 17, - "column": 21, - "endLine": 17, - "endColumn": 36 - } - ], - "suggest": "", - "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", - "severity": "ERROR" - }, + "start": 629, + "end": 646, + "replacementText": "", + "line": 17, + "column": 21, + "endLine": 17, + "endColumn": 36 + } + ], + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 8, + "endLine": 19, + "endColumn": 12, + "problem": "LimitedStdLibNoImportConcurrency", + "autofix": [ { - "line": 19, - "column": 8, - "endLine": 19, - "endColumn": 12, - "problem": "LimitedStdLibNoImportConcurrency", - "autofix": [ - { - "start": 726, - "end": 732, - "replacementText": "", - "line": 19, - "column": 8, - "endLine": 19, - "endColumn": 12 - } - ], - "suggest": "", - "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", - "severity": "ERROR" - }, + "start": 726, + "end": 732, + "replacementText": "", + "line": 19, + "column": 8, + "endLine": 19, + "endColumn": 12 + } + ], + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 25, + "endLine": 20, + "endColumn": 42, + "problem": "LimitedStdLibNoImportConcurrency", + "autofix": [ { - "line": 20, - "column": 25, - "endLine": 20, - "endColumn": 42, - "problem": "LimitedStdLibNoImportConcurrency", - "autofix": [ - { - "start": 800, - "end": 819, - "replacementText": "", - "line": 20, - "column": 25, - "endLine": 20, - "endColumn": 42 - } - ], - "suggest": "", - "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", - "severity": "ERROR" - }, + "start": 800, + "end": 819, + "replacementText": "", + "line": 20, + "column": 25, + "endLine": 20, + "endColumn": 42 + } + ], + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 15, + "endLine": 21, + "endColumn": 32, + "problem": "LimitedStdLibNoImportConcurrency", + "autofix": [ { - "line": 21, - "column": 15, - "endLine": 21, - "endColumn": 32, - "problem": "LimitedStdLibNoImportConcurrency", - "autofix": [ - { - "start": 858, - "end": 877, - "replacementText": "", - "line": 21, - "column": 15, - "endLine": 21, - "endColumn": 32 - } - ], - "suggest": "", - "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", - "severity": "ERROR" - }, + "start": 858, + "end": 877, + "replacementText": "", + "line": 21, + "column": 15, + "endLine": 21, + "endColumn": 32 + } + ], + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 34, + "endLine": 21, + "endColumn": 47, + "problem": "LimitedStdLibNoImportConcurrency", + "autofix": [ { - "line": 21, - "column": 34, - "endLine": 21, - "endColumn": 47, - "problem": "LimitedStdLibNoImportConcurrency", - "autofix": [ - { - "start": 875, - "end": 890, - "replacementText": "", - "line": 21, - "column": 34, - "endLine": 21, - "endColumn": 47 - } - ], - "suggest": "", - "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", - "severity": "ERROR" - }, + "start": 875, + "end": 890, + "replacementText": "", + "line": 21, + "column": 34, + "endLine": 21, + "endColumn": 47 + } + ], + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 16, + "endLine": 23, + "endColumn": 31, + "problem": "LimitedStdLibNoImportConcurrency", + "autofix": [ { - "line": 23, - "column": 16, - "endLine": 23, - "endColumn": 31, - "problem": "LimitedStdLibNoImportConcurrency", - "autofix": [ - { - "start": 986, - "end": 1003, - "replacementText": "", - "line": 23, - "column": 16, - "endLine": 23, - "endColumn": 31 - }, - { - "start": 1367, - "end": 1370, - "replacementText": "taskpool", - "line": 23, - "column": 16, - "endLine": 23, - "endColumn": 31 - } - ], - "suggest": "", - "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", - "severity": "ERROR" + "start": 986, + "end": 1003, + "replacementText": "", + "line": 23, + "column": 16, + "endLine": 23, + "endColumn": 31 }, { - "line": 23, - "column": 33, - "endLine": 23, - "endColumn": 47, - "problem": "LimitedStdLibNoImportConcurrency", - "autofix": [ - { - "start": 1001, - "end": 1017, - "replacementText": "", - "line": 23, - "column": 33, - "endLine": 23, - "endColumn": 47 - } - ], - "suggest": "", - "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", - "severity": "ERROR" - }, + "start": 1467, + "end": 1470, + "replacementText": "taskpool", + "line": 23, + "column": 16, + "endLine": 23, + "endColumn": 31 + } + ], + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 33, + "endLine": 23, + "endColumn": 47, + "problem": "LimitedStdLibNoImportConcurrency", + "autofix": [ { - "line": 24, - "column": 8, - "endLine": 24, - "endColumn": 13, - "problem": "LimitedStdLibNoImportConcurrency", - "autofix": [ - { - "start": 1039, - "end": 1073, - "replacementText": "", - "line": 24, - "column": 8, - "endLine": 24, - "endColumn": 13 - } - ], - "suggest": "", - "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", - "severity": "ERROR" - }, + "start": 1001, + "end": 1017, + "replacementText": "", + "line": 23, + "column": 33, + "endLine": 23, + "endColumn": 47 + } + ], + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 8, + "endLine": 24, + "endColumn": 13, + "problem": "LimitedStdLibNoImportConcurrency", + "autofix": [ { - "line": 25, - "column": 10, - "endLine": 25, - "endColumn": 23, - "problem": "LimitedStdLibNoImportConcurrency", - "autofix": [ - { - "start": 1083, - "end": 1098, - "replacementText": "", - "line": 25, - "column": 10, - "endLine": 25, - "endColumn": 23 - }, - { - "start": 1343, - "end": 1345, - "replacementText": "process", - "line": 25, - "column": 10, - "endLine": 25, - "endColumn": 23 - } - ], - "suggest": "", - "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", - "severity": "ERROR" - }, + "start": 1039, + "end": 1073, + "replacementText": "", + "line": 24, + "column": 8, + "endLine": 24, + "endColumn": 13 + } + ], + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 10, + "endLine": 25, + "endColumn": 23, + "problem": "LimitedStdLibNoImportConcurrency", + "autofix": [ { - "line": 25, - "column": 25, - "endLine": 25, - "endColumn": 43, - "problem": "LimitedStdLibNoImportConcurrency", - "autofix": [ - { - "start": 1096, - "end": 1116, - "replacementText": "", - "line": 25, - "column": 25, - "endLine": 25, - "endColumn": 43 - }, - { - "start": 1392, - "end": 1395, - "replacementText": "collections", - "line": 25, - "column": 25, - "endLine": 25, - "endColumn": 43 - } - ], - "suggest": "", - "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", - "severity": "ERROR" + "start": 1083, + "end": 1098, + "replacementText": "", + "line": 25, + "column": 10, + "endLine": 25, + "endColumn": 23 }, { - "line": 26, - "column": 8, - "endLine": 26, - "endColumn": 15, - "problem": "LimitedStdLibNoImportConcurrency", - "autofix": [ - { - "start": 1138, - "end": 1174, - "replacementText": "", - "line": 26, - "column": 8, - "endLine": 26, - "endColumn": 15 - } - ], - "suggest": "", - "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", - "severity": "ERROR" + "start": 1443, + "end": 1445, + "replacementText": "process", + "line": 25, + "column": 10, + "endLine": 25, + "endColumn": 23 + } + ], + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 25, + "endLine": 25, + "endColumn": 43, + "problem": "LimitedStdLibNoImportConcurrency", + "autofix": [ + { + "start": 1096, + "end": 1116, + "replacementText": "", + "line": 25, + "column": 25, + "endLine": 25, + "endColumn": 43 }, { - "line": 27, - "column": 8, - "endLine": 27, - "endColumn": 11, - "problem": "LimitedStdLibNoImportConcurrency", - "autofix": [ - { - "start": 1175, - "end": 1207, - "replacementText": "", - "line": 27, - "column": 8, - "endLine": 27, - "endColumn": 11 - }, - { - "start": 1248, - "end": 1251, - "replacementText": "taskpool", - "line": 27, - "column": 8, - "endLine": 27, - "endColumn": 11 - } - ], - "suggest": "", - "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", - "severity": "ERROR" + "start": 1492, + "end": 1495, + "replacementText": "collections", + "line": 25, + "column": 25, + "endLine": 25, + "endColumn": 43 + } + ], + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 8, + "endLine": 26, + "endColumn": 15, + "problem": "LimitedStdLibNoImportConcurrency", + "autofix": [ + { + "start": 1138, + "end": 1174, + "replacementText": "", + "line": 26, + "column": 8, + "endLine": 26, + "endColumn": 15 + } + ], + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 27, + "column": 8, + "endLine": 27, + "endColumn": 11, + "problem": "LimitedStdLibNoImportConcurrency", + "autofix": [ + { + "start": 1175, + "end": 1207, + "replacementText": "", + "line": 27, + "column": 8, + "endLine": 27, + "endColumn": 11 }, { - "line": 28, - "column": 8, - "endLine": 28, - "endColumn": 12, - "problem": "LimitedStdLibNoImportConcurrency", - "autofix": [ - { - "start": 1208, - "end": 1246, - "replacementText": "", - "line": 28, - "column": 8, - "endLine": 28, - "endColumn": 12 - }, - { - "start": 1381, - "end": 1385, - "replacementText": "collections", - "line": 28, - "column": 8, - "endLine": 28, - "endColumn": 12 - } - ], - "suggest": "", - "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", - "severity": "ERROR" + "start": 1348, + "end": 1351, + "replacementText": "taskpool", + "line": 27, + "column": 8, + "endLine": 27, + "endColumn": 11 + } + ], + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 8, + "endLine": 28, + "endColumn": 12, + "problem": "LimitedStdLibNoImportConcurrency", + "autofix": [ + { + "start": 1208, + "end": 1246, + "replacementText": "", + "line": 28, + "column": 8, + "endLine": 28, + "endColumn": 12 }, { - "line": 33, - "column": 11, - "endLine": 33, - "endColumn": 20, - "problem": "NumericSemantics", - "autofix": [ - { - "start": 1310, - "end": 1310, - "replacementText": ": number", - "line": 33, - "column": 11, - "endLine": 33, - "endColumn": 20 - } - ], - "suggest": "", - "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", - "severity": "ERROR" + "start": 1481, + "end": 1485, + "replacementText": "collections", + "line": 28, + "column": 8, + "endLine": 28, + "endColumn": 12 + } + ], + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 8, + "endLine": 29, + "endColumn": 13, + "problem": "LimitedStdLibNoImportConcurrency", + "autofix": [ + { + "start": 1247, + "end": 1292, + "replacementText": "", + "line": 29, + "column": 8, + "endLine": 29, + "endColumn": 13 + } + ], + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 10, + "endLine": 30, + "endColumn": 20, + "problem": "LimitedStdLibNoImportConcurrency", + "autofix": [ + { + "start": 1293, + "end": 1346, + "replacementText": "", + "line": 30, + "column": 10, + "endLine": 30, + "endColumn": 20 + } + ], + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 35, + "column": 11, + "endLine": 35, + "endColumn": 20, + "problem": "NumericSemantics", + "autofix": [ + { + "start": 1410, + "end": 1410, + "replacementText": ": number", + "line": 35, + "column": 11, + "endLine": 35, + "endColumn": 20 + } + ], + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 35, + "column": 17, + "endLine": 35, + "endColumn": 20, + "problem": "NumericSemantics", + "autofix": [ + { + "start": 1413, + "end": 1416, + "replacementText": "123.0", + "line": 35, + "column": 17, + "endLine": 35, + "endColumn": 20 + } + ], + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 45, + "column": 42, + "endLine": 45, + "endColumn": 47, + "problem": "LimitedStdLibNoImportConcurrency", + "autofix": [ + { + "start": 1530, + "end": 1551, + "replacementText": "AsyncLock", + "line": 45, + "column": 42, + "endLine": 45, + "endColumn": 47 }, { - "line": 33, - "column": 17, - "endLine": 33, - "endColumn": 20, - "problem": "NumericSemantics", - "autofix": [ - { - "start": 1313, - "end": 1316, - "replacementText": "123.0", - "line": 33, - "column": 17, - "endLine": 33, - "endColumn": 20 - } - ], - "suggest": "", - "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", - "severity": "ERROR" + "start": 1554, + "end": 1592, + "replacementText": "AsyncLock.request('lock1')", + "line": 45, + "column": 42, + "endLine": 45, + "endColumn": 47 + } + ], + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 46, + "column": 28, + "endLine": 46, + "endColumn": 33, + "problem": "LimitedStdLibNoImportConcurrency", + "autofix": [ + { + "start": 1606, + "end": 1638, + "replacementText": "new AsyncLock()", + "line": 46, + "column": 28, + "endLine": 46, + "endColumn": 33 } - ] -} \ No newline at end of file + ], + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + } + ] +} diff --git a/ets2panda/linter/test/main/no_import_concurrency.ets.migrate.ets b/ets2panda/linter/test/main/no_import_concurrency.ets.migrate.ets index f159439aa4..a4b611c35d 100644 --- a/ets2panda/linter/test/main/no_import_concurrency.ets.migrate.ets +++ b/ets2panda/linter/test/main/no_import_concurrency.ets.migrate.ets @@ -27,6 +27,8 @@ import bbbb from '@kit.ArkTS'; + + taskpool.getTaskPoolInfo() function concurrency () { @@ -39,3 +41,6 @@ taskpool.cancel(); Set() Set() fooAs.getFoo(); + +let lock1: AsyncLock = AsyncLock.request('lock1'); +let lock2 = new AsyncLock(); diff --git a/ets2panda/linter/test/main/no_import_concurrency.ets.migrate.json b/ets2panda/linter/test/main/no_import_concurrency.ets.migrate.json index 75faa00931..c44a6d84b1 100644 --- a/ets2panda/linter/test/main/no_import_concurrency.ets.migrate.json +++ b/ets2panda/linter/test/main/no_import_concurrency.ets.migrate.json @@ -1,38 +1,58 @@ { - "copyright": [ - "Copyright (c) 2025 Huawei Device Co., Ltd.", - "Licensed under the Apache License, Version 2.0 (the 'License');", - "you may not use this file except in compliance with the License.", - "You may obtain a copy of the License at", - "", - "http://www.apache.org/licenses/LICENSE-2.0", - "", - "Unless required by applicable law or agreed to in writing, software", - "distributed under the License is distributed on an 'AS IS' BASIS,", - "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", - "See the License for the specific language governing permissions and", - "limitations under the License." - ], - "result": [ - { - "line": 39, - "column": 1, - "endLine": 39, - "endColumn": 6, - "problem": "GenericCallNoTypeArgs", - "suggest": "", - "rule": "Type inference in case of generic function calls is limited (arkts-no-inferred-generic-params)", - "severity": "ERROR" - }, - { - "line": 40, - "column": 1, - "endLine": 40, - "endColumn": 6, - "problem": "GenericCallNoTypeArgs", - "suggest": "", - "rule": "Type inference in case of generic function calls is limited (arkts-no-inferred-generic-params)", - "severity": "ERROR" - } - ] + "copyright": [ + "Copyright (c) 2025 Huawei Device Co., Ltd.", + "Licensed under the Apache License, Version 2.0 (the 'License');", + "you may not use this file except in compliance with the License.", + "You may obtain a copy of the License at", + "", + "http://www.apache.org/licenses/LICENSE-2.0", + "", + "Unless required by applicable law or agreed to in writing, software", + "distributed under the License is distributed on an 'AS IS' BASIS,", + "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", + "See the License for the specific language governing permissions and", + "limitations under the License." + ], + "result": [ + { + "line": 41, + "column": 1, + "endLine": 41, + "endColumn": 6, + "problem": "GenericCallNoTypeArgs", + "suggest": "", + "rule": "Type inference in case of generic function calls is limited (arkts-no-inferred-generic-params)", + "severity": "ERROR" + }, + { + "line": 42, + "column": 1, + "endLine": 42, + "endColumn": 6, + "problem": "GenericCallNoTypeArgs", + "suggest": "", + "rule": "Type inference in case of generic function calls is limited (arkts-no-inferred-generic-params)", + "severity": "ERROR" + }, + { + "line": 46, + "column": 5, + "endLine": 46, + "endColumn": 28, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 46, + "column": 17, + "endLine": 46, + "endColumn": 26, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + } + ] } diff --git a/ets2panda/linter/test/main/oh_modules/@arkts.utils.d.ets b/ets2panda/linter/test/main/oh_modules/@arkts.utils.d.ets index 0e5d4e1ba8..d1cf449eed 100644 --- a/ets2panda/linter/test/main/oh_modules/@arkts.utils.d.ets +++ b/ets2panda/linter/test/main/oh_modules/@arkts.utils.d.ets @@ -14,6 +14,11 @@ */ export namespace utils { + export namespace locks { + export class AsyncLock { + request(s: string): AsyncLock; + } + } namespace ASON { function stringify(value: Object | null | undefined): string; } @@ -31,4 +36,4 @@ export namespace ArkTSUtils { export namespace safeModule { export function foo(): void; } -} \ No newline at end of file +} diff --git a/ets2panda/linter/test/main/property_access_by_index.ets.arkts2.json b/ets2panda/linter/test/main/property_access_by_index.ets.arkts2.json index d53752ee48..8a14736c43 100644 --- a/ets2panda/linter/test/main/property_access_by_index.ets.arkts2.json +++ b/ets2panda/linter/test/main/property_access_by_index.ets.arkts2.json @@ -14,6 +14,16 @@ "limitations under the License." ], "result": [ + { + "line": 16, + "column": 10, + "endLine": 16, + "endColumn": 21, + "problem": "LimitedStdLibNoImportConcurrency", + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, { "line": 16, "column": 10, diff --git a/ets2panda/linter/test/main/property_access_by_index.ets.autofix.json b/ets2panda/linter/test/main/property_access_by_index.ets.autofix.json index efd13151c4..7c65592fab 100644 --- a/ets2panda/linter/test/main/property_access_by_index.ets.autofix.json +++ b/ets2panda/linter/test/main/property_access_by_index.ets.autofix.json @@ -14,6 +14,27 @@ "limitations under the License." ], "result": [ + { + "line": 16, + "column": 10, + "endLine": 16, + "endColumn": 21, + "problem": "LimitedStdLibNoImportConcurrency", + "autofix": [ + { + "start": 662, + "end": 713, + "replacementText": "", + "line": 16, + "column": 10, + "endLine": 16, + "endColumn": 21 + } + ], + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, { "line": 16, "column": 10, diff --git a/ets2panda/linter/test/main/taskpool_deprecated_usages2.ets.arkts2.json b/ets2panda/linter/test/main/taskpool_deprecated_usages2.ets.arkts2.json index e45a67f042..40b3a08189 100755 --- a/ets2panda/linter/test/main/taskpool_deprecated_usages2.ets.arkts2.json +++ b/ets2panda/linter/test/main/taskpool_deprecated_usages2.ets.arkts2.json @@ -24,6 +24,16 @@ "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", "severity": "ERROR" }, + { + "line": 18, + "column": 10, + "endLine": 18, + "endColumn": 31, + "problem": "LimitedStdLibNoImportConcurrency", + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, { "line": 20, "column": 26, @@ -85,4 +95,4 @@ "severity": "ERROR" } ] -} \ No newline at end of file +} -- Gitee