diff --git a/ets2panda/linter/src/lib/TypeScriptLinter.ts b/ets2panda/linter/src/lib/TypeScriptLinter.ts index 84b5a362bffd31b3599d67e33eaa79e5b47b21d1..2750864cc3a51f943bef10ac925a629a1065f1dc 100644 --- a/ets2panda/linter/src/lib/TypeScriptLinter.ts +++ b/ets2panda/linter/src/lib/TypeScriptLinter.ts @@ -70,7 +70,6 @@ import { LIMITED_STD_PROXYHANDLER_API, LIMITED_STD_REFLECT_API, MODULE_IMPORTS, - ARKTSUTILS_TEXT, ARKTSUTILS_MODULES, ARKTSUTILS_LOCKS_MEMBER } from './utils/consts/LimitedStdAPI'; @@ -7245,7 +7244,7 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { } }; - this.checkSymbolAndExecute(symbol, ARKTSUTILS_TEXT, ARKTSUTILS_MODULES, cb); + this.checkSymbolAndExecute(symbol, ARKTSUTILS_LOCKS_MEMBER, ARKTSUTILS_MODULES, cb); } private checkSymbolAndExecute(symbol: ts.Symbol, symbolName: string, modules: string[], cb: () => void): void { diff --git a/ets2panda/linter/src/lib/utils/consts/LimitedStdAPI.ts b/ets2panda/linter/src/lib/utils/consts/LimitedStdAPI.ts index 21007148eba3adb8d3aec775155c473202f96eec..eeef04d78df87d0a676563451045d17de67445df 100644 --- a/ets2panda/linter/src/lib/utils/consts/LimitedStdAPI.ts +++ b/ets2panda/linter/src/lib/utils/consts/LimitedStdAPI.ts @@ -158,6 +158,5 @@ export const MODULE_IMPORTS: Record = { '@ohos.taskpool': ['taskpool'] }; -export const ARKTSUTILS_TEXT = 'ArkTSUtils'; -export const ARKTSUTILS_MODULES = ['@arkts.utils']; +export const ARKTSUTILS_MODULES = ['@arkts.utils', '@kit.ArkTS']; export const ARKTSUTILS_LOCKS_MEMBER = 'locks'; diff --git a/ets2panda/linter/test/concurrent/ no_support_arktsutils_locks_asynclock.ets.args.json b/ets2panda/linter/test/concurrent/ no_support_arktsutils_locks_asynclock.ets.args.json new file mode 100644 index 0000000000000000000000000000000000000000..3ef4496a819a201892114d1c90f78ae32053c334 --- /dev/null +++ b/ets2panda/linter/test/concurrent/ no_support_arktsutils_locks_asynclock.ets.args.json @@ -0,0 +1,19 @@ +{ + "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." + ], + "mode": { + "arkts2": "" + } +} 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 c38018cfbcac690ce700e4cedad08d908f20fb0d..31d218b8f0a1b62832a120b6cc681c9648010be7 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 @@ -15,20 +15,20 @@ ], "result": [ { - "line": 3, - "column": 17, - "endLine": 3, - "endColumn": 27, + "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": 5, - "column": 17, - "endLine": 5, - "endColumn": 27, + "line": 20, + "column": 28, + "endLine": 20, + "endColumn": 33, "problem": "LimitedStdLibNoImportConcurrency", "suggest": "", "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", 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 deleted file mode 100644 index c38018cfbcac690ce700e4cedad08d908f20fb0d..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/concurrent/ no_support_arktsutils_locks_asynclock.ets.autofix.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "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": 3, - "column": 17, - "endLine": 3, - "endColumn": 27, - "problem": "LimitedStdLibNoImportConcurrency", - "suggest": "", - "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", - "severity": "ERROR" - }, - { - "line": 5, - "column": 17, - "endLine": 5, - "endColumn": 27, - "problem": "LimitedStdLibNoImportConcurrency", - "suggest": "", - "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", - "severity": "ERROR" - } - ] -} \ No newline at end of file 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 deleted file mode 100644 index c8cd4f5b4806bbcd647d69ba06a3b5ca59ef0ae9..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/concurrent/ no_support_arktsutils_locks_asynclock.ets.migrate.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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. - */ - -import { ArkTSUtils } from '../main/oh_modules/@kit.ArkTS'; - -let lock1 = new ArkTSUtils.locks.AsyncLock(); - -let lock2 = new ArkTSUtils.locks.AsyncLock(); \ No newline at end of file diff --git a/ets2panda/linter/test/concurrent/ no_support_arktsutils_locks_asynclock.ets.migrate.json b/ets2panda/linter/test/concurrent/ no_support_arktsutils_locks_asynclock.ets.migrate.json deleted file mode 100644 index c38018cfbcac690ce700e4cedad08d908f20fb0d..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/concurrent/ no_support_arktsutils_locks_asynclock.ets.migrate.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "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": 3, - "column": 17, - "endLine": 3, - "endColumn": 27, - "problem": "LimitedStdLibNoImportConcurrency", - "suggest": "", - "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", - "severity": "ERROR" - }, - { - "line": 5, - "column": 17, - "endLine": 5, - "endColumn": 27, - "problem": "LimitedStdLibNoImportConcurrency", - "suggest": "", - "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", - "severity": "ERROR" - } - ] -} \ No newline at end of file