From 039fa2c915379a1fe09e1422605059bd5c26b434 Mon Sep 17 00:00:00 2001 From: oh_ci Date: Mon, 8 Sep 2025 01:23:15 +0000 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!8116=20?= =?UTF-8?q?:=20arkui=20entry'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ets2panda/linter/rule-config.json | 3 +- ets2panda/linter/src/lib/CookBookMsg.ts | 2 - ets2panda/linter/src/lib/FaultAttrs.ts | 1 - ets2panda/linter/src/lib/FaultDesc.ts | 1 - ets2panda/linter/src/lib/Problems.ts | 1 - ets2panda/linter/src/lib/TypeScriptLinter.ts | 74 +--- .../linter/src/lib/autofixes/Autofixer.ts | 41 +- .../src/lib/utils/consts/ArkuiConstants.ts | 5 +- .../linter/test/main/entry_componentv2_1.ets | 38 -- .../main/entry_componentv2_1.ets.args.json | 21 - .../main/entry_componentv2_1.ets.arkts2.json | 178 -------- .../main/entry_componentv2_1.ets.autofix.json | 332 --------------- .../test/main/entry_componentv2_1.ets.json | 17 - .../main/entry_componentv2_1.ets.migrate.ets | 45 -- .../main/entry_componentv2_1.ets.migrate.json | 17 - .../linter/test/main/entry_componentv2_2.ets | 46 -- .../main/entry_componentv2_2.ets.args.json | 21 - .../main/entry_componentv2_2.ets.arkts2.json | 208 --------- .../main/entry_componentv2_2.ets.autofix.json | 395 ------------------ .../test/main/entry_componentv2_2.ets.json | 17 - .../main/entry_componentv2_2.ets.migrate.ets | 53 --- .../main/entry_componentv2_2.ets.migrate.json | 17 - 22 files changed, 13 insertions(+), 1520 deletions(-) delete mode 100644 ets2panda/linter/test/main/entry_componentv2_1.ets delete mode 100644 ets2panda/linter/test/main/entry_componentv2_1.ets.args.json delete mode 100644 ets2panda/linter/test/main/entry_componentv2_1.ets.arkts2.json delete mode 100644 ets2panda/linter/test/main/entry_componentv2_1.ets.autofix.json delete mode 100644 ets2panda/linter/test/main/entry_componentv2_1.ets.json delete mode 100644 ets2panda/linter/test/main/entry_componentv2_1.ets.migrate.ets delete mode 100644 ets2panda/linter/test/main/entry_componentv2_1.ets.migrate.json delete mode 100644 ets2panda/linter/test/main/entry_componentv2_2.ets delete mode 100644 ets2panda/linter/test/main/entry_componentv2_2.ets.args.json delete mode 100644 ets2panda/linter/test/main/entry_componentv2_2.ets.arkts2.json delete mode 100644 ets2panda/linter/test/main/entry_componentv2_2.ets.autofix.json delete mode 100644 ets2panda/linter/test/main/entry_componentv2_2.ets.json delete mode 100644 ets2panda/linter/test/main/entry_componentv2_2.ets.migrate.ets delete mode 100644 ets2panda/linter/test/main/entry_componentv2_2.ets.migrate.json diff --git a/ets2panda/linter/rule-config.json b/ets2panda/linter/rule-config.json index 0174894363..3ad3d9d45d 100644 --- a/ets2panda/linter/rule-config.json +++ b/ets2panda/linter/rule-config.json @@ -120,8 +120,7 @@ "arkui-buildernode-no-nestingbuildersupported", "arkui-persistent-prop-serialization", "arkui-persistent-props-serialization", - "arkui-persistencev2-connect-serialization", - "arkui-entry-invalid-params" + "arkui-persistencev2-connect-serialization" ], "builtin": [ "arkts-builtin-thisArgs", diff --git a/ets2panda/linter/src/lib/CookBookMsg.ts b/ets2panda/linter/src/lib/CookBookMsg.ts index 0c004df48d..cfd5fc0a1b 100644 --- a/ets2panda/linter/src/lib/CookBookMsg.ts +++ b/ets2panda/linter/src/lib/CookBookMsg.ts @@ -424,8 +424,6 @@ cookBookTag[392] = 'The class of the "defaultValue" parameter in the literal passed to the "persistProps" method must be a primitive type or Date type, or implement the "toJson" and "fromJson" methods (arkui-persistent-props-serialization)'; cookBookTag[393] = 'When calling the "globalConnect" and "connect" methods, the parameter list of the methods needs to include "toJson" and "fromJson" (arkui-persistencev2-connect-serialization)'; -cookBookTag[394] = - 'The "@ComponentV2" decorator cannot be used together with the "@Entry" decorator that has "storage" or "useSharedStorage" parameters (arkui-entry-invalid-params)' cookBookTag[399] = 'ArkUI deprecated api check (arkui-no-deprecated-api)'; cookBookTag[400] = 'ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)'; cookBookTag[401] = 'ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)'; diff --git a/ets2panda/linter/src/lib/FaultAttrs.ts b/ets2panda/linter/src/lib/FaultAttrs.ts index 383491da21..7de7999b99 100644 --- a/ets2panda/linter/src/lib/FaultAttrs.ts +++ b/ets2panda/linter/src/lib/FaultAttrs.ts @@ -296,7 +296,6 @@ faultsAttrs[FaultID.PromiseVoidNeedResolveArg] = new FaultAttributes(382); faultsAttrs[FaultID.PersistentPropNeedImplementMethod] = new FaultAttributes(391); faultsAttrs[FaultID.PersistentPropsNeedImplementMethod] = new FaultAttributes(392); faultsAttrs[FaultID.PersistenceV2ConnectNeedAddParam] = new FaultAttributes(393); -faultsAttrs[FaultID.EntryHasInvalidParams] = new FaultAttributes(394); faultsAttrs[FaultID.NoDeprecatedApi] = new FaultAttributes(399); faultsAttrs[FaultID.SdkCommonApiDeprecated] = new FaultAttributes(400); faultsAttrs[FaultID.SdkCommonApiWhiteList] = new FaultAttributes(401); diff --git a/ets2panda/linter/src/lib/FaultDesc.ts b/ets2panda/linter/src/lib/FaultDesc.ts index 573acfd0c0..5b39e917f8 100644 --- a/ets2panda/linter/src/lib/FaultDesc.ts +++ b/ets2panda/linter/src/lib/FaultDesc.ts @@ -299,4 +299,3 @@ faultDesc[FaultID.BuiltinIteratorResultValue] = 'IteratorResult.value is not sup faultDesc[FaultID.OptionalTupleType] = 'No optional tuple type'; faultDesc[FaultID.LargeNumericLiteral] = 'Numeric literal exceeds allowed range'; faultDesc[FaultID.unfixedTuple] = 'No unfixed tuple'; -faultDesc[FaultID.EntryHasInvalidParams] = 'Entry has invalid parameters'; diff --git a/ets2panda/linter/src/lib/Problems.ts b/ets2panda/linter/src/lib/Problems.ts index ddf7244972..fd32b020c0 100644 --- a/ets2panda/linter/src/lib/Problems.ts +++ b/ets2panda/linter/src/lib/Problems.ts @@ -300,7 +300,6 @@ export enum FaultID { InstanceOfFunction, unfixedTuple, SuperInStaticContext, - EntryHasInvalidParams, // this should always be last enum LAST_ID } diff --git a/ets2panda/linter/src/lib/TypeScriptLinter.ts b/ets2panda/linter/src/lib/TypeScriptLinter.ts index 9816096043..317b9035bd 100644 --- a/ets2panda/linter/src/lib/TypeScriptLinter.ts +++ b/ets2panda/linter/src/lib/TypeScriptLinter.ts @@ -143,10 +143,7 @@ import { GLOBAL_CONNECT_FUNC_NAME, CONNECT_FUNC_NAME, serializationTypeFlags, - serializationTypeName, - COMPONENTV2_DECORATOR_NAME, - ENTRY_STORAGE, - ENTRY_USE_SHARED_STORAGE + serializationTypeName } from './utils/consts/ArkuiConstants'; import { arkuiImportList } from './utils/consts/ArkuiImportList'; import type { IdentifierAndArguments, ForbidenAPICheckResult } from './utils/consts/InteropAPI'; @@ -960,7 +957,6 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { } this.handleStructDeclarationForLayout(node); this.handleInvalidIdentifier(node); - this.handleStructDeclForEntryAndComponentV2(node); } private handleParameter(node: ts.Node): void { @@ -8572,20 +8568,6 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { return; } - const structDecl = node.parent; - if (!ts.isStructDeclaration(structDecl)) { - return; - } - - const decorators = ts.getDecorators(structDecl); - const hasComponentV2 = decorators?.some((decorator) => { - return decorator.expression.getText() === COMPONENTV2_DECORATOR_NAME; - }); - - if (hasComponentV2) { - return; - } - if (ts.isCallExpression(node.expression) && ts.isIdentifier(node.expression.expression)) { if (node.expression.expression.escapedText !== ENTRY_DECORATOR_NAME || node.expression.arguments.length !== 1) { return; @@ -15706,58 +15688,4 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { this.incrementCounters(node, FaultID.SuperInStaticContext); } } - - private handleStructDeclForEntryAndComponentV2(node: ts.StructDeclaration): void { - if (!this.options.arkts2) { - return; - } - - const decorators = ts.getDecorators(node); - if (!decorators) { - return; - } - - let entryDecorator: ts.Decorator | undefined; - const hasEntry = decorators.some((decorator) => { - if (TsUtils.getDecoratorName(decorator) === ENTRY_DECORATOR_NAME) { - entryDecorator = decorator; - return true; - } - return false; - }); - const hasComponentV2 = decorators.some((decorator) => { - return TsUtils.getDecoratorName(decorator) === COMPONENTV2_DECORATOR_NAME; - }); - - if (!hasEntry || !hasComponentV2 || !entryDecorator) { - return; - } - - const entryDecoratorHasInvalidParams = TypeScriptLinter.checkEntryDecoratorHasInvalidParams(entryDecorator); - if (!entryDecoratorHasInvalidParams) { - return; - } - - const autofix = this.autofixer?.fixEntryAndComponentV2(entryDecorator); - this.incrementCounters(entryDecorator, FaultID.EntryHasInvalidParams, autofix); - } - - private static checkEntryDecoratorHasInvalidParams(entryDecorator: ts.Decorator): boolean { - const callExpr = entryDecorator.expression; - if (!ts.isCallExpression(callExpr)) { - return false; - } - - const arg = callExpr.arguments?.[0]; - if (!ts.isObjectLiteralExpression(arg)) { - return false; - } - - const hasInvalidParams = arg.properties.some((property) => { - const name = property.name?.getText(); - return name === ENTRY_STORAGE || name === ENTRY_USE_SHARED_STORAGE; - }); - - return hasInvalidParams; - } } diff --git a/ets2panda/linter/src/lib/autofixes/Autofixer.ts b/ets2panda/linter/src/lib/autofixes/Autofixer.ts index 37b2ec835e..c23c9127f9 100644 --- a/ets2panda/linter/src/lib/autofixes/Autofixer.ts +++ b/ets2panda/linter/src/lib/autofixes/Autofixer.ts @@ -34,8 +34,7 @@ import { VALUE_IDENTIFIER, INDENT_STEP, ENTRY_DECORATOR_NAME, - ENTRY_STORAGE, - ENTRY_USE_SHARED_STORAGE, + ENTRY_STORAGE_PROPERITY, LOCAL_STORAGE_TYPE_NAME, GET_LOCAL_STORAGE_FUNC_NAME, PROVIDE_DECORATOR_NAME, @@ -2938,22 +2937,23 @@ export class Autofixer { return undefined; } + const parentNode = entryDecorator.parent; const arg = args[0]; - let getLocalStorageStmt: ts.VariableStatement | undefined; + let getLocalStorageStatement: ts.VariableStatement | undefined; if (ts.isIdentifier(arg) || ts.isNewExpression(arg) || ts.isCallExpression(arg)) { - getLocalStorageStmt = Autofixer.createGetLocalStorageLambdaStatement(arg); + getLocalStorageStatement = Autofixer.createGetLocalStorageLambdaStatement(arg); } else if (ts.isObjectLiteralExpression(arg)) { - getLocalStorageStmt = Autofixer.processEntryAnnotationObjectLiteralExpression(arg); + getLocalStorageStatement = Autofixer.processEntryAnnotationObjectLiteralExpression(arg); } - if (getLocalStorageStmt !== undefined) { - let text = this.printer.printNode(ts.EmitHint.Unspecified, getLocalStorageStmt, entryDecorator.getSourceFile()); + if (getLocalStorageStatement !== undefined) { + let text = this.printer.printNode(ts.EmitHint.Unspecified, getLocalStorageStatement, parentNode.getSourceFile()); const fixedEntryDecorator = Autofixer.createFixedEntryDecorator(); const fixedEntryDecoratorText = this.printer.printNode( ts.EmitHint.Unspecified, fixedEntryDecorator, - entryDecorator.getSourceFile() + parentNode.getSourceFile() ); text = text + this.getNewLine() + fixedEntryDecoratorText; return [{ start: entryDecorator.getStart(), end: entryDecorator.getEnd(), replacementText: text }]; @@ -2963,7 +2963,7 @@ export class Autofixer { private static createFixedEntryDecorator(): ts.Decorator { const storageProperty = ts.factory.createPropertyAssignment( - ts.factory.createIdentifier(ENTRY_STORAGE), + ts.factory.createIdentifier(ENTRY_STORAGE_PROPERITY), ts.factory.createStringLiteral(GET_LOCAL_STORAGE_FUNC_NAME) ); const objectLiteralExpr = ts.factory.createObjectLiteralExpression([storageProperty], false); @@ -2985,7 +2985,7 @@ export class Autofixer { return undefined; } if (ts.isIdentifier(objectProperty.name)) { - if (objectProperty.name.escapedText !== ENTRY_STORAGE) { + if (objectProperty.name.escapedText !== ENTRY_STORAGE_PROPERITY) { return undefined; } const properityInitializer = objectProperty.initializer; @@ -5443,25 +5443,4 @@ export class Autofixer { } ]; } - - fixEntryAndComponentV2(entryDecorator: ts.Decorator): Autofix[] | undefined { - const callExpr = entryDecorator.expression; - if (!ts.isCallExpression(callExpr)) { - return undefined; - } - - const arg = callExpr.arguments?.[0]; - if (!ts.isObjectLiteralExpression(arg)) { - return undefined; - } - - const newProperties = arg.properties.filter((property) => { - const name = property.name?.getText(); - return name !== ENTRY_STORAGE && name !== ENTRY_USE_SHARED_STORAGE; - }); - - const newArg = ts.factory.createObjectLiteralExpression(newProperties, false); - const text = this.printer.printNode(ts.EmitHint.Unspecified, newArg, entryDecorator.getSourceFile()); - return [{ start: arg.getStart(), end: arg.getEnd(), replacementText: text }]; - } } diff --git a/ets2panda/linter/src/lib/utils/consts/ArkuiConstants.ts b/ets2panda/linter/src/lib/utils/consts/ArkuiConstants.ts index b16394a134..7165daa561 100644 --- a/ets2panda/linter/src/lib/utils/consts/ArkuiConstants.ts +++ b/ets2panda/linter/src/lib/utils/consts/ArkuiConstants.ts @@ -160,13 +160,10 @@ export const serializationTypeName: Set = new Set([ export const customLayoutFunctionName: Set = new Set(['onMeasureSize', 'onPlaceChildren']); export const ENTRY_DECORATOR_NAME = 'Entry'; -export const ENTRY_STORAGE = 'storage'; -export const ENTRY_USE_SHARED_STORAGE = 'useSharedStorage'; +export const ENTRY_STORAGE_PROPERITY = 'storage'; export const LOCAL_STORAGE_TYPE_NAME = 'LocalStorage'; export const GET_LOCAL_STORAGE_FUNC_NAME = '__get_local_storage__'; -export const COMPONENTV2_DECORATOR_NAME = 'ComponentV2'; - export const PROVIDE_DECORATOR_NAME = 'Provide'; export const PROVIDE_ALIAS_PROPERTY_NAME = 'alias'; export const PROVIDE_ALLOW_OVERRIDE_PROPERTY_NAME = 'allowOverride'; diff --git a/ets2panda/linter/test/main/entry_componentv2_1.ets b/ets2panda/linter/test/main/entry_componentv2_1.ets deleted file mode 100644 index ac140a9514..0000000000 --- a/ets2panda/linter/test/main/entry_componentv2_1.ets +++ /dev/null @@ -1,38 +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. - */ - -@Entry({ storage: new LocalStorage() }) -@ComponentV2 -struct MyPage1 { - build() { - Text("Hello World") - } -} - -@Entry({ useSharedStorage: true }) -@ComponentV2 -struct MyPage2 { - build() { - Text("Hello World") - } -} - -@Entry({ storage: new LocalStorage(), useSharedStorage: true }) -@ComponentV2 -struct MyPage3 { - build() { - Text("Hello World") - } -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/entry_componentv2_1.ets.args.json b/ets2panda/linter/test/main/entry_componentv2_1.ets.args.json deleted file mode 100644 index ee0734c0fc..0000000000 --- a/ets2panda/linter/test/main/entry_componentv2_1.ets.args.json +++ /dev/null @@ -1,21 +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." - ], - "mode": { - "arkts2": "", - "autofix": "--arkts-2", - "migrate": "--arkts-2" - } -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/entry_componentv2_1.ets.arkts2.json b/ets2panda/linter/test/main/entry_componentv2_1.ets.arkts2.json deleted file mode 100644 index 6e46e3a973..0000000000 --- a/ets2panda/linter/test/main/entry_componentv2_1.ets.arkts2.json +++ /dev/null @@ -1,178 +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": 16, - "column": 1, - "endLine": 16, - "endColumn": 40, - "problem": "EntryHasInvalidParams", - "suggest": "", - "rule": "The \"@ComponentV2\" decorator cannot be used together with the \"@Entry\" decorator that has \"storage\" or \"useSharedStorage\" parameters (arkui-entry-invalid-params)", - "severity": "ERROR" - }, - { - "line": 16, - "column": 23, - "endLine": 16, - "endColumn": 35, - "problem": "DynamicCtorCall", - "suggest": "", - "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", - "severity": "ERROR" - }, - { - "line": 24, - "column": 1, - "endLine": 24, - "endColumn": 35, - "problem": "EntryHasInvalidParams", - "suggest": "", - "rule": "The \"@ComponentV2\" decorator cannot be used together with the \"@Entry\" decorator that has \"storage\" or \"useSharedStorage\" parameters (arkui-entry-invalid-params)", - "severity": "ERROR" - }, - { - "line": 32, - "column": 1, - "endLine": 32, - "endColumn": 64, - "problem": "EntryHasInvalidParams", - "suggest": "", - "rule": "The \"@ComponentV2\" decorator cannot be used together with the \"@Entry\" decorator that has \"storage\" or \"useSharedStorage\" parameters (arkui-entry-invalid-params)", - "severity": "ERROR" - }, - { - "line": 32, - "column": 23, - "endLine": 32, - "endColumn": 35, - "problem": "DynamicCtorCall", - "suggest": "", - "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", - "severity": "ERROR" - }, - { - "line": 16, - "column": 2, - "endLine": 16, - "endColumn": 7, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 16, - "column": 23, - "endLine": 16, - "endColumn": 35, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "The ArkUI interface \"LocalStorage\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 17, - "column": 2, - "endLine": 17, - "endColumn": 13, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "The ArkUI interface \"ComponentV2\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 20, - "column": 5, - "endLine": 20, - "endColumn": 9, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 24, - "column": 2, - "endLine": 24, - "endColumn": 7, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 25, - "column": 2, - "endLine": 25, - "endColumn": 13, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "The ArkUI interface \"ComponentV2\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 28, - "column": 5, - "endLine": 28, - "endColumn": 9, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 32, - "column": 2, - "endLine": 32, - "endColumn": 7, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 32, - "column": 23, - "endLine": 32, - "endColumn": 35, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "The ArkUI interface \"LocalStorage\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 33, - "column": 2, - "endLine": 33, - "endColumn": 13, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "The ArkUI interface \"ComponentV2\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 36, - "column": 5, - "endLine": 36, - "endColumn": 9, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - } - ] -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/entry_componentv2_1.ets.autofix.json b/ets2panda/linter/test/main/entry_componentv2_1.ets.autofix.json deleted file mode 100644 index bb47a5be22..0000000000 --- a/ets2panda/linter/test/main/entry_componentv2_1.ets.autofix.json +++ /dev/null @@ -1,332 +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": 16, - "column": 1, - "endLine": 16, - "endColumn": 40, - "problem": "EntryHasInvalidParams", - "autofix": [ - { - "start": 612, - "end": 643, - "replacementText": "{}", - "line": 16, - "column": 1, - "endLine": 16, - "endColumn": 40 - } - ], - "suggest": "", - "rule": "The \"@ComponentV2\" decorator cannot be used together with the \"@Entry\" decorator that has \"storage\" or \"useSharedStorage\" parameters (arkui-entry-invalid-params)", - "severity": "ERROR" - }, - { - "line": 16, - "column": 23, - "endLine": 16, - "endColumn": 35, - "problem": "DynamicCtorCall", - "suggest": "", - "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", - "severity": "ERROR" - }, - { - "line": 24, - "column": 1, - "endLine": 24, - "endColumn": 35, - "problem": "EntryHasInvalidParams", - "autofix": [ - { - "start": 725, - "end": 751, - "replacementText": "{}", - "line": 24, - "column": 1, - "endLine": 24, - "endColumn": 35 - } - ], - "suggest": "", - "rule": "The \"@ComponentV2\" decorator cannot be used together with the \"@Entry\" decorator that has \"storage\" or \"useSharedStorage\" parameters (arkui-entry-invalid-params)", - "severity": "ERROR" - }, - { - "line": 32, - "column": 1, - "endLine": 32, - "endColumn": 64, - "problem": "EntryHasInvalidParams", - "autofix": [ - { - "start": 833, - "end": 888, - "replacementText": "{}", - "line": 32, - "column": 1, - "endLine": 32, - "endColumn": 64 - } - ], - "suggest": "", - "rule": "The \"@ComponentV2\" decorator cannot be used together with the \"@Entry\" decorator that has \"storage\" or \"useSharedStorage\" parameters (arkui-entry-invalid-params)", - "severity": "ERROR" - }, - { - "line": 32, - "column": 23, - "endLine": 32, - "endColumn": 35, - "problem": "DynamicCtorCall", - "suggest": "", - "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", - "severity": "ERROR" - }, - { - "line": 16, - "column": 2, - "endLine": 16, - "endColumn": 7, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport {\n Entry,\n LocalStorage,\n ComponentV2,\n Text,\n} from '@kit.ArkUI';", - "line": 36, - "column": 5, - "endLine": 36, - "endColumn": 9 - } - ], - "suggest": "", - "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 16, - "column": 23, - "endLine": 16, - "endColumn": 35, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport {\n Entry,\n LocalStorage,\n ComponentV2,\n Text,\n} from '@kit.ArkUI';", - "line": 36, - "column": 5, - "endLine": 36, - "endColumn": 9 - } - ], - "suggest": "", - "rule": "The ArkUI interface \"LocalStorage\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 17, - "column": 2, - "endLine": 17, - "endColumn": 13, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport {\n Entry,\n LocalStorage,\n ComponentV2,\n Text,\n} from '@kit.ArkUI';", - "line": 36, - "column": 5, - "endLine": 36, - "endColumn": 9 - } - ], - "suggest": "", - "rule": "The ArkUI interface \"ComponentV2\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 20, - "column": 5, - "endLine": 20, - "endColumn": 9, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport {\n Entry,\n LocalStorage,\n ComponentV2,\n Text,\n} from '@kit.ArkUI';", - "line": 36, - "column": 5, - "endLine": 36, - "endColumn": 9 - } - ], - "suggest": "", - "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 24, - "column": 2, - "endLine": 24, - "endColumn": 7, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport {\n Entry,\n LocalStorage,\n ComponentV2,\n Text,\n} from '@kit.ArkUI';", - "line": 36, - "column": 5, - "endLine": 36, - "endColumn": 9 - } - ], - "suggest": "", - "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 25, - "column": 2, - "endLine": 25, - "endColumn": 13, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport {\n Entry,\n LocalStorage,\n ComponentV2,\n Text,\n} from '@kit.ArkUI';", - "line": 36, - "column": 5, - "endLine": 36, - "endColumn": 9 - } - ], - "suggest": "", - "rule": "The ArkUI interface \"ComponentV2\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 28, - "column": 5, - "endLine": 28, - "endColumn": 9, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport {\n Entry,\n LocalStorage,\n ComponentV2,\n Text,\n} from '@kit.ArkUI';", - "line": 36, - "column": 5, - "endLine": 36, - "endColumn": 9 - } - ], - "suggest": "", - "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 32, - "column": 2, - "endLine": 32, - "endColumn": 7, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport {\n Entry,\n LocalStorage,\n ComponentV2,\n Text,\n} from '@kit.ArkUI';", - "line": 36, - "column": 5, - "endLine": 36, - "endColumn": 9 - } - ], - "suggest": "", - "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 32, - "column": 23, - "endLine": 32, - "endColumn": 35, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport {\n Entry,\n LocalStorage,\n ComponentV2,\n Text,\n} from '@kit.ArkUI';", - "line": 36, - "column": 5, - "endLine": 36, - "endColumn": 9 - } - ], - "suggest": "", - "rule": "The ArkUI interface \"LocalStorage\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 33, - "column": 2, - "endLine": 33, - "endColumn": 13, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport {\n Entry,\n LocalStorage,\n ComponentV2,\n Text,\n} from '@kit.ArkUI';", - "line": 36, - "column": 5, - "endLine": 36, - "endColumn": 9 - } - ], - "suggest": "", - "rule": "The ArkUI interface \"ComponentV2\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 36, - "column": 5, - "endLine": 36, - "endColumn": 9, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport {\n Entry,\n LocalStorage,\n ComponentV2,\n Text,\n} from '@kit.ArkUI';", - "line": 36, - "column": 5, - "endLine": 36, - "endColumn": 9 - } - ], - "suggest": "", - "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - } - ] -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/entry_componentv2_1.ets.json b/ets2panda/linter/test/main/entry_componentv2_1.ets.json deleted file mode 100644 index ca88f857e9..0000000000 --- a/ets2panda/linter/test/main/entry_componentv2_1.ets.json +++ /dev/null @@ -1,17 +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": [] -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/entry_componentv2_1.ets.migrate.ets b/ets2panda/linter/test/main/entry_componentv2_1.ets.migrate.ets deleted file mode 100644 index 3f08b0c506..0000000000 --- a/ets2panda/linter/test/main/entry_componentv2_1.ets.migrate.ets +++ /dev/null @@ -1,45 +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 { - Entry, - LocalStorage, - ComponentV2, - Text, -} from '@kit.ArkUI'; - -@Entry({}) -@ComponentV2 -struct MyPage1 { - build() { - Text("Hello World") - } -} - -@Entry({}) -@ComponentV2 -struct MyPage2 { - build() { - Text("Hello World") - } -} - -@Entry({}) -@ComponentV2 -struct MyPage3 { - build() { - Text("Hello World") - } -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/entry_componentv2_1.ets.migrate.json b/ets2panda/linter/test/main/entry_componentv2_1.ets.migrate.json deleted file mode 100644 index ca88f857e9..0000000000 --- a/ets2panda/linter/test/main/entry_componentv2_1.ets.migrate.json +++ /dev/null @@ -1,17 +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": [] -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/entry_componentv2_2.ets b/ets2panda/linter/test/main/entry_componentv2_2.ets deleted file mode 100644 index cf444919a1..0000000000 --- a/ets2panda/linter/test/main/entry_componentv2_2.ets +++ /dev/null @@ -1,46 +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. - */ - -@Entry({ routeName: "Index", storage: new LocalStorage() }) -@ComponentV2 -struct MyPage1 { - build() { - Text("Hello World") - } -} - -@Entry({ routeName: "Index", useSharedStorage: true }) -@ComponentV2 -struct MyPage2 { - build() { - Text("Hello World") - } -} - -@Entry({ routeName: "Index", storage: new LocalStorage(), useSharedStorage: true }) -@ComponentV2 -struct MyPage3 { - build() { - Text("Hello World") - } -} - -@Entry({ routeName: "Index" }) -@ComponentV2 -struct MyPage3 { - build() { - Text("Hello World") - } -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/entry_componentv2_2.ets.args.json b/ets2panda/linter/test/main/entry_componentv2_2.ets.args.json deleted file mode 100644 index ee0734c0fc..0000000000 --- a/ets2panda/linter/test/main/entry_componentv2_2.ets.args.json +++ /dev/null @@ -1,21 +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." - ], - "mode": { - "arkts2": "", - "autofix": "--arkts-2", - "migrate": "--arkts-2" - } -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/entry_componentv2_2.ets.arkts2.json b/ets2panda/linter/test/main/entry_componentv2_2.ets.arkts2.json deleted file mode 100644 index 729d674774..0000000000 --- a/ets2panda/linter/test/main/entry_componentv2_2.ets.arkts2.json +++ /dev/null @@ -1,208 +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": 16, - "column": 1, - "endLine": 16, - "endColumn": 60, - "problem": "EntryHasInvalidParams", - "suggest": "", - "rule": "The \"@ComponentV2\" decorator cannot be used together with the \"@Entry\" decorator that has \"storage\" or \"useSharedStorage\" parameters (arkui-entry-invalid-params)", - "severity": "ERROR" - }, - { - "line": 16, - "column": 43, - "endLine": 16, - "endColumn": 55, - "problem": "DynamicCtorCall", - "suggest": "", - "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", - "severity": "ERROR" - }, - { - "line": 24, - "column": 1, - "endLine": 24, - "endColumn": 55, - "problem": "EntryHasInvalidParams", - "suggest": "", - "rule": "The \"@ComponentV2\" decorator cannot be used together with the \"@Entry\" decorator that has \"storage\" or \"useSharedStorage\" parameters (arkui-entry-invalid-params)", - "severity": "ERROR" - }, - { - "line": 32, - "column": 1, - "endLine": 32, - "endColumn": 84, - "problem": "EntryHasInvalidParams", - "suggest": "", - "rule": "The \"@ComponentV2\" decorator cannot be used together with the \"@Entry\" decorator that has \"storage\" or \"useSharedStorage\" parameters (arkui-entry-invalid-params)", - "severity": "ERROR" - }, - { - "line": 32, - "column": 43, - "endLine": 32, - "endColumn": 55, - "problem": "DynamicCtorCall", - "suggest": "", - "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", - "severity": "ERROR" - }, - { - "line": 16, - "column": 2, - "endLine": 16, - "endColumn": 7, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 16, - "column": 43, - "endLine": 16, - "endColumn": 55, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "The ArkUI interface \"LocalStorage\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 17, - "column": 2, - "endLine": 17, - "endColumn": 13, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "The ArkUI interface \"ComponentV2\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 20, - "column": 5, - "endLine": 20, - "endColumn": 9, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 24, - "column": 2, - "endLine": 24, - "endColumn": 7, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 25, - "column": 2, - "endLine": 25, - "endColumn": 13, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "The ArkUI interface \"ComponentV2\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 28, - "column": 5, - "endLine": 28, - "endColumn": 9, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 32, - "column": 2, - "endLine": 32, - "endColumn": 7, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 32, - "column": 43, - "endLine": 32, - "endColumn": 55, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "The ArkUI interface \"LocalStorage\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 33, - "column": 2, - "endLine": 33, - "endColumn": 13, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "The ArkUI interface \"ComponentV2\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 36, - "column": 5, - "endLine": 36, - "endColumn": 9, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 40, - "column": 2, - "endLine": 40, - "endColumn": 7, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 41, - "column": 2, - "endLine": 41, - "endColumn": 13, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "The ArkUI interface \"ComponentV2\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 44, - "column": 5, - "endLine": 44, - "endColumn": 9, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - } - ] -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/entry_componentv2_2.ets.autofix.json b/ets2panda/linter/test/main/entry_componentv2_2.ets.autofix.json deleted file mode 100644 index dbcdb633af..0000000000 --- a/ets2panda/linter/test/main/entry_componentv2_2.ets.autofix.json +++ /dev/null @@ -1,395 +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": 16, - "column": 1, - "endLine": 16, - "endColumn": 60, - "problem": "EntryHasInvalidParams", - "autofix": [ - { - "start": 612, - "end": 663, - "replacementText": "{ routeName: \"Index\" }", - "line": 16, - "column": 1, - "endLine": 16, - "endColumn": 60 - } - ], - "suggest": "", - "rule": "The \"@ComponentV2\" decorator cannot be used together with the \"@Entry\" decorator that has \"storage\" or \"useSharedStorage\" parameters (arkui-entry-invalid-params)", - "severity": "ERROR" - }, - { - "line": 16, - "column": 43, - "endLine": 16, - "endColumn": 55, - "problem": "DynamicCtorCall", - "suggest": "", - "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", - "severity": "ERROR" - }, - { - "line": 24, - "column": 1, - "endLine": 24, - "endColumn": 55, - "problem": "EntryHasInvalidParams", - "autofix": [ - { - "start": 745, - "end": 791, - "replacementText": "{ routeName: \"Index\" }", - "line": 24, - "column": 1, - "endLine": 24, - "endColumn": 55 - } - ], - "suggest": "", - "rule": "The \"@ComponentV2\" decorator cannot be used together with the \"@Entry\" decorator that has \"storage\" or \"useSharedStorage\" parameters (arkui-entry-invalid-params)", - "severity": "ERROR" - }, - { - "line": 32, - "column": 1, - "endLine": 32, - "endColumn": 84, - "problem": "EntryHasInvalidParams", - "autofix": [ - { - "start": 873, - "end": 948, - "replacementText": "{ routeName: \"Index\" }", - "line": 32, - "column": 1, - "endLine": 32, - "endColumn": 84 - } - ], - "suggest": "", - "rule": "The \"@ComponentV2\" decorator cannot be used together with the \"@Entry\" decorator that has \"storage\" or \"useSharedStorage\" parameters (arkui-entry-invalid-params)", - "severity": "ERROR" - }, - { - "line": 32, - "column": 43, - "endLine": 32, - "endColumn": 55, - "problem": "DynamicCtorCall", - "suggest": "", - "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", - "severity": "ERROR" - }, - { - "line": 16, - "column": 2, - "endLine": 16, - "endColumn": 7, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport {\n Entry,\n LocalStorage,\n ComponentV2,\n Text,\n} from '@kit.ArkUI';", - "line": 44, - "column": 5, - "endLine": 44, - "endColumn": 9 - } - ], - "suggest": "", - "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 16, - "column": 43, - "endLine": 16, - "endColumn": 55, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport {\n Entry,\n LocalStorage,\n ComponentV2,\n Text,\n} from '@kit.ArkUI';", - "line": 44, - "column": 5, - "endLine": 44, - "endColumn": 9 - } - ], - "suggest": "", - "rule": "The ArkUI interface \"LocalStorage\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 17, - "column": 2, - "endLine": 17, - "endColumn": 13, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport {\n Entry,\n LocalStorage,\n ComponentV2,\n Text,\n} from '@kit.ArkUI';", - "line": 44, - "column": 5, - "endLine": 44, - "endColumn": 9 - } - ], - "suggest": "", - "rule": "The ArkUI interface \"ComponentV2\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 20, - "column": 5, - "endLine": 20, - "endColumn": 9, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport {\n Entry,\n LocalStorage,\n ComponentV2,\n Text,\n} from '@kit.ArkUI';", - "line": 44, - "column": 5, - "endLine": 44, - "endColumn": 9 - } - ], - "suggest": "", - "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 24, - "column": 2, - "endLine": 24, - "endColumn": 7, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport {\n Entry,\n LocalStorage,\n ComponentV2,\n Text,\n} from '@kit.ArkUI';", - "line": 44, - "column": 5, - "endLine": 44, - "endColumn": 9 - } - ], - "suggest": "", - "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 25, - "column": 2, - "endLine": 25, - "endColumn": 13, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport {\n Entry,\n LocalStorage,\n ComponentV2,\n Text,\n} from '@kit.ArkUI';", - "line": 44, - "column": 5, - "endLine": 44, - "endColumn": 9 - } - ], - "suggest": "", - "rule": "The ArkUI interface \"ComponentV2\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 28, - "column": 5, - "endLine": 28, - "endColumn": 9, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport {\n Entry,\n LocalStorage,\n ComponentV2,\n Text,\n} from '@kit.ArkUI';", - "line": 44, - "column": 5, - "endLine": 44, - "endColumn": 9 - } - ], - "suggest": "", - "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 32, - "column": 2, - "endLine": 32, - "endColumn": 7, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport {\n Entry,\n LocalStorage,\n ComponentV2,\n Text,\n} from '@kit.ArkUI';", - "line": 44, - "column": 5, - "endLine": 44, - "endColumn": 9 - } - ], - "suggest": "", - "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 32, - "column": 43, - "endLine": 32, - "endColumn": 55, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport {\n Entry,\n LocalStorage,\n ComponentV2,\n Text,\n} from '@kit.ArkUI';", - "line": 44, - "column": 5, - "endLine": 44, - "endColumn": 9 - } - ], - "suggest": "", - "rule": "The ArkUI interface \"LocalStorage\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 33, - "column": 2, - "endLine": 33, - "endColumn": 13, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport {\n Entry,\n LocalStorage,\n ComponentV2,\n Text,\n} from '@kit.ArkUI';", - "line": 44, - "column": 5, - "endLine": 44, - "endColumn": 9 - } - ], - "suggest": "", - "rule": "The ArkUI interface \"ComponentV2\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 36, - "column": 5, - "endLine": 36, - "endColumn": 9, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport {\n Entry,\n LocalStorage,\n ComponentV2,\n Text,\n} from '@kit.ArkUI';", - "line": 44, - "column": 5, - "endLine": 44, - "endColumn": 9 - } - ], - "suggest": "", - "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 40, - "column": 2, - "endLine": 40, - "endColumn": 7, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport {\n Entry,\n LocalStorage,\n ComponentV2,\n Text,\n} from '@kit.ArkUI';", - "line": 44, - "column": 5, - "endLine": 44, - "endColumn": 9 - } - ], - "suggest": "", - "rule": "The ArkUI interface \"Entry\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 41, - "column": 2, - "endLine": 41, - "endColumn": 13, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport {\n Entry,\n LocalStorage,\n ComponentV2,\n Text,\n} from '@kit.ArkUI';", - "line": 44, - "column": 5, - "endLine": 44, - "endColumn": 9 - } - ], - "suggest": "", - "rule": "The ArkUI interface \"ComponentV2\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 44, - "column": 5, - "endLine": 44, - "endColumn": 9, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport {\n Entry,\n LocalStorage,\n ComponentV2,\n Text,\n} from '@kit.ArkUI';", - "line": 44, - "column": 5, - "endLine": 44, - "endColumn": 9 - } - ], - "suggest": "", - "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", - "severity": "ERROR" - } - ] -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/entry_componentv2_2.ets.json b/ets2panda/linter/test/main/entry_componentv2_2.ets.json deleted file mode 100644 index ca88f857e9..0000000000 --- a/ets2panda/linter/test/main/entry_componentv2_2.ets.json +++ /dev/null @@ -1,17 +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": [] -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/entry_componentv2_2.ets.migrate.ets b/ets2panda/linter/test/main/entry_componentv2_2.ets.migrate.ets deleted file mode 100644 index ee23d5281f..0000000000 --- a/ets2panda/linter/test/main/entry_componentv2_2.ets.migrate.ets +++ /dev/null @@ -1,53 +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 { - Entry, - LocalStorage, - ComponentV2, - Text, -} from '@kit.ArkUI'; - -@Entry({ routeName: "Index" }) -@ComponentV2 -struct MyPage1 { - build() { - Text("Hello World") - } -} - -@Entry({ routeName: "Index" }) -@ComponentV2 -struct MyPage2 { - build() { - Text("Hello World") - } -} - -@Entry({ routeName: "Index" }) -@ComponentV2 -struct MyPage3 { - build() { - Text("Hello World") - } -} - -@Entry({ routeName: "Index" }) -@ComponentV2 -struct MyPage3 { - build() { - Text("Hello World") - } -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/entry_componentv2_2.ets.migrate.json b/ets2panda/linter/test/main/entry_componentv2_2.ets.migrate.json deleted file mode 100644 index ca88f857e9..0000000000 --- a/ets2panda/linter/test/main/entry_componentv2_2.ets.migrate.json +++ /dev/null @@ -1,17 +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": [] -} \ No newline at end of file -- Gitee