From 0b9ebd5754047d867d3008b2cc1c76b5445aaa4a Mon Sep 17 00:00:00 2001 From: Utku Enes GURSEL Date: Thu, 14 Aug 2025 12:56:52 +0300 Subject: [PATCH] add check for arkui select component Issue: ICT0ZP Description: Add check for ArkUI Select component Signed-off-by: Utku Enes GURSEL --- ets2panda/linter/src/lib/TypeScriptLinter.ts | 96 +-- .../linter/src/lib/autofixes/Autofixer.ts | 6 +- .../src/lib/statistics/scan/WorkLoadInfo.ts | 2 +- .../linter/src/lib/utils/consts/Literals.ts | 3 + .../builtin_array_negative.ets.arkts2.json | 784 +++++++++--------- ets2panda/linter/test/main/arkui-select.ets | 61 ++ .../test/main/arkui-select.ets.args.json | 19 + .../test/main/arkui-select.ets.arkts2.json | 288 +++++++ ...nt.ets.args.json => arkui-select.ets.json} | 6 +- .../call_expression_matching_argument.ets | 70 -- ...pression_matching_argument.ets.arkts2.json | 58 -- ...call_expression_matching_argument.ets.json | 38 - 12 files changed, 794 insertions(+), 637 deletions(-) create mode 100644 ets2panda/linter/test/main/arkui-select.ets create mode 100644 ets2panda/linter/test/main/arkui-select.ets.args.json create mode 100644 ets2panda/linter/test/main/arkui-select.ets.arkts2.json rename ets2panda/linter/test/main/{call_expression_matching_argument.ets.args.json => arkui-select.ets.json} (94%) delete mode 100644 ets2panda/linter/test/main/call_expression_matching_argument.ets delete mode 100644 ets2panda/linter/test/main/call_expression_matching_argument.ets.arkts2.json delete mode 100644 ets2panda/linter/test/main/call_expression_matching_argument.ets.json diff --git a/ets2panda/linter/src/lib/TypeScriptLinter.ts b/ets2panda/linter/src/lib/TypeScriptLinter.ts index c2f34353a2..20ff8165f7 100644 --- a/ets2panda/linter/src/lib/TypeScriptLinter.ts +++ b/ets2panda/linter/src/lib/TypeScriptLinter.ts @@ -221,7 +221,7 @@ import { ERROR_TASKPOOL_PROP_LIST } from './utils/consts/ErrorProp'; import { COMMON_UNION_MEMBER_ACCESS_WHITELIST } from './utils/consts/ArktsWhiteApiPaths'; import type { BaseClassConstructorInfo, ConstructorParameter, ExtendedIdentifierInfo } from './utils/consts/Types'; import { ExtendedIdentifierType } from './utils/consts/Types'; -import { STRING_ERROR_LITERAL } from './utils/consts/Literals'; +import { COMPONENT_DECORATOR, SELECT_IDENTIFIER, SELECT_OPTIONS, STRING_ERROR_LITERAL } from './utils/consts/Literals'; import { ES_OBJECT } from './utils/consts/ESObject'; import { cookBookMsg } from './CookBookMsg'; @@ -5570,102 +5570,64 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { this.handleNoDeprecatedApi(callExpr); this.handleFunctionReturnThisCall(callExpr); this.handlePromiseTupleGeneric(callExpr); - this.checkArgumentTypeOfCallExpr(callExpr, callSignature); + this.isSelectOfArkUI(callExpr, callSignature); this.handleTupleGeneric(callExpr); } - private checkArgumentTypeOfCallExpr(callExpr: ts.CallExpression, signature: ts.Signature | undefined): void { + private isSelectOfArkUI(callExpr: ts.CallExpression, signature: ts.Signature | undefined): void { if (!this.options.arkts2) { return; } - if (!signature) { - return; - } - - const args = callExpr.arguments; - if (args.length === 0) { - return; - } - - for (const [idx, arg] of args.entries()) { - this.isArgumentAndParameterMatch(signature, arg, idx); - } - } - private isArgumentAndParameterMatch(signature: ts.Signature, arg: ts.Expression, idx: number): void { - if (!ts.isPropertyAccessExpression(arg)) { + if (callExpr.expression.getText() !== SELECT_IDENTIFIER) { return; } - let rootObject = arg.expression; - - while (ts.isPropertyAccessExpression(rootObject)) { - rootObject = rootObject.expression; - } - - if (rootObject.kind !== ts.SyntaxKind.ThisKeyword) { + /* + * for some reason UI component methods signatures cannot be accessed through here, + * there should be no signature declaration of this callExpression, + * if there is signature declaration we will assume this is not an ArkUI component + */ + if (signature?.getDeclaration()) { return; } - const param = signature.parameters.at(idx); - if (!param) { - return; - } - const paramDecl = param.getDeclarations(); - if (!paramDecl || paramDecl.length === 0) { + const insideArkUi = this.isInComponentBlock(callExpr.getSourceFile()); + if (!insideArkUi) { return; } - const paramFirstDecl = paramDecl[0]; - if (!ts.isParameter(paramFirstDecl)) { + const args = callExpr.arguments; + if (args.length !== 1) { return; } - const paramTypeNode = paramFirstDecl.type; + const arg = args[0]; const argumentType = this.tsTypeChecker.getTypeAtLocation(arg); - if (!paramTypeNode) { - return; - } - - if (!paramTypeNode) { - return; - } - const argumentTypeString = this.tsTypeChecker.typeToString(argumentType); - if (ts.isUnionTypeNode(paramTypeNode)) { - this.checkUnionTypesMatching(arg, paramTypeNode, argumentTypeString); - } else { - this.checkSingleTypeMatching(paramTypeNode, arg, argumentTypeString); - } - } - private checkSingleTypeMatching(paramTypeNode: ts.TypeNode, arg: ts.Node, argumentTypeString: string): void { - const paramType = this.tsTypeChecker.getTypeFromTypeNode(paramTypeNode); - const paramTypeString = this.tsTypeChecker.typeToString(paramType); - if (TsUtils.isIgnoredTypeForParameterType(paramTypeString, paramType)) { + if (SELECT_OPTIONS.includes(argumentTypeString)) { return; } - if (argumentTypeString !== paramTypeString) { - this.incrementCounters(arg, FaultID.StructuralIdentity); - } + this.incrementCounters(arg, FaultID.StructuralIdentity); } - private checkUnionTypesMatching(arg: ts.Node, paramTypeNode: ts.UnionTypeNode, argumentTypeString: string): void { - let notMatching = true; - for (const type of paramTypeNode.types) { - const paramType = this.tsTypeChecker.getTypeFromTypeNode(type); - const paramTypeString = this.tsTypeChecker.typeToString(paramType); - notMatching = !TsUtils.isIgnoredTypeForParameterType(paramTypeString, paramType); - - if (argumentTypeString === paramTypeString) { - notMatching = false; + private isInComponentBlock(sourceFile: ts.SourceFile): boolean { + void this; + let isInside = false; + for (const statement of sourceFile.statements) { + statement.forEachChild((node) => { + if (node.getText() === COMPONENT_DECORATOR) { + isInside = true; + } + }); + if (isInside) { + break; } } - if (notMatching) { - this.incrementCounters(arg, FaultID.StructuralIdentity); - } + return isInside; } private handleTupleGeneric(callExpr: ts.CallExpression): void { diff --git a/ets2panda/linter/src/lib/autofixes/Autofixer.ts b/ets2panda/linter/src/lib/autofixes/Autofixer.ts index 91ff39cad5..179b43b46c 100644 --- a/ets2panda/linter/src/lib/autofixes/Autofixer.ts +++ b/ets2panda/linter/src/lib/autofixes/Autofixer.ts @@ -3733,7 +3733,7 @@ export class Autofixer { const codeStartLine = isUseStaticAtStart ? annotationEndLine + 1 : - file.getLineAndCharacterOfPosition(file.getStart()).line; + file.getLineAndCharacterOfPosition(file.getStart()).line; for (let i = 2; i > codeStartLine - annotationEndLine; i--) { text = text + this.getNewLine(); } @@ -3760,7 +3760,9 @@ export class Autofixer { } private static checkUseStaticAtStart(stmt: ts.Statement): boolean { - return stmt.getText().trim().replace(/^'|'$/g, '').endsWith(USE_STATIC_STATEMENT); + return stmt.getText().trim(). + replace(/^'|'$/g, ''). + endsWith(USE_STATIC_STATEMENT); } fixStylesDecoratorGlobal( diff --git a/ets2panda/linter/src/lib/statistics/scan/WorkLoadInfo.ts b/ets2panda/linter/src/lib/statistics/scan/WorkLoadInfo.ts index 0fbb9d817c..9376d47509 100644 --- a/ets2panda/linter/src/lib/statistics/scan/WorkLoadInfo.ts +++ b/ets2panda/linter/src/lib/statistics/scan/WorkLoadInfo.ts @@ -54,7 +54,7 @@ export class WorkLoadInfo { (problemCount * AVERAGE_LINE_FOR_REPAIRE_RULE_COEFFICIENT * TEST_DEBUG_WORKLOAD_COEFFICIENT + this.totalNapiCodeLines * NPAI_REPAIRE_WORKLOADA_COEFFICIEN) / totalLines; - + this.manualFixRate = `${(ratio * 100).toFixed(2)}%`; } } diff --git a/ets2panda/linter/src/lib/utils/consts/Literals.ts b/ets2panda/linter/src/lib/utils/consts/Literals.ts index df8054e343..56d16c0fe2 100644 --- a/ets2panda/linter/src/lib/utils/consts/Literals.ts +++ b/ets2panda/linter/src/lib/utils/consts/Literals.ts @@ -15,3 +15,6 @@ export const STRING_ERROR_LITERAL = 'Error'; export const CONCAT_ARRAY = 'ConcatArray'; +export const SELECT_IDENTIFIER = 'Select'; +export const SELECT_OPTIONS = ['Array', 'SelectOption[]']; +export const COMPONENT_DECORATOR = '@Component'; diff --git a/ets2panda/linter/test/builtin/builtin_array_negative.ets.arkts2.json b/ets2panda/linter/test/builtin/builtin_array_negative.ets.arkts2.json index 86ad8dac2f..bc4681ba74 100755 --- a/ets2panda/linter/test/builtin/builtin_array_negative.ets.arkts2.json +++ b/ets2panda/linter/test/builtin/builtin_array_negative.ets.arkts2.json @@ -1,398 +1,388 @@ -{ - "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": 15, - "column": 10, - "endLine": 15, - "endColumn": 21, - "problem": "LimitedStdLibNoImportConcurrency", - "suggest": "", - "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", - "severity": "ERROR" - }, - { - "line": 17, - "column": 16, - "endLine": 17, - "endColumn": 21, - "problem": "BuiltinNewCtor", - "suggest": "", - "rule": "API is not support initial ctor signature (arkts-builtin-new-cotr)", - "severity": "ERROR" - }, - { - "line": 18, - "column": 16, - "endLine": 18, - "endColumn": 21, - "problem": "BuiltinNewCtor", - "suggest": "", - "rule": "API is not support initial ctor signature (arkts-builtin-new-cotr)", - "severity": "ERROR" - }, - { - "line": 19, - "column": 6, - "endLine": 19, - "endColumn": 12, - "problem": "BuiltinNarrowTypes", - "suggest": "", - "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", - "severity": "ERROR" - }, - { - "line": 21, - "column": 40, - "endLine": 21, - "endColumn": 45, - "problem": "BuiltinNewCtor", - "suggest": "", - "rule": "API is not support initial ctor signature (arkts-builtin-new-cotr)", - "severity": "ERROR" - }, - { - "line": 22, - "column": 40, - "endLine": 22, - "endColumn": 45, - "problem": "BuiltinNewCtor", - "suggest": "", - "rule": "API is not support initial ctor signature (arkts-builtin-new-cotr)", - "severity": "ERROR" - }, - { - "line": 23, - "column": 7, - "endLine": 23, - "endColumn": 13, - "problem": "BuiltinNarrowTypes", - "suggest": "", - "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", - "severity": "ERROR" - }, - { - "line": 25, - "column": 21, - "endLine": 25, - "endColumn": 28, - "problem": "BuiltinNarrowTypes", - "suggest": "", - "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", - "severity": "ERROR" - }, - { - "line": 26, - "column": 15, - "endLine": 26, - "endColumn": 20, - "problem": "BuiltinNewCtor", - "suggest": "", - "rule": "API is not support initial ctor signature (arkts-builtin-new-cotr)", - "severity": "ERROR" - }, - { - "line": 29, - "column": 23, - "endLine": 29, - "endColumn": 29, - "problem": "BuiltinNarrowTypes", - "suggest": "", - "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", - "severity": "ERROR" - }, - { - "line": 30, - "column": 12, - "endLine": 30, - "endColumn": 18, - "problem": "BuiltinNarrowTypes", - "suggest": "", - "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", - "severity": "ERROR" - }, - { - "line": 30, - "column": 5, - "endLine": 30, - "endColumn": 9, - "problem": "BuiltinNewCtor", - "suggest": "", - "rule": "API is not support initial ctor signature (arkts-builtin-new-cotr)", - "severity": "ERROR" - }, - { - "line": 34, - "column": 11, - "endLine": 34, - "endColumn": 17, - "problem": "BuiltinNarrowTypes", - "suggest": "", - "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", - "severity": "ERROR" - }, - { - "line": 35, - "column": 35, - "endLine": 35, - "endColumn": 41, - "problem": "BuiltinNarrowTypes", - "suggest": "", - "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", - "severity": "ERROR" - }, - { - "line": 37, - "column": 13, - "endLine": 37, - "endColumn": 19, - "problem": "BuiltinNarrowTypes", - "suggest": "", - "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", - "severity": "ERROR" - }, - { - "line": 40, - "column": 14, - "endLine": 40, - "endColumn": 19, - "problem": "BuiltinNewCtor", - "suggest": "", - "rule": "API is not support initial ctor signature (arkts-builtin-new-cotr)", - "severity": "ERROR" - }, - { - "line": 41, - "column": 1, - "endLine": 41, - "endColumn": 20, - "problem": "InteropCallReflect", - "suggest": "", - "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", - "severity": "ERROR" - }, - { - "line": 41, - "column": 9, - "endLine": 41, - "endColumn": 16, - "problem": "BuiltinNarrowTypes", - "suggest": "", - "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", - "severity": "ERROR" - }, - { - "line": 44, - "column": 13, - "endLine": 44, - "endColumn": 19, - "problem": "BuiltinNarrowTypes", - "suggest": "", - "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", - "severity": "ERROR" - }, - { - "line": 45, - "column": 13, - "endLine": 45, - "endColumn": 19, - "problem": "BuiltinNarrowTypes", - "suggest": "", - "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", - "severity": "ERROR" - }, - { - "line": 47, - "column": 46, - "endLine": 47, - "endColumn": 50, - "problem": "ExtendsExpression", - "suggest": "", - "rule": "Extends or implements expression are not supported(arkts-no-extends-expression)", - "severity": "ERROR" - }, - { - "line": 47, - "column": 7, - "endLine": 47, - "endColumn": 11, - "problem": "InterfaceFieldNotImplemented", - "suggest": "", - "rule": "ArkTS 1.2 should implement all fields in the interface in the class (arkts-no-class-omit-interface-optional-prop)", - "severity": "ERROR" - }, - { - "line": 59, - "column": 3, - "endLine": 61, - "endColumn": 4, - "problem": "BuiltinNarrowTypes", - "suggest": "", - "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", - "severity": "ERROR" - }, - { - "line": 50, - "column": 21, - "endLine": 50, - "endColumn": 25, - "problem": "BuiltinNewCtor", - "suggest": "", - "rule": "API is not support initial ctor signature (arkts-builtin-new-cotr)", - "severity": "ERROR" - }, - { - "line": 54, - "column": 21, - "endLine": 54, - "endColumn": 35, - "problem": "StructuralIdentity", - "suggest": "", - "rule": "Structural typing is not supported (arkts-no-structural-typing)", - "severity": "ERROR" - }, - { - "line": 56, - "column": 24, - "endLine": 56, - "endColumn": 46, - "problem": "IsOperator", - "suggest": "", - "rule": "Type guarding is supported with \"instanceof\" and \"as\" (arkts-no-is)", - "severity": "ERROR" - }, - { - "line": 57, - "column": 21, - "endLine": 57, - "endColumn": 27, - "problem": "BuiltinNarrowTypes", - "suggest": "", - "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", - "severity": "ERROR" - }, - { - "line": 59, - "column": 10, - "endLine": 59, - "endColumn": 22, - "problem": "MethodInheritRule", - "suggest": "", - "rule": "Overridden method parameters and return types must respect type inheritance principles (arkts-method-inherit-rule)", - "severity": "ERROR" - }, - { - "line": 64, - "column": 5, - "endLine": 64, - "endColumn": 43, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 64, - "column": 17, - "endLine": 64, - "endColumn": 34, - "problem": "DynamicCtorCall", - "suggest": "", - "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", - "severity": "ERROR" - }, - { - "line": 65, - "column": 5, - "endLine": 65, - "endColumn": 44, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 65, - "column": 18, - "endLine": 65, - "endColumn": 35, - "problem": "DynamicCtorCall", - "suggest": "", - "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", - "severity": "ERROR" - }, - { - "line": 66, - "column": 5, - "endLine": 66, - "endColumn": 44, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 66, - "column": 18, - "endLine": 66, - "endColumn": 35, - "problem": "DynamicCtorCall", - "suggest": "", - "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", - "severity": "ERROR" - }, - { - "line": 67, - "column": 5, - "endLine": 67, - "endColumn": 47, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 68, - "column": 43, - "endLine": 68, - "endColumn": 60, - "problem": "DynamicCtorCall", - "suggest": "", - "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", - "severity": "ERROR" - }, - { - "line": 73, - "column": 13, - "endLine": 73, - "endColumn": 19, - "problem": "BuiltinNarrowTypes", - "suggest": "", - "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", - "severity": "ERROR" - }, - { - "line": 76, - "column": 13, - "endLine": 76, - "endColumn": 19, - "problem": "BuiltinNarrowTypes", - "suggest": "", - "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", - "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": 15, + "column": 10, + "endLine": 15, + "endColumn": 21, + "problem": "LimitedStdLibNoImportConcurrency", + "suggest": "", + "rule": "Import Concurrency is not required (arkts-limited-stdlib-no-import-concurrency)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 16, + "endLine": 17, + "endColumn": 21, + "problem": "BuiltinNewCtor", + "suggest": "", + "rule": "API is not support initial ctor signature (arkts-builtin-new-cotr)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 16, + "endLine": 18, + "endColumn": 21, + "problem": "BuiltinNewCtor", + "suggest": "", + "rule": "API is not support initial ctor signature (arkts-builtin-new-cotr)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 6, + "endLine": 19, + "endColumn": 12, + "problem": "BuiltinNarrowTypes", + "suggest": "", + "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 40, + "endLine": 21, + "endColumn": 45, + "problem": "BuiltinNewCtor", + "suggest": "", + "rule": "API is not support initial ctor signature (arkts-builtin-new-cotr)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 40, + "endLine": 22, + "endColumn": 45, + "problem": "BuiltinNewCtor", + "suggest": "", + "rule": "API is not support initial ctor signature (arkts-builtin-new-cotr)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 7, + "endLine": 23, + "endColumn": 13, + "problem": "BuiltinNarrowTypes", + "suggest": "", + "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 21, + "endLine": 25, + "endColumn": 28, + "problem": "BuiltinNarrowTypes", + "suggest": "", + "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 15, + "endLine": 26, + "endColumn": 20, + "problem": "BuiltinNewCtor", + "suggest": "", + "rule": "API is not support initial ctor signature (arkts-builtin-new-cotr)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 23, + "endLine": 29, + "endColumn": 29, + "problem": "BuiltinNarrowTypes", + "suggest": "", + "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 12, + "endLine": 30, + "endColumn": 18, + "problem": "BuiltinNarrowTypes", + "suggest": "", + "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 5, + "endLine": 30, + "endColumn": 9, + "problem": "BuiltinNewCtor", + "suggest": "", + "rule": "API is not support initial ctor signature (arkts-builtin-new-cotr)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 11, + "endLine": 34, + "endColumn": 17, + "problem": "BuiltinNarrowTypes", + "suggest": "", + "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", + "severity": "ERROR" + }, + { + "line": 35, + "column": 35, + "endLine": 35, + "endColumn": 41, + "problem": "BuiltinNarrowTypes", + "suggest": "", + "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", + "severity": "ERROR" + }, + { + "line": 37, + "column": 13, + "endLine": 37, + "endColumn": 19, + "problem": "BuiltinNarrowTypes", + "suggest": "", + "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", + "severity": "ERROR" + }, + { + "line": 40, + "column": 14, + "endLine": 40, + "endColumn": 19, + "problem": "BuiltinNewCtor", + "suggest": "", + "rule": "API is not support initial ctor signature (arkts-builtin-new-cotr)", + "severity": "ERROR" + }, + { + "line": 41, + "column": 1, + "endLine": 41, + "endColumn": 20, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 41, + "column": 9, + "endLine": 41, + "endColumn": 16, + "problem": "BuiltinNarrowTypes", + "suggest": "", + "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", + "severity": "ERROR" + }, + { + "line": 44, + "column": 13, + "endLine": 44, + "endColumn": 19, + "problem": "BuiltinNarrowTypes", + "suggest": "", + "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", + "severity": "ERROR" + }, + { + "line": 45, + "column": 13, + "endLine": 45, + "endColumn": 19, + "problem": "BuiltinNarrowTypes", + "suggest": "", + "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", + "severity": "ERROR" + }, + { + "line": 47, + "column": 46, + "endLine": 47, + "endColumn": 50, + "problem": "ExtendsExpression", + "suggest": "", + "rule": "Extends or implements expression are not supported(arkts-no-extends-expression)", + "severity": "ERROR" + }, + { + "line": 47, + "column": 7, + "endLine": 47, + "endColumn": 11, + "problem": "InterfaceFieldNotImplemented", + "suggest": "", + "rule": "ArkTS 1.2 should implement all fields in the interface in the class (arkts-no-class-omit-interface-optional-prop)", + "severity": "ERROR" + }, + { + "line": 59, + "column": 3, + "endLine": 61, + "endColumn": 4, + "problem": "BuiltinNarrowTypes", + "suggest": "", + "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", + "severity": "ERROR" + }, + { + "line": 50, + "column": 21, + "endLine": 50, + "endColumn": 25, + "problem": "BuiltinNewCtor", + "suggest": "", + "rule": "API is not support initial ctor signature (arkts-builtin-new-cotr)", + "severity": "ERROR" + }, + { + "line": 56, + "column": 24, + "endLine": 56, + "endColumn": 46, + "problem": "IsOperator", + "suggest": "", + "rule": "Type guarding is supported with \"instanceof\" and \"as\" (arkts-no-is)", + "severity": "ERROR" + }, + { + "line": 57, + "column": 21, + "endLine": 57, + "endColumn": 27, + "problem": "BuiltinNarrowTypes", + "suggest": "", + "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", + "severity": "ERROR" + }, + { + "line": 59, + "column": 10, + "endLine": 59, + "endColumn": 22, + "problem": "MethodInheritRule", + "suggest": "", + "rule": "Overridden method parameters and return types must respect type inheritance principles (arkts-method-inherit-rule)", + "severity": "ERROR" + }, + { + "line": 64, + "column": 5, + "endLine": 64, + "endColumn": 43, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 64, + "column": 17, + "endLine": 64, + "endColumn": 34, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 65, + "column": 5, + "endLine": 65, + "endColumn": 44, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 65, + "column": 18, + "endLine": 65, + "endColumn": 35, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 66, + "column": 5, + "endLine": 66, + "endColumn": 44, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 66, + "column": 18, + "endLine": 66, + "endColumn": 35, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 67, + "column": 5, + "endLine": 67, + "endColumn": 47, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 68, + "column": 43, + "endLine": 68, + "endColumn": 60, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 73, + "column": 13, + "endLine": 73, + "endColumn": 19, + "problem": "BuiltinNarrowTypes", + "suggest": "", + "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", + "severity": "ERROR" + }, + { + "line": 76, + "column": 13, + "endLine": 76, + "endColumn": 19, + "problem": "BuiltinNarrowTypes", + "suggest": "", + "rule": "Using narrowing of types is not allowed in this API (arkts-builtin-narrow-types)", + "severity": "ERROR" + } + ] } \ No newline at end of file diff --git a/ets2panda/linter/test/main/arkui-select.ets b/ets2panda/linter/test/main/arkui-select.ets new file mode 100644 index 0000000000..92b8ccbde7 --- /dev/null +++ b/ets2panda/linter/test/main/arkui-select.ets @@ -0,0 +1,61 @@ +/* + * 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. + */ + + @Component + export struct ConsumeDescendentComponent { + // 初始化一个颜色数组数据 + @State selectColors: ColorType[] = COLOR_SELECT_DATA; + // 和爷组件双向同步圆形颜色 + @Consume consumeCircleColor: Resource; + // 和爷组件双向同步Select的Index值 + @Consume currentSelectIndex: number; + private CONTEXT: common.UIAbilityContext = this.getUIContext()?.getHostContext() as common.UIAbilityContext;//修改 + + build() { + Column() { + // 点击查看源码 + ViewCodeText({ webSrc: $rawfile('ConsumeDescendentComponent.ets.html') }) + Row() { + Select(this.selectColors) + .selected(this.currentSelectIndex) + .value(getResourceString(this.CONTEXT, this.selectColors[this.currentSelectIndex as int].value)) //修改this.context + .fontColor($r('app.color.button_text_color')) + .font({ size: $r('app.float.tips_font_size') }) + .selectedOptionFont({ size: $r('app.float.tips_font_size') }) + .optionFont({ size: $r('app.float.tips_font_size') }) + .id('grandsonCompB') + .onSelect((index: number) => { + // 孙组件@Consume声明的数据页面更新,爷组件@Provide的数据页面同步更新 + this.currentSelectIndex = index; + this.consumeCircleColor = this.selectColors[index as int].color; + }) + Circle() + .size({ width: $r('app.float.circle_size'), height: $r('app.float.circle_size') }) + .fill(this.consumeCircleColor) + + }.justifyContent(FlexAlign.SpaceAround) + .width('100%') + .margin({ bottom: 6.0 }as Margin)//修改添加 as Margin + + Text($r('app.string.deepnest_descendent_titletwo')) + .fontColor($r('app.color.tips_font_color')) + .fontSize($r('app.float.button_text_size')) + .width('100%') + .textAlign(TextAlign.Center) + } + .padding(10.0) + .border({ radius: $r('app.float.component_radius'), color: Color.Red, width: $r('app.float.border_width') }) + } + } diff --git a/ets2panda/linter/test/main/arkui-select.ets.args.json b/ets2panda/linter/test/main/arkui-select.ets.args.json new file mode 100644 index 0000000000..aac366be5e --- /dev/null +++ b/ets2panda/linter/test/main/arkui-select.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/main/arkui-select.ets.arkts2.json b/ets2panda/linter/test/main/arkui-select.ets.arkts2.json new file mode 100644 index 0000000000..29b9095e7e --- /dev/null +++ b/ets2panda/linter/test/main/arkui-select.ets.arkts2.json @@ -0,0 +1,288 @@ +{ + "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": 31, + "column": 18, + "endLine": 31, + "endColumn": 35, + "problem": "StructuralIdentity", + "suggest": "", + "rule": "Structural typing is not supported (arkts-no-structural-typing)", + "severity": "ERROR" + }, + { + "line": 16, + "column": 3, + "endLine": 16, + "endColumn": 12, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Component\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 6, + "endLine": 19, + "endColumn": 11, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"State\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 6, + "endLine": 21, + "endColumn": 13, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Consume\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 34, + "endLine": 21, + "endColumn": 42, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Resource\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 6, + "endLine": 23, + "endColumn": 13, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Consume\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 27, + "column": 7, + "endLine": 27, + "endColumn": 13, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Column\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 32, + "endLine": 29, + "endColumn": 40, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"$rawfile\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 9, + "endLine": 30, + "endColumn": 12, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Row\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 11, + "endLine": 31, + "endColumn": 17, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Select\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 24, + "endLine": 34, + "endColumn": 26, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"$r\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 35, + "column": 27, + "endLine": 35, + "endColumn": 29, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"$r\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 36, + "column": 41, + "endLine": 36, + "endColumn": 43, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"$r\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 37, + "column": 33, + "endLine": 37, + "endColumn": 35, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"$r\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 44, + "column": 11, + "endLine": 44, + "endColumn": 17, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Circle\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 45, + "column": 28, + "endLine": 45, + "endColumn": 30, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"$r\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 45, + "column": 65, + "endLine": 45, + "endColumn": 67, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"$r\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 48, + "column": 26, + "endLine": 48, + "endColumn": 35, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"FlexAlign\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 50, + "column": 35, + "endLine": 50, + "endColumn": 41, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Margin\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 52, + "column": 9, + "endLine": 52, + "endColumn": 13, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Text\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 52, + "column": 14, + "endLine": 52, + "endColumn": 16, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"$r\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 53, + "column": 22, + "endLine": 53, + "endColumn": 24, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"$r\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 54, + "column": 21, + "endLine": 54, + "endColumn": 23, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"$r\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 56, + "column": 22, + "endLine": 56, + "endColumn": 31, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"TextAlign\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 59, + "column": 25, + "endLine": 59, + "endColumn": 27, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"$r\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 59, + "column": 66, + "endLine": 59, + "endColumn": 71, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"Color\" should be imported before it is used (arkui-modular-interface)", + "severity": "ERROR" + }, + { + "line": 59, + "column": 84, + "endLine": 59, + "endColumn": 86, + "problem": "UIInterfaceImport", + "suggest": "", + "rule": "The ArkUI interface \"$r\" 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/call_expression_matching_argument.ets.args.json b/ets2panda/linter/test/main/arkui-select.ets.json similarity index 94% rename from ets2panda/linter/test/main/call_expression_matching_argument.ets.args.json rename to ets2panda/linter/test/main/arkui-select.ets.json index bc4d2071da..ca88f857e9 100644 --- a/ets2panda/linter/test/main/call_expression_matching_argument.ets.args.json +++ b/ets2panda/linter/test/main/arkui-select.ets.json @@ -13,7 +13,5 @@ "See the License for the specific language governing permissions and", "limitations under the License." ], - "mode": { - "arkts2": "" - } -} + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/main/call_expression_matching_argument.ets b/ets2panda/linter/test/main/call_expression_matching_argument.ets deleted file mode 100644 index 08c34d7682..0000000000 --- a/ets2panda/linter/test/main/call_expression_matching_argument.ets +++ /dev/null @@ -1,70 +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. - */ - -interface A { - value: string; -} - -interface Outer { - inner: A -} - -interface No { - inner: string -} - -class Test { - sv1: number = 1 - sv2: string = "some Value"; - sv3: boolean = true; - sv4: A = { value: "something" } - sv5: Outer = { inner: sv4 } - sv6: No = { inner: sv2 } - sv7: Array = [sv2, sv2, sv2]; - - someMethod() { - func(this.sv2) //error - func(this.sv4) //valid - func(this.sv6.inner) // error - func(this.sv5.inner) //valid - func2(this.sv2) //valid - func2(this.sv4) //valid - func3(this.sv2) //valid - func4(this.sv2, this.sv1) //valid - func5(this.sv7) //valid - } -} - - -function func(param: A) { - console.log(A); -} - -function func2(param: A | any) { - console.log(param); -} - -function func3(param: string | Promise) { - console.log(param); -} - -function func4(param: string, param2: any[]) { - console.log(param, ...param2); -} - -function func5(param: Array) { - param.forEach(elem => console.log(elem)) -} - diff --git a/ets2panda/linter/test/main/call_expression_matching_argument.ets.arkts2.json b/ets2panda/linter/test/main/call_expression_matching_argument.ets.arkts2.json deleted file mode 100644 index 00147aa392..0000000000 --- a/ets2panda/linter/test/main/call_expression_matching_argument.ets.arkts2.json +++ /dev/null @@ -1,58 +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": 38, - "column": 14, - "endLine": 38, - "endColumn": 22, - "problem": "StructuralIdentity", - "suggest": "", - "rule": "Structural typing is not supported (arkts-no-structural-typing)", - "severity": "ERROR" - }, - { - "line": 40, - "column": 14, - "endLine": 40, - "endColumn": 28, - "problem": "StructuralIdentity", - "suggest": "", - "rule": "Structural typing is not supported (arkts-no-structural-typing)", - "severity": "ERROR" - }, - { - "line": 55, - "column": 27, - "endLine": 55, - "endColumn": 30, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 63, - "column": 39, - "endLine": 63, - "endColumn": 42, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - } - ] -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/call_expression_matching_argument.ets.json b/ets2panda/linter/test/main/call_expression_matching_argument.ets.json deleted file mode 100644 index f864fd1cc3..0000000000 --- a/ets2panda/linter/test/main/call_expression_matching_argument.ets.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": 55, - "column": 27, - "endLine": 55, - "endColumn": 30, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 63, - "column": 39, - "endLine": 63, - "endColumn": 42, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - } - ] -} \ No newline at end of file -- Gitee