From 62b96aaa47bf35d878044fd212edeae0e2bf6f78 Mon Sep 17 00:00:00 2001 From: sefayilmazunal Date: Thu, 29 May 2025 15:32:45 +0300 Subject: [PATCH] js interop array in for of loop rule added Description: rule & autofix added for js interop array usage in for-of loops Issue: #ICBIFH Signed-off-by: sefayilmazunal --- ets2panda/linter/src/lib/TypeScriptLinter.ts | 38 +- .../linter/src/lib/autofixes/Autofixer.ts | 153 +- ets2panda/linter/src/lib/utils/TsUtils.ts | 2 +- .../linter/src/lib/utils/consts/InteropAPI.ts | 1 + .../test/interop/interop_import_js_rules.ets | 11 + .../interop_import_js_rules.ets.arkts2.json | 1272 +++++----- .../interop_import_js_rules.ets.autofix.json | 2207 +++++++++-------- 7 files changed, 1944 insertions(+), 1740 deletions(-) diff --git a/ets2panda/linter/src/lib/TypeScriptLinter.ts b/ets2panda/linter/src/lib/TypeScriptLinter.ts index ce3a05264e..bc06ce8657 100644 --- a/ets2panda/linter/src/lib/TypeScriptLinter.ts +++ b/ets2panda/linter/src/lib/TypeScriptLinter.ts @@ -1168,6 +1168,7 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { const tsForOfStmt = node as ts.ForOfStatement; const tsForOfInit = tsForOfStmt.initializer; this.checkForLoopDestructuring(tsForOfInit); + this.handleForOfJsArray(tsForOfStmt); } private handleIfStatement(ifStatement: ts.IfStatement): void { @@ -1424,14 +1425,16 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { } return current; - } + }; const firstObjNode = getFirstObjectNode(propertyAccessNode); const isFromJs = this.tsUtils.isJsImport(firstObjNode); - if(isFromJs) { - if (ts.isBinaryExpression(propertyAccessNode.parent) && - propertyAccessNode.parent.operatorToken.kind === ts.SyntaxKind.EqualsToken) { + if (isFromJs) { + if ( + ts.isBinaryExpression(propertyAccessNode.parent) && + propertyAccessNode.parent.operatorToken.kind === ts.SyntaxKind.EqualsToken + ) { const autofix = this.autofixer?.fixInteropBinaryExpression(propertyAccessNode.parent); this.incrementCounters(propertyAccessNode.parent, FaultID.InteropObjectProperty, autofix); } else { @@ -8002,10 +8005,7 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { return; } - const autofix = this.autofixer?.createReplacementJsImportElementAccessExpression( - elementAccessExpr, - elementAccessExpr.expression as ts.Identifier - ); + const autofix = this.autofixer?.fixJsImportElementAccessExpression(elementAccessExpr); this.incrementCounters(elementAccessExpr, FaultID.InteropJsObjectTraverseJsInstance, autofix); } @@ -8070,6 +8070,25 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { ); } + private handleForOfJsArray(node: ts.ForOfStatement): void { + if (!this.options.arkts2 || !this.useStatic) { + return; + } + + const expr = node.expression; + if (!ts.isIdentifier(expr) || !this.tsUtils.isPossiblyImportedFromJS(expr)) { + return; + } + + const exprType = this.tsTypeChecker.getTypeAtLocation(expr); + + if (!this.tsUtils.isArray(exprType)) { + return; + } + + this.incrementCounters(node, FaultID.InteropJsObjectTraverseJsInstance); + } + private checkStdLibConcurrencyImport(importDeclaration: ts.ImportDeclaration): void { if (!this.options.arkts2) { return; @@ -8983,7 +9002,8 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { return (type.flags & ts.TypeFlags.Number) !== 0 || (type.flags & ts.TypeFlags.NumberLiteral) !== 0; }; - const isBigIntAndNumberOperand = isNumber(leftType) && isBigInt(rightType) || isBigInt(leftType) && isNumber(rightType); + const isBigIntAndNumberOperand = + isNumber(leftType) && isBigInt(rightType) || isBigInt(leftType) && isNumber(rightType); if (isBigIntAndNumberOperand) { this.incrementCounters(node, FaultID.NumericBigintCompare); } diff --git a/ets2panda/linter/src/lib/autofixes/Autofixer.ts b/ets2panda/linter/src/lib/autofixes/Autofixer.ts index 564ebc117d..aebea22c8c 100644 --- a/ets2panda/linter/src/lib/autofixes/Autofixer.ts +++ b/ets2panda/linter/src/lib/autofixes/Autofixer.ts @@ -54,7 +54,8 @@ import { INSTANTIATE, TO_NUMBER, INVOKE, - INVOKE_METHOD + INVOKE_METHOD, + LENGTH } from '../utils/consts/InteropAPI'; import { ESLIB_SHAREDARRAYBUFFER } from '../utils/consts/ConcurrentAPI'; @@ -3627,24 +3628,87 @@ export class Autofixer { return [{ replacementText: replacement, start, end }]; } - createReplacementJsImportElementAccessExpression( - elementAccessExpr: ts.ElementAccessExpression, - identifier: ts.Identifier - ): Autofix[] { - const isParentBinaryExp = ts.isBinaryExpression(elementAccessExpr.parent); - const exprText = elementAccessExpr.argumentExpression.getText(); - const start = isParentBinaryExp ? elementAccessExpr.parent.getStart() : elementAccessExpr.getStart(); - const end = isParentBinaryExp ? elementAccessExpr.parent.getEnd() : elementAccessExpr.getEnd(); - - const replacementText = - isParentBinaryExp && elementAccessExpr.parent.operatorToken.kind === ts.SyntaxKind.EqualsToken ? - `${identifier.text}.setPropertyByIndex(${exprText},` + - ` ESValue.wrap(${elementAccessExpr.parent.right.getText()}))` : - `${identifier.text}.getPropertyByIndex(${exprText})` + - this.utils.findTypeOfNodeForConversion(elementAccessExpr); + /** + * Converts a JS element access (e.g. `arr[index]`) into the corresponding + * interop call: + * - On assignment (`arr[index] = value`), emits `arr.setPropertyByIndex(index, ESValue.wrap(value))` + * - On read, emits `arr.getPropertyByIndex(index)` plus any type conversion suffix + * + * @param elementAccessExpr The original `ElementAccessExpression` node. + * @returns An array with a single `Autofix` describing the replacement range and text. + */ + fixJsImportElementAccessExpression(elementAccessExpr: ts.ElementAccessExpression): Autofix[] { + const parent = elementAccessExpr.parent; + + const isAssignment = + parent !== undefined && ts.isBinaryExpression(parent) && parent.operatorToken.kind === ts.SyntaxKind.EqualsToken; + + // array identifier (e.g. "arr") + const identifierNode = elementAccessExpr.expression as ts.Identifier; + + let replacementText: string; + if (isAssignment) { + // arr.setPropertyByIndex(index, ESValue.wrap(value)) + const wrapped = ts.factory.createCallExpression( + ts.factory.createPropertyAccessExpression( + ts.factory.createIdentifier(ES_VALUE), + ts.factory.createIdentifier(WRAP) + ), + undefined, + [parent.right] + ); + + const callExpr = ts.factory.createCallExpression( + ts.factory.createPropertyAccessExpression(identifierNode, ts.factory.createIdentifier(SET_PROPERTY_BY_INDEX)), + undefined, + [elementAccessExpr.argumentExpression, wrapped] + ); + + replacementText = this.printer.printNode(ts.EmitHint.Unspecified, callExpr, elementAccessExpr.getSourceFile()); + } else { + // arr.getPropertyByIndex(index) plus conversion + const callExpr = ts.factory.createCallExpression( + ts.factory.createPropertyAccessExpression(identifierNode, ts.factory.createIdentifier(GET_PROPERTY_BY_INDEX)), + undefined, + [elementAccessExpr.argumentExpression] + ); + + replacementText = + this.printer.printNode(ts.EmitHint.Unspecified, callExpr, elementAccessExpr.getSourceFile()) + + this.utils.findTypeOfNodeForConversion(elementAccessExpr); + } + + const start = isAssignment ? (parent as ts.Node).getStart() : elementAccessExpr.getStart(); + const end = isAssignment ? (parent as ts.Node).getEnd() : elementAccessExpr.getEnd(); + return [{ replacementText, start, end }]; } + /** + * Replace each loop‐variable reference (e.g. `element`) with + * `array.getPropertyByIndex(i)` plus appropriate conversion. + * + * @param identifier The Identifier node of the loop variable usage. + * @param arrayName The name of the array being iterated. + */ + fixInteropArrayElementUsage(identifier: ts.Identifier, arrayName: string): Autofix { + // arr.getPropertyByIndex(i) + const callExpr = ts.factory.createCallExpression( + ts.factory.createPropertyAccessExpression( + ts.factory.createIdentifier(arrayName), + ts.factory.createIdentifier(GET_PROPERTY_BY_INDEX) + ), + undefined, + [ts.factory.createIdentifier('i')] + ); + + // Print and append proper conversion suffix + const printed = this.printer.printNode(ts.EmitHint.Unspecified, callExpr, identifier.getSourceFile()); + const replacementText = printed + this.utils.findTypeOfNodeForConversion(identifier); + + return { replacementText, start: identifier.getStart(), end: identifier.getEnd() }; + } + fixSharedArrayBufferConstructor(node: ts.NewExpression): Autofix[] | undefined { void this; @@ -3671,6 +3735,63 @@ export class Autofixer { return [{ replacementText, start: node.getStart(), end: node.getEnd() }]; } + /** + * Converts a `for...of` over an interop array into + * an index-based `for` loop using `getPropertyByName("length")`. + * + * @param node The `ForOfStatement` node to fix. + * @returns A single Autofix for the loop header replacement. + */ + fixInteropArrayForOf(node: ts.ForOfStatement): Autofix { + const iterableName = node.expression.getText(); + + const initializer = ts.factory.createVariableDeclarationList( + [ + ts.factory.createVariableDeclaration( + ts.factory.createIdentifier('i'), + undefined, + undefined, + ts.factory.createNumericLiteral('0') + ) + ], + ts.NodeFlags.Let + ); + + const lengthAccess = ts.factory.createCallExpression( + ts.factory.createPropertyAccessExpression( + ts.factory.createIdentifier(iterableName), + ts.factory.createIdentifier(GET_PROPERTY_BY_NAME) + ), + undefined, + [ts.factory.createStringLiteral(LENGTH)] + ); + const condition = ts.factory.createBinaryExpression( + ts.factory.createIdentifier('i'), + ts.SyntaxKind.LessThanToken, + lengthAccess + ); + + const incrementor = ts.factory.createPrefixUnaryExpression( + ts.SyntaxKind.PlusPlusToken, + ts.factory.createIdentifier('i') + ); + + // Render just the "(initializer; condition; incrementor)" text: + const headerText = [ + this.printer.printNode(ts.EmitHint.Unspecified, initializer, node.getSourceFile()), + '; ', + this.printer.printNode(ts.EmitHint.Unspecified, condition, node.getSourceFile()), + '; ', + this.printer.printNode(ts.EmitHint.Unspecified, incrementor, node.getSourceFile()) + ].join(''); + + // Only replace from the start of the initializer to the end of the 'of' expression + const start = node.initializer.getStart(); + const end = node.expression.getEnd(); + + return { start, end, replacementText: headerText }; + } + fixAppStorageCallExpression(callExpr: ts.CallExpression): Autofix[] | undefined { const varDecl = Autofixer.findParentVariableDeclaration(callExpr); if (!varDecl || varDecl.type) { diff --git a/ets2panda/linter/src/lib/utils/TsUtils.ts b/ets2panda/linter/src/lib/utils/TsUtils.ts index 2327bf026c..00466a8740 100644 --- a/ets2panda/linter/src/lib/utils/TsUtils.ts +++ b/ets2panda/linter/src/lib/utils/TsUtils.ts @@ -3654,7 +3654,7 @@ export class TsUtils { ) { return false; } - + return true; } current = current.parent; diff --git a/ets2panda/linter/src/lib/utils/consts/InteropAPI.ts b/ets2panda/linter/src/lib/utils/consts/InteropAPI.ts index c3566b66db..587e833145 100644 --- a/ets2panda/linter/src/lib/utils/consts/InteropAPI.ts +++ b/ets2panda/linter/src/lib/utils/consts/InteropAPI.ts @@ -18,6 +18,7 @@ export const ARE_EQUAL = 'areEqual'; export const ARE_STRICTLY_EQUAL = 'areStrictlyEqual'; export const WRAP = 'wrap'; export const INSTANTIATE = 'instantiate'; +export const LENGTH = 'length'; export const INVOKE = 'invoke'; export const INVOKE_METHOD = 'invokeMethod'; diff --git a/ets2panda/linter/test/interop/interop_import_js_rules.ets b/ets2panda/linter/test/interop/interop_import_js_rules.ets index d7e3b52fca..d4c110abcf 100644 --- a/ets2panda/linter/test/interop/interop_import_js_rules.ets +++ b/ets2panda/linter/test/interop/interop_import_js_rules.ets @@ -28,6 +28,7 @@ import { handle } from "./interop_import_js_rules_js" import { expand } from "./interop_import_js_rules_js" import { orange } from "./interop_import_js_rules_js" + if (foo.isGood) {} if (ff1.f1 > 18) { @@ -65,17 +66,27 @@ handle(lambda) class X{a = 1; b= 2; c= 3} expand(new X()) // ERROR expand-static + class Y { str: string = 'str'; bool: boolean = false; } + let testY: Y = { str: "hello", bool: false, } + expand(testY); expand({x: '1', y: "hello", z: false}); + let flag = false; if (orange.isVegetable1 === 123) { flag = true } + +for (let element of arr) { + if (element == 8) { + console.log("hi"); + } +} diff --git a/ets2panda/linter/test/interop/interop_import_js_rules.ets.arkts2.json b/ets2panda/linter/test/interop/interop_import_js_rules.ets.arkts2.json index 299b2732c8..0739cafac6 100644 --- a/ets2panda/linter/test/interop/interop_import_js_rules.ets.arkts2.json +++ b/ets2panda/linter/test/interop/interop_import_js_rules.ets.arkts2.json @@ -1,628 +1,648 @@ { - "copyright": [ - "Copyright (c) 2025 Huawei Device Co., Ltd.", - "Licensed under the Apache License, Version 2.0 (the 'License');", - "you may not use this file except in compliance with the License.", - "You may obtain a copy of the License at", - "", - "http://www.apache.org/licenses/LICENSE-2.0", - "", - "Unless required by applicable law or agreed to in writing, software", - "distributed under the License is distributed on an 'AS IS' BASIS,", - "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", - "See the License for the specific language governing permissions and", - "limitations under the License." - ], - "result": [ - { - "line": 17, - "column": 1, - "endLine": 17, - "endColumn": 51, - "problem": "ImportAfterStatement", - "suggest": "", - "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", - "severity": "ERROR" - }, - { - "line": 17, - "column": 1, - "endLine": 17, - "endColumn": 51, - "problem": "InterOpImportJs", - "suggest": "", - "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", - "severity": "ERROR" - }, - { - "line": 18, - "column": 1, - "endLine": 18, - "endColumn": 56, - "problem": "ImportAfterStatement", - "suggest": "", - "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", - "severity": "ERROR" - }, - { - "line": 18, - "column": 1, - "endLine": 18, - "endColumn": 56, - "problem": "InterOpImportJs", - "suggest": "", - "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", - "severity": "ERROR" - }, - { - "line": 20, - "column": 1, - "endLine": 20, - "endColumn": 49, - "problem": "ImportAfterStatement", - "suggest": "", - "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", - "severity": "ERROR" - }, - { - "line": 20, - "column": 1, - "endLine": 20, - "endColumn": 49, - "problem": "InterOpImportJs", - "suggest": "", - "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", - "severity": "ERROR" - }, - { - "line": 21, - "column": 1, - "endLine": 21, - "endColumn": 49, - "problem": "ImportAfterStatement", - "suggest": "", - "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", - "severity": "ERROR" - }, - { - "line": 21, - "column": 1, - "endLine": 21, - "endColumn": 49, - "problem": "InterOpImportJs", - "suggest": "", - "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", - "severity": "ERROR" - }, - { - "line": 23, - "column": 1, - "endLine": 23, - "endColumn": 51, - "problem": "ImportAfterStatement", - "suggest": "", - "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", - "severity": "ERROR" - }, - { - "line": 23, - "column": 1, - "endLine": 23, - "endColumn": 51, - "problem": "InterOpImportJs", - "suggest": "", - "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", - "severity": "ERROR" - }, - { - "line": 25, - "column": 1, - "endLine": 25, - "endColumn": 51, - "problem": "ImportAfterStatement", - "suggest": "", - "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", - "severity": "ERROR" - }, - { - "line": 25, - "column": 1, - "endLine": 25, - "endColumn": 51, - "problem": "InterOpImportJs", - "suggest": "", - "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", - "severity": "ERROR" - }, - { - "line": 27, - "column": 1, - "endLine": 27, - "endColumn": 54, - "problem": "ImportAfterStatement", - "suggest": "", - "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", - "severity": "ERROR" - }, - { - "line": 27, - "column": 1, - "endLine": 27, - "endColumn": 54, - "problem": "InterOpImportJs", - "suggest": "", - "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", - "severity": "ERROR" - }, - { - "line": 29, - "column": 1, - "endLine": 29, - "endColumn": 54, - "problem": "ImportAfterStatement", - "suggest": "", - "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", - "severity": "ERROR" - }, - { - "line": 29, - "column": 1, - "endLine": 29, - "endColumn": 54, - "problem": "InterOpImportJs", - "suggest": "", - "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", - "severity": "ERROR" - }, - { - "line": 30, - "column": 1, - "endLine": 30, - "endColumn": 54, - "problem": "ImportAfterStatement", - "suggest": "", - "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", - "severity": "ERROR" - }, - { - "line": 30, - "column": 1, - "endLine": 30, - "endColumn": 54, - "problem": "InterOpImportJs", - "suggest": "", - "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", - "severity": "ERROR" - }, - { - "line": 31, - "column": 5, - "endLine": 31, - "endColumn": 15, - "problem": "InteropObjectProperty", - "suggest": "", - "rule": "Properties of interop objects can't be accessed directly (arkts-interop-js2s-access-js-prop)", - "severity": "ERROR" - }, - { - "line": 31, - "column": 5, - "endLine": 31, - "endColumn": 15, - "problem": "InteropJsObjectConditionJudgment", - "suggest": "", - "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js2s-condition-judgment)", - "severity": "ERROR" - }, - { - "line": 33, - "column": 5, - "endLine": 33, - "endColumn": 11, - "problem": "InterOpImportJsDataCompare", - "suggest": "", - "rule": "Importing data directly from the \"JS\" module for comparison is not supported (arkts-interop-js2s-compare-js-data)", - "severity": "ERROR" - }, - { - "line": 33, - "column": 5, - "endLine": 33, - "endColumn": 11, - "problem": "InteropObjectProperty", - "suggest": "", - "rule": "Properties of interop objects can't be accessed directly (arkts-interop-js2s-access-js-prop)", - "severity": "ERROR" - }, - { - "line": 33, - "column": 5, - "endLine": 33, - "endColumn": 11, - "problem": "InteropJsObjectConditionJudgment", - "suggest": "", - "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js2s-condition-judgment)", - "severity": "ERROR" - }, - { - "line": 33, - "column": 14, - "endLine": 33, - "endColumn": 16, - "problem": "NumericSemantics", - "suggest": "", - "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", - "severity": "ERROR" - }, - { - "line": 37, - "column": 1, - "endLine": 37, - "endColumn": 21, - "problem": "InteropJsObjectInheritance", - "suggest": "", - "rule": "Direct inheritance of interop JS classes is not supported (arkts-interop-js2s-inherit-js-class)", - "severity": "ERROR" - }, - { - "line": 41, - "column": 1, - "endLine": 41, - "endColumn": 21, - "problem": "InteropJsObjectInheritance", - "suggest": "", - "rule": "Direct inheritance of interop JS classes is not supported (arkts-interop-js2s-inherit-js-class)", - "severity": "ERROR" - }, - { - "line": 44, - "column": 3, - "endLine": 44, - "endColumn": 8, - "problem": "InteropJSFunctionInvoke", - "suggest": "", - "rule": "Trying to catch JS errors is not permitted (arkts-interop-js2s-js-exception)", - "severity": "ERROR" - }, - { - "line": 44, - "column": 3, - "endLine": 44, - "endColumn": 8, - "problem": "CallJSFunction", - "suggest": "", - "rule": "ArkTS directly call JS functions or parameters is not supported (arkts-interop-js2s-call-js-func)", - "severity": "ERROR" - }, - { - "line": 45, - "column": 3, - "endLine": 47, - "endColumn": 2, - "problem": "TsLikeCatchType", - "suggest": "", - "rule": "TS catch type are not supported (arkts-no-ts-like-catch-type)", - "severity": "ERROR" - }, - { - "line": 49, - "column": 11, - "endLine": 49, - "endColumn": 18, - "problem": "InteropObjectProperty", - "suggest": "", - "rule": "Properties of interop objects can't be accessed directly (arkts-interop-js2s-access-js-prop)", - "severity": "ERROR" - }, - { - "line": 49, - "column": 11, - "endLine": 49, - "endColumn": 18, - "problem": "InteropJsObjectUsage", - "suggest": "", - "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js-object-usage)", - "severity": "ERROR" - }, - { - "line": 50, - "column": 11, - "endLine": 50, - "endColumn": 21, - "problem": "InteropJsObjectUsage", - "suggest": "", - "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js-object-usage)", - "severity": "ERROR" - }, - { - "line": 53, - "column": 3, - "endLine": 53, - "endColumn": 9, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, - { - "line": 51, - "column": 10, - "endLine": 51, - "endColumn": 15, - "problem": "NumericSemantics", - "suggest": "", - "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", - "severity": "ERROR" - }, - { - "line": 51, - "column": 14, - "endLine": 51, - "endColumn": 15, - "problem": "NumericSemantics", - "suggest": "", - "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", - "severity": "ERROR" - }, - { - "line": 52, - "column": 11, - "endLine": 52, - "endColumn": 17, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, - { - "line": 52, - "column": 11, - "endLine": 52, - "endColumn": 17, - "problem": "InteropJsObjectTraverseJsInstance", - "suggest": "", - "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js2s-traverse-js-instance)", - "severity": "ERROR" - }, - { - "line": 52, - "column": 11, - "endLine": 52, - "endColumn": 17, - "problem": "InterOpImportJsIndex", - "suggest": "", - "rule": "Interop objects can't be indexed directly (arkts-interop-js2s-access-js-index)", - "severity": "ERROR" - }, - { - "line": 53, - "column": 3, - "endLine": 53, - "endColumn": 9, - "problem": "InteropJsObjectTraverseJsInstance", - "suggest": "", - "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js2s-traverse-js-instance)", - "severity": "ERROR" - }, - { - "line": 53, - "column": 3, - "endLine": 53, - "endColumn": 13, - "problem": "InterOpImportJsIndex", - "suggest": "", - "rule": "Interop objects can't be indexed directly (arkts-interop-js2s-access-js-index)", - "severity": "ERROR" - }, - { - "line": 53, - "column": 12, - "endLine": 53, - "endColumn": 13, - "problem": "NumericSemantics", - "suggest": "", - "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", - "severity": "ERROR" - }, - { - "line": 63, - "column": 8, - "endLine": 63, - "endColumn": 12, - "problem": "InteropJsObjectCallStaticFunc", - "suggest": "", - "rule": "Direct usage of interop JS functions is not supported (arkts-interop-js2s-js-call-static-function)", - "severity": "ERROR" - }, - { - "line": 63, - "column": 1, - "endLine": 63, - "endColumn": 13, - "problem": "CallJSFunction", - "suggest": "", - "rule": "ArkTS directly call JS functions or parameters is not supported (arkts-interop-js2s-call-js-func)", - "severity": "ERROR" - }, - { - "line": 64, - "column": 8, - "endLine": 64, - "endColumn": 14, - "problem": "InteropJsObjectCallStaticFunc", - "suggest": "", - "rule": "Direct usage of interop JS functions is not supported (arkts-interop-js2s-js-call-static-function)", - "severity": "ERROR" - }, - { - "line": 64, - "column": 1, - "endLine": 64, - "endColumn": 15, - "problem": "CallJSFunction", - "suggest": "", - "rule": "ArkTS directly call JS functions or parameters is not supported (arkts-interop-js2s-call-js-func)", - "severity": "ERROR" - }, - { - "line": 66, - "column": 9, - "endLine": 66, - "endColumn": 15, - "problem": "NumericSemantics", - "suggest": "", - "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", - "severity": "ERROR" - }, - { - "line": 66, - "column": 13, - "endLine": 66, - "endColumn": 14, - "problem": "NumericSemantics", - "suggest": "", - "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", - "severity": "ERROR" - }, - { - "line": 66, - "column": 16, - "endLine": 66, - "endColumn": 21, - "problem": "NumericSemantics", - "suggest": "", - "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", - "severity": "ERROR" - }, - { - "line": 66, - "column": 19, - "endLine": 66, - "endColumn": 20, - "problem": "NumericSemantics", - "suggest": "", - "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", - "severity": "ERROR" - }, - { - "line": 66, - "column": 22, - "endLine": 66, - "endColumn": 26, - "problem": "NumericSemantics", - "suggest": "", - "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", - "severity": "ERROR" - }, - { - "line": 66, - "column": 25, - "endLine": 66, - "endColumn": 26, - "problem": "NumericSemantics", - "suggest": "", - "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", - "severity": "ERROR" - }, - { - "line": 67, - "column": 8, - "endLine": 67, - "endColumn": 15, - "problem": "InteropJsObjectExpandStaticInstance", - "suggest": "", - "rule": "Direct usage of interop JS functions is not supported (arkts-interop-js2s-js-expand-static-instance)", - "severity": "ERROR" - }, - { - "line": 67, - "column": 1, - "endLine": 67, - "endColumn": 16, - "problem": "CallJSFunction", - "suggest": "", - "rule": "ArkTS directly call JS functions or parameters is not supported (arkts-interop-js2s-call-js-func)", - "severity": "ERROR" - }, - { - "line": 76, - "column": 8, - "endLine": 76, - "endColumn": 13, - "problem": "InteropJsObjectExpandStaticInstance", - "suggest": "", - "rule": "Direct usage of interop JS functions is not supported (arkts-interop-js2s-js-expand-static-instance)", - "severity": "ERROR" - }, - { - "line": 76, - "column": 1, - "endLine": 76, - "endColumn": 14, - "problem": "CallJSFunction", - "suggest": "", - "rule": "ArkTS directly call JS functions or parameters is not supported (arkts-interop-js2s-call-js-func)", - "severity": "ERROR" - }, - { - "line": 77, - "column": 8, - "endLine": 77, - "endColumn": 38, - "problem": "InteropJsObjectExpandStaticInstance", - "suggest": "", - "rule": "Direct usage of interop JS functions is not supported (arkts-interop-js2s-js-expand-static-instance)", - "severity": "ERROR" - }, - { - "line": 77, - "column": 1, - "endLine": 77, - "endColumn": 39, - "problem": "CallJSFunction", - "suggest": "", - "rule": "ArkTS directly call JS functions or parameters is not supported (arkts-interop-js2s-call-js-func)", - "severity": "ERROR" - }, - { - "line": 79, - "column": 5, - "endLine": 79, - "endColumn": 32, - "problem": "InteropEqualityJudgment", - "suggest": "", - "rule": "\"JS\" objects can't be used directly as operands of the equality operators (arkts-interop-js2s-equality-judgment)", - "severity": "ERROR" - }, - { - "line": 79, - "column": 5, - "endLine": 79, - "endColumn": 24, - "problem": "InteropObjectProperty", - "suggest": "", - "rule": "Properties of interop objects can't be accessed directly (arkts-interop-js2s-access-js-prop)", - "severity": "ERROR" - }, - { - "line": 79, - "column": 5, - "endLine": 79, - "endColumn": 24, - "problem": "InteropJsObjectUsage", - "suggest": "", - "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js-object-usage)", - "severity": "ERROR" - }, - { - "line": 79, - "column": 29, - "endLine": 79, - "endColumn": 32, - "problem": "NumericSemantics", - "suggest": "", - "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", - "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": 17, + "column": 1, + "endLine": 17, + "endColumn": 51, + "problem": "ImportAfterStatement", + "suggest": "", + "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 1, + "endLine": 17, + "endColumn": 51, + "problem": "InterOpImportJs", + "suggest": "", + "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 1, + "endLine": 18, + "endColumn": 56, + "problem": "ImportAfterStatement", + "suggest": "", + "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 1, + "endLine": 18, + "endColumn": 56, + "problem": "InterOpImportJs", + "suggest": "", + "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 1, + "endLine": 20, + "endColumn": 49, + "problem": "ImportAfterStatement", + "suggest": "", + "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 1, + "endLine": 20, + "endColumn": 49, + "problem": "InterOpImportJs", + "suggest": "", + "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 1, + "endLine": 21, + "endColumn": 49, + "problem": "ImportAfterStatement", + "suggest": "", + "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 1, + "endLine": 21, + "endColumn": 49, + "problem": "InterOpImportJs", + "suggest": "", + "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 1, + "endLine": 23, + "endColumn": 51, + "problem": "ImportAfterStatement", + "suggest": "", + "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 1, + "endLine": 23, + "endColumn": 51, + "problem": "InterOpImportJs", + "suggest": "", + "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 1, + "endLine": 25, + "endColumn": 51, + "problem": "ImportAfterStatement", + "suggest": "", + "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 1, + "endLine": 25, + "endColumn": 51, + "problem": "InterOpImportJs", + "suggest": "", + "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", + "severity": "ERROR" + }, + { + "line": 27, + "column": 1, + "endLine": 27, + "endColumn": 54, + "problem": "ImportAfterStatement", + "suggest": "", + "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", + "severity": "ERROR" + }, + { + "line": 27, + "column": 1, + "endLine": 27, + "endColumn": 54, + "problem": "InterOpImportJs", + "suggest": "", + "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 1, + "endLine": 29, + "endColumn": 54, + "problem": "ImportAfterStatement", + "suggest": "", + "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 1, + "endLine": 29, + "endColumn": 54, + "problem": "InterOpImportJs", + "suggest": "", + "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 1, + "endLine": 30, + "endColumn": 54, + "problem": "ImportAfterStatement", + "suggest": "", + "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 1, + "endLine": 30, + "endColumn": 54, + "problem": "InterOpImportJs", + "suggest": "", + "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 5, + "endLine": 32, + "endColumn": 15, + "problem": "InteropObjectProperty", + "suggest": "", + "rule": "Properties of interop objects can't be accessed directly (arkts-interop-js2s-access-js-prop)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 5, + "endLine": 32, + "endColumn": 15, + "problem": "InteropJsObjectConditionJudgment", + "suggest": "", + "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js2s-condition-judgment)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 5, + "endLine": 34, + "endColumn": 11, + "problem": "InterOpImportJsDataCompare", + "suggest": "", + "rule": "Importing data directly from the \"JS\" module for comparison is not supported (arkts-interop-js2s-compare-js-data)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 5, + "endLine": 34, + "endColumn": 11, + "problem": "InteropObjectProperty", + "suggest": "", + "rule": "Properties of interop objects can't be accessed directly (arkts-interop-js2s-access-js-prop)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 5, + "endLine": 34, + "endColumn": 11, + "problem": "InteropJsObjectConditionJudgment", + "suggest": "", + "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js2s-condition-judgment)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 14, + "endLine": 34, + "endColumn": 16, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 38, + "column": 1, + "endLine": 38, + "endColumn": 21, + "problem": "InteropJsObjectInheritance", + "suggest": "", + "rule": "Direct inheritance of interop JS classes is not supported (arkts-interop-js2s-inherit-js-class)", + "severity": "ERROR" + }, + { + "line": 42, + "column": 1, + "endLine": 42, + "endColumn": 21, + "problem": "InteropJsObjectInheritance", + "suggest": "", + "rule": "Direct inheritance of interop JS classes is not supported (arkts-interop-js2s-inherit-js-class)", + "severity": "ERROR" + }, + { + "line": 45, + "column": 3, + "endLine": 45, + "endColumn": 8, + "problem": "InteropJSFunctionInvoke", + "suggest": "", + "rule": "Trying to catch JS errors is not permitted (arkts-interop-js2s-js-exception)", + "severity": "ERROR" + }, + { + "line": 45, + "column": 3, + "endLine": 45, + "endColumn": 8, + "problem": "CallJSFunction", + "suggest": "", + "rule": "ArkTS directly call JS functions or parameters is not supported (arkts-interop-js2s-call-js-func)", + "severity": "ERROR" + }, + { + "line": 46, + "column": 3, + "endLine": 48, + "endColumn": 2, + "problem": "TsLikeCatchType", + "suggest": "", + "rule": "TS catch type are not supported (arkts-no-ts-like-catch-type)", + "severity": "ERROR" + }, + { + "line": 50, + "column": 11, + "endLine": 50, + "endColumn": 18, + "problem": "InteropObjectProperty", + "suggest": "", + "rule": "Properties of interop objects can't be accessed directly (arkts-interop-js2s-access-js-prop)", + "severity": "ERROR" + }, + { + "line": 50, + "column": 11, + "endLine": 50, + "endColumn": 18, + "problem": "InteropJsObjectUsage", + "suggest": "", + "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js-object-usage)", + "severity": "ERROR" + }, + { + "line": 51, + "column": 11, + "endLine": 51, + "endColumn": 21, + "problem": "InteropJsObjectUsage", + "suggest": "", + "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js-object-usage)", + "severity": "ERROR" + }, + { + "line": 54, + "column": 3, + "endLine": 54, + "endColumn": 9, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 52, + "column": 10, + "endLine": 52, + "endColumn": 15, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 52, + "column": 14, + "endLine": 52, + "endColumn": 15, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 53, + "column": 11, + "endLine": 53, + "endColumn": 17, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 53, + "column": 11, + "endLine": 53, + "endColumn": 17, + "problem": "InteropJsObjectTraverseJsInstance", + "suggest": "", + "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js2s-traverse-js-instance)", + "severity": "ERROR" + }, + { + "line": 53, + "column": 11, + "endLine": 53, + "endColumn": 17, + "problem": "InterOpImportJsIndex", + "suggest": "", + "rule": "Interop objects can't be indexed directly (arkts-interop-js2s-access-js-index)", + "severity": "ERROR" + }, + { + "line": 54, + "column": 3, + "endLine": 54, + "endColumn": 9, + "problem": "InteropJsObjectTraverseJsInstance", + "suggest": "", + "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js2s-traverse-js-instance)", + "severity": "ERROR" + }, + { + "line": 54, + "column": 3, + "endLine": 54, + "endColumn": 13, + "problem": "InterOpImportJsIndex", + "suggest": "", + "rule": "Interop objects can't be indexed directly (arkts-interop-js2s-access-js-index)", + "severity": "ERROR" + }, + { + "line": 54, + "column": 12, + "endLine": 54, + "endColumn": 13, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 64, + "column": 8, + "endLine": 64, + "endColumn": 12, + "problem": "InteropJsObjectCallStaticFunc", + "suggest": "", + "rule": "Direct usage of interop JS functions is not supported (arkts-interop-js2s-js-call-static-function)", + "severity": "ERROR" + }, + { + "line": 64, + "column": 1, + "endLine": 64, + "endColumn": 13, + "problem": "CallJSFunction", + "suggest": "", + "rule": "ArkTS directly call JS functions or parameters is not supported (arkts-interop-js2s-call-js-func)", + "severity": "ERROR" + }, + { + "line": 65, + "column": 8, + "endLine": 65, + "endColumn": 14, + "problem": "InteropJsObjectCallStaticFunc", + "suggest": "", + "rule": "Direct usage of interop JS functions is not supported (arkts-interop-js2s-js-call-static-function)", + "severity": "ERROR" + }, + { + "line": 65, + "column": 1, + "endLine": 65, + "endColumn": 15, + "problem": "CallJSFunction", + "suggest": "", + "rule": "ArkTS directly call JS functions or parameters is not supported (arkts-interop-js2s-call-js-func)", + "severity": "ERROR" + }, + { + "line": 67, + "column": 9, + "endLine": 67, + "endColumn": 15, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 67, + "column": 13, + "endLine": 67, + "endColumn": 14, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 67, + "column": 16, + "endLine": 67, + "endColumn": 21, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 67, + "column": 19, + "endLine": 67, + "endColumn": 20, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 67, + "column": 22, + "endLine": 67, + "endColumn": 26, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 67, + "column": 25, + "endLine": 67, + "endColumn": 26, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 68, + "column": 8, + "endLine": 68, + "endColumn": 15, + "problem": "InteropJsObjectExpandStaticInstance", + "suggest": "", + "rule": "Direct usage of interop JS functions is not supported (arkts-interop-js2s-js-expand-static-instance)", + "severity": "ERROR" + }, + { + "line": 68, + "column": 1, + "endLine": 68, + "endColumn": 16, + "problem": "CallJSFunction", + "suggest": "", + "rule": "ArkTS directly call JS functions or parameters is not supported (arkts-interop-js2s-call-js-func)", + "severity": "ERROR" + }, + { + "line": 80, + "column": 8, + "endLine": 80, + "endColumn": 13, + "problem": "InteropJsObjectExpandStaticInstance", + "suggest": "", + "rule": "Direct usage of interop JS functions is not supported (arkts-interop-js2s-js-expand-static-instance)", + "severity": "ERROR" + }, + { + "line": 80, + "column": 1, + "endLine": 80, + "endColumn": 14, + "problem": "CallJSFunction", + "suggest": "", + "rule": "ArkTS directly call JS functions or parameters is not supported (arkts-interop-js2s-call-js-func)", + "severity": "ERROR" + }, + { + "line": 81, + "column": 8, + "endLine": 81, + "endColumn": 38, + "problem": "InteropJsObjectExpandStaticInstance", + "suggest": "", + "rule": "Direct usage of interop JS functions is not supported (arkts-interop-js2s-js-expand-static-instance)", + "severity": "ERROR" + }, + { + "line": 81, + "column": 1, + "endLine": 81, + "endColumn": 39, + "problem": "CallJSFunction", + "suggest": "", + "rule": "ArkTS directly call JS functions or parameters is not supported (arkts-interop-js2s-call-js-func)", + "severity": "ERROR" + }, + { + "line": 84, + "column": 5, + "endLine": 84, + "endColumn": 32, + "problem": "InteropEqualityJudgment", + "suggest": "", + "rule": "\"JS\" objects can't be used directly as operands of the equality operators (arkts-interop-js2s-equality-judgment)", + "severity": "ERROR" + }, + { + "line": 84, + "column": 5, + "endLine": 84, + "endColumn": 24, + "problem": "InteropObjectProperty", + "suggest": "", + "rule": "Properties of interop objects can't be accessed directly (arkts-interop-js2s-access-js-prop)", + "severity": "ERROR" + }, + { + "line": 84, + "column": 5, + "endLine": 84, + "endColumn": 24, + "problem": "InteropJsObjectUsage", + "suggest": "", + "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js-object-usage)", + "severity": "ERROR" + }, + { + "line": 84, + "column": 29, + "endLine": 84, + "endColumn": 32, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 88, + "column": 1, + "endLine": 92, + "endColumn": 2, + "problem": "InteropJsObjectTraverseJsInstance", + "suggest": "", + "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js2s-traverse-js-instance)", + "severity": "ERROR" + }, + { + "line": 89, + "column": 18, + "endLine": 89, + "endColumn": 19, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + } + ] } diff --git a/ets2panda/linter/test/interop/interop_import_js_rules.ets.autofix.json b/ets2panda/linter/test/interop/interop_import_js_rules.ets.autofix.json index 4e7f1b6c7a..59c1887448 100644 --- a/ets2panda/linter/test/interop/interop_import_js_rules.ets.autofix.json +++ b/ets2panda/linter/test/interop/interop_import_js_rules.ets.autofix.json @@ -1,1149 +1,1180 @@ { - "copyright": [ - "Copyright (c) 2025 Huawei Device Co., Ltd.", - "Licensed under the Apache License, Version 2.0 (the 'License');", - "you may not use this file except in compliance with the License.", - "You may obtain a copy of the License at", - "", - "http://www.apache.org/licenses/LICENSE-2.0", - "", - "Unless required by applicable law or agreed to in writing, software", - "distributed under the License is distributed on an 'AS IS' BASIS,", - "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", - "See the License for the specific language governing permissions and", - "limitations under the License." - ], - "result": [ - { - "line": 17, - "column": 1, - "endLine": 17, - "endColumn": 51, - "problem": "ImportAfterStatement", - "suggest": "", - "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", - "severity": "ERROR" - }, - { - "line": 17, - "column": 1, - "endLine": 17, - "endColumn": 51, - "problem": "InterOpImportJs", - "autofix": [ + "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": [ { - "start": 619, - "end": 669, - "replacementText": "", - "line": 17, - "column": 1, - "endLine": 17, - "endColumn": 51 + "line": 17, + "column": 1, + "endLine": 17, + "endColumn": 51, + "problem": "ImportAfterStatement", + "suggest": "", + "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", + "severity": "ERROR" }, { - "start": 1092, - "end": 1092, - "replacementText": "let GeneratedImportVar_1 = ESValue.load('./interop_import_js_rules_js');\nlet foo = GeneratedImportVar_1.getPropertyByName('foo');\n", - "line": 17, - "column": 1, - "endLine": 17, - "endColumn": 51 - } - ], - "suggest": "", - "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", - "severity": "ERROR" - }, - { - "line": 18, - "column": 1, - "endLine": 18, - "endColumn": 56, - "problem": "ImportAfterStatement", - "suggest": "", - "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", - "severity": "ERROR" - }, - { - "line": 18, - "column": 1, - "endLine": 18, - "endColumn": 56, - "problem": "InterOpImportJs", - "autofix": [ + "line": 17, + "column": 1, + "endLine": 17, + "endColumn": 51, + "problem": "InterOpImportJs", + "autofix": [ + { + "start": 619, + "end": 669, + "replacementText": "", + "line": 17, + "column": 1, + "endLine": 17, + "endColumn": 51 + }, + { + "start": 1092, + "end": 1092, + "replacementText": "let GeneratedImportVar_1 = ESValue.load('./interop_import_js_rules_js');\nlet foo = GeneratedImportVar_1.getPropertyByName('foo');\n", + "line": 17, + "column": 1, + "endLine": 17, + "endColumn": 51 + } + ], + "suggest": "", + "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", + "severity": "ERROR" + }, { - "start": 670, - "end": 725, - "replacementText": "", - "line": 18, - "column": 1, - "endLine": 18, - "endColumn": 56 + "line": 18, + "column": 1, + "endLine": 18, + "endColumn": 56, + "problem": "ImportAfterStatement", + "suggest": "", + "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", + "severity": "ERROR" }, { - "start": 1092, - "end": 1092, - "replacementText": "let GeneratedImportVar_2 = ESValue.load('./interop_import_js_rules_js');\nlet ff1 = GeneratedImportVar_2.getPropertyByName('ff1');\nlet ff2 = GeneratedImportVar_2.getPropertyByName('ff2');\n", - "line": 18, - "column": 1, - "endLine": 18, - "endColumn": 56 - } - ], - "suggest": "", - "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", - "severity": "ERROR" - }, - { - "line": 20, - "column": 1, - "endLine": 20, - "endColumn": 49, - "problem": "ImportAfterStatement", - "suggest": "", - "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", - "severity": "ERROR" - }, - { - "line": 20, - "column": 1, - "endLine": 20, - "endColumn": 49, - "problem": "InterOpImportJs", - "autofix": [ + "line": 18, + "column": 1, + "endLine": 18, + "endColumn": 56, + "problem": "InterOpImportJs", + "autofix": [ + { + "start": 670, + "end": 725, + "replacementText": "", + "line": 18, + "column": 1, + "endLine": 18, + "endColumn": 56 + }, + { + "start": 1092, + "end": 1092, + "replacementText": "let GeneratedImportVar_2 = ESValue.load('./interop_import_js_rules_js');\nlet ff1 = GeneratedImportVar_2.getPropertyByName('ff1');\nlet ff2 = GeneratedImportVar_2.getPropertyByName('ff2');\n", + "line": 18, + "column": 1, + "endLine": 18, + "endColumn": 56 + } + ], + "suggest": "", + "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", + "severity": "ERROR" + }, { - "start": 727, - "end": 775, - "replacementText": "", - "line": 20, - "column": 1, - "endLine": 20, - "endColumn": 49 + "line": 20, + "column": 1, + "endLine": 20, + "endColumn": 49, + "problem": "ImportAfterStatement", + "suggest": "", + "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", + "severity": "ERROR" }, { - "start": 1092, - "end": 1092, - "replacementText": "let GeneratedImportVar_3 = ESValue.load('./interop_import_js_rules_js');\nlet A = GeneratedImportVar_3.getPropertyByName('A');\n", - "line": 20, - "column": 1, - "endLine": 20, - "endColumn": 49 - } - ], - "suggest": "", - "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", - "severity": "ERROR" - }, - { - "line": 21, - "column": 1, - "endLine": 21, - "endColumn": 49, - "problem": "ImportAfterStatement", - "suggest": "", - "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", - "severity": "ERROR" - }, - { - "line": 21, - "column": 1, - "endLine": 21, - "endColumn": 49, - "problem": "InterOpImportJs", - "autofix": [ + "line": 20, + "column": 1, + "endLine": 20, + "endColumn": 49, + "problem": "InterOpImportJs", + "autofix": [ + { + "start": 727, + "end": 775, + "replacementText": "", + "line": 20, + "column": 1, + "endLine": 20, + "endColumn": 49 + }, + { + "start": 1092, + "end": 1092, + "replacementText": "let GeneratedImportVar_3 = ESValue.load('./interop_import_js_rules_js');\nlet A = GeneratedImportVar_3.getPropertyByName('A');\n", + "line": 20, + "column": 1, + "endLine": 20, + "endColumn": 49 + } + ], + "suggest": "", + "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", + "severity": "ERROR" + }, { - "start": 776, - "end": 824, - "replacementText": "", - "line": 21, - "column": 1, - "endLine": 21, - "endColumn": 49 + "line": 21, + "column": 1, + "endLine": 21, + "endColumn": 49, + "problem": "ImportAfterStatement", + "suggest": "", + "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", + "severity": "ERROR" }, { - "start": 1092, - "end": 1092, - "replacementText": "let GeneratedImportVar_4 = ESValue.load('./interop_import_js_rules_js');\nlet C = GeneratedImportVar_4.getPropertyByName('C');\n", - "line": 21, - "column": 1, - "endLine": 21, - "endColumn": 49 - } - ], - "suggest": "", - "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", - "severity": "ERROR" - }, - { - "line": 23, - "column": 1, - "endLine": 23, - "endColumn": 51, - "problem": "ImportAfterStatement", - "suggest": "", - "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", - "severity": "ERROR" - }, - { - "line": 23, - "column": 1, - "endLine": 23, - "endColumn": 51, - "problem": "InterOpImportJs", - "autofix": [ + "line": 21, + "column": 1, + "endLine": 21, + "endColumn": 49, + "problem": "InterOpImportJs", + "autofix": [ + { + "start": 776, + "end": 824, + "replacementText": "", + "line": 21, + "column": 1, + "endLine": 21, + "endColumn": 49 + }, + { + "start": 1092, + "end": 1092, + "replacementText": "let GeneratedImportVar_4 = ESValue.load('./interop_import_js_rules_js');\nlet C = GeneratedImportVar_4.getPropertyByName('C');\n", + "line": 21, + "column": 1, + "endLine": 21, + "endColumn": 49 + } + ], + "suggest": "", + "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", + "severity": "ERROR" + }, { - "start": 826, - "end": 876, - "replacementText": "", - "line": 23, - "column": 1, - "endLine": 23, - "endColumn": 51 + "line": 23, + "column": 1, + "endLine": 23, + "endColumn": 51, + "problem": "ImportAfterStatement", + "suggest": "", + "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", + "severity": "ERROR" }, { - "start": 1092, - "end": 1092, - "replacementText": "let GeneratedImportVar_5 = ESValue.load('./interop_import_js_rules_js');\nlet ff3 = GeneratedImportVar_5.getPropertyByName('ff3');\n", - "line": 23, - "column": 1, - "endLine": 23, - "endColumn": 51 - } - ], - "suggest": "", - "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", - "severity": "ERROR" - }, - { - "line": 25, - "column": 1, - "endLine": 25, - "endColumn": 51, - "problem": "ImportAfterStatement", - "suggest": "", - "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", - "severity": "ERROR" - }, - { - "line": 25, - "column": 1, - "endLine": 25, - "endColumn": 51, - "problem": "InterOpImportJs", - "autofix": [ + "line": 23, + "column": 1, + "endLine": 23, + "endColumn": 51, + "problem": "InterOpImportJs", + "autofix": [ + { + "start": 826, + "end": 876, + "replacementText": "", + "line": 23, + "column": 1, + "endLine": 23, + "endColumn": 51 + }, + { + "start": 1092, + "end": 1092, + "replacementText": "let GeneratedImportVar_5 = ESValue.load('./interop_import_js_rules_js');\nlet ff3 = GeneratedImportVar_5.getPropertyByName('ff3');\n", + "line": 23, + "column": 1, + "endLine": 23, + "endColumn": 51 + } + ], + "suggest": "", + "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", + "severity": "ERROR" + }, { - "start": 878, - "end": 928, - "replacementText": "", - "line": 25, - "column": 1, - "endLine": 25, - "endColumn": 51 + "line": 25, + "column": 1, + "endLine": 25, + "endColumn": 51, + "problem": "ImportAfterStatement", + "suggest": "", + "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", + "severity": "ERROR" }, { - "start": 1092, - "end": 1092, - "replacementText": "let GeneratedImportVar_6 = ESValue.load('./interop_import_js_rules_js');\nlet ff4 = GeneratedImportVar_6.getPropertyByName('ff4');\n", - "line": 25, - "column": 1, - "endLine": 25, - "endColumn": 51 - } - ], - "suggest": "", - "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", - "severity": "ERROR" - }, - { - "line": 27, - "column": 1, - "endLine": 27, - "endColumn": 54, - "problem": "ImportAfterStatement", - "suggest": "", - "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", - "severity": "ERROR" - }, - { - "line": 27, - "column": 1, - "endLine": 27, - "endColumn": 54, - "problem": "InterOpImportJs", - "autofix": [ + "line": 25, + "column": 1, + "endLine": 25, + "endColumn": 51, + "problem": "InterOpImportJs", + "autofix": [ + { + "start": 878, + "end": 928, + "replacementText": "", + "line": 25, + "column": 1, + "endLine": 25, + "endColumn": 51 + }, + { + "start": 1092, + "end": 1092, + "replacementText": "let GeneratedImportVar_6 = ESValue.load('./interop_import_js_rules_js');\nlet ff4 = GeneratedImportVar_6.getPropertyByName('ff4');\n", + "line": 25, + "column": 1, + "endLine": 25, + "endColumn": 51 + } + ], + "suggest": "", + "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", + "severity": "ERROR" + }, { - "start": 930, - "end": 983, - "replacementText": "", - "line": 27, - "column": 1, - "endLine": 27, - "endColumn": 54 + "line": 27, + "column": 1, + "endLine": 27, + "endColumn": 54, + "problem": "ImportAfterStatement", + "suggest": "", + "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", + "severity": "ERROR" }, { - "start": 1092, - "end": 1092, - "replacementText": "let GeneratedImportVar_7 = ESValue.load('./interop_import_js_rules_js');\nlet handle = GeneratedImportVar_7.getPropertyByName('handle');\n", - "line": 27, - "column": 1, - "endLine": 27, - "endColumn": 54 - } - ], - "suggest": "", - "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", - "severity": "ERROR" - }, - { - "line": 29, - "column": 1, - "endLine": 29, - "endColumn": 54, - "problem": "ImportAfterStatement", - "suggest": "", - "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", - "severity": "ERROR" - }, - { - "line": 29, - "column": 1, - "endLine": 29, - "endColumn": 54, - "problem": "InterOpImportJs", - "autofix": [ + "line": 27, + "column": 1, + "endLine": 27, + "endColumn": 54, + "problem": "InterOpImportJs", + "autofix": [ + { + "start": 930, + "end": 983, + "replacementText": "", + "line": 27, + "column": 1, + "endLine": 27, + "endColumn": 54 + }, + { + "start": 1092, + "end": 1092, + "replacementText": "let GeneratedImportVar_7 = ESValue.load('./interop_import_js_rules_js');\nlet handle = GeneratedImportVar_7.getPropertyByName('handle');\n", + "line": 27, + "column": 1, + "endLine": 27, + "endColumn": 54 + } + ], + "suggest": "", + "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", + "severity": "ERROR" + }, { - "start": 985, - "end": 1038, - "replacementText": "", - "line": 29, - "column": 1, - "endLine": 29, - "endColumn": 54 + "line": 29, + "column": 1, + "endLine": 29, + "endColumn": 54, + "problem": "ImportAfterStatement", + "suggest": "", + "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", + "severity": "ERROR" }, { - "start": 1092, - "end": 1092, - "replacementText": "let GeneratedImportVar_8 = ESValue.load('./interop_import_js_rules_js');\nlet expand = GeneratedImportVar_8.getPropertyByName('expand');\n", - "line": 29, - "column": 1, - "endLine": 29, - "endColumn": 54 - } - ], - "suggest": "", - "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", - "severity": "ERROR" - }, - { - "line": 30, - "column": 1, - "endLine": 30, - "endColumn": 54, - "problem": "ImportAfterStatement", - "suggest": "", - "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", - "severity": "ERROR" - }, - { - "line": 30, - "column": 1, - "endLine": 30, - "endColumn": 54, - "problem": "InterOpImportJs", - "autofix": [ + "line": 29, + "column": 1, + "endLine": 29, + "endColumn": 54, + "problem": "InterOpImportJs", + "autofix": [ + { + "start": 985, + "end": 1038, + "replacementText": "", + "line": 29, + "column": 1, + "endLine": 29, + "endColumn": 54 + }, + { + "start": 1092, + "end": 1092, + "replacementText": "let GeneratedImportVar_8 = ESValue.load('./interop_import_js_rules_js');\nlet expand = GeneratedImportVar_8.getPropertyByName('expand');\n", + "line": 29, + "column": 1, + "endLine": 29, + "endColumn": 54 + } + ], + "suggest": "", + "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", + "severity": "ERROR" + }, { - "start": 1039, - "end": 1092, - "replacementText": "", - "line": 30, - "column": 1, - "endLine": 30, - "endColumn": 54 + "line": 30, + "column": 1, + "endLine": 30, + "endColumn": 54, + "problem": "ImportAfterStatement", + "suggest": "", + "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", + "severity": "ERROR" }, { - "start": 1092, - "end": 1092, - "replacementText": "let GeneratedImportVar_9 = ESValue.load('./interop_import_js_rules_js');\nlet orange = GeneratedImportVar_9.getPropertyByName('orange');\n", - "line": 30, - "column": 1, - "endLine": 30, - "endColumn": 54 - } - ], - "suggest": "", - "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", - "severity": "ERROR" - }, - { - "line": 31, - "column": 5, - "endLine": 31, - "endColumn": 15, - "problem": "InteropObjectProperty", - "autofix": [ + "line": 30, + "column": 1, + "endLine": 30, + "endColumn": 54, + "problem": "InterOpImportJs", + "autofix": [ + { + "start": 1039, + "end": 1092, + "replacementText": "", + "line": 30, + "column": 1, + "endLine": 30, + "endColumn": 54 + }, + { + "start": 1092, + "end": 1092, + "replacementText": "let GeneratedImportVar_9 = ESValue.load('./interop_import_js_rules_js');\nlet orange = GeneratedImportVar_9.getPropertyByName('orange');\n", + "line": 30, + "column": 1, + "endLine": 30, + "endColumn": 54 + } + ], + "suggest": "", + "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", + "severity": "ERROR" + }, { - "start": 1097, - "end": 1107, - "replacementText": "foo.getPropertyByName(\"isGood\")", - "line": 31, - "column": 5, - "endLine": 31, - "endColumn": 15 - } - ], - "suggest": "", - "rule": "Properties of interop objects can't be accessed directly (arkts-interop-js2s-access-js-prop)", - "severity": "ERROR" - }, - { - "line": 31, - "column": 5, - "endLine": 31, - "endColumn": 15, - "problem": "InteropJsObjectConditionJudgment", - "autofix": [ + "line": 32, + "column": 5, + "endLine": 32, + "endColumn": 15, + "problem": "InteropObjectProperty", + "autofix": [ + { + "start": 1098, + "end": 1108, + "replacementText": "foo.getPropertyByName(\"isGood\")", + "line": 32, + "column": 5, + "endLine": 32, + "endColumn": 15 + } + ], + "suggest": "", + "rule": "Properties of interop objects can't be accessed directly (arkts-interop-js2s-access-js-prop)", + "severity": "ERROR" + }, { - "replacementText": "foo.getPropertyByName('isGood').toBoolean()", - "start": 1097, - "end": 1107, - "line": 31, - "column": 5, - "endLine": 31, - "endColumn": 15 - } - ], - "suggest": "", - "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js2s-condition-judgment)", - "severity": "ERROR" - }, - { - "line": 33, - "column": 5, - "endLine": 33, - "endColumn": 11, - "problem": "InterOpImportJsDataCompare", - "suggest": "", - "rule": "Importing data directly from the \"JS\" module for comparison is not supported (arkts-interop-js2s-compare-js-data)", - "severity": "ERROR" - }, - { - "line": 33, - "column": 5, - "endLine": 33, - "endColumn": 11, - "problem": "InteropObjectProperty", - "autofix": [ + "line": 32, + "column": 5, + "endLine": 32, + "endColumn": 15, + "problem": "InteropJsObjectConditionJudgment", + "autofix": [ + { + "replacementText": "foo.getPropertyByName('isGood').toBoolean()", + "start": 1098, + "end": 1108, + "line": 32, + "column": 5, + "endLine": 32, + "endColumn": 15 + } + ], + "suggest": "", + "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js2s-condition-judgment)", + "severity": "ERROR" + }, { - "start": 1117, - "end": 1123, - "replacementText": "ff1.getPropertyByName(\"f1\")", - "line": 33, - "column": 5, - "endLine": 33, - "endColumn": 11 - } - ], - "suggest": "", - "rule": "Properties of interop objects can't be accessed directly (arkts-interop-js2s-access-js-prop)", - "severity": "ERROR" - }, - { - "line": 33, - "column": 5, - "endLine": 33, - "endColumn": 11, - "problem": "InteropJsObjectConditionJudgment", - "autofix": [ + "line": 34, + "column": 5, + "endLine": 34, + "endColumn": 11, + "problem": "InterOpImportJsDataCompare", + "suggest": "", + "rule": "Importing data directly from the \"JS\" module for comparison is not supported (arkts-interop-js2s-compare-js-data)", + "severity": "ERROR" + }, { - "replacementText": "ff1.getPropertyByName('f1').toNumber()", - "start": 1117, - "end": 1123, - "line": 33, - "column": 5, - "endLine": 33, - "endColumn": 11 - } - ], - "suggest": "", - "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js2s-condition-judgment)", - "severity": "ERROR" - }, - { - "line": 33, - "column": 14, - "endLine": 33, - "endColumn": 16, - "problem": "NumericSemantics", - "autofix": [ + "line": 34, + "column": 5, + "endLine": 34, + "endColumn": 11, + "problem": "InteropObjectProperty", + "autofix": [ + { + "start": 1118, + "end": 1124, + "replacementText": "ff1.getPropertyByName(\"f1\")", + "line": 34, + "column": 5, + "endLine": 34, + "endColumn": 11 + } + ], + "suggest": "", + "rule": "Properties of interop objects can't be accessed directly (arkts-interop-js2s-access-js-prop)", + "severity": "ERROR" + }, { - "start": 1126, - "end": 1128, - "replacementText": "18.0", - "line": 33, - "column": 14, - "endLine": 33, - "endColumn": 16 - } - ], - "suggest": "", - "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", - "severity": "ERROR" - }, - { - "line": 37, - "column": 1, - "endLine": 37, - "endColumn": 21, - "problem": "InteropJsObjectInheritance", - "suggest": "", - "rule": "Direct inheritance of interop JS classes is not supported (arkts-interop-js2s-inherit-js-class)", - "severity": "ERROR" - }, - { - "line": 41, - "column": 1, - "endLine": 41, - "endColumn": 21, - "problem": "InteropJsObjectInheritance", - "suggest": "", - "rule": "Direct inheritance of interop JS classes is not supported (arkts-interop-js2s-inherit-js-class)", - "severity": "ERROR" - }, - { - "line": 44, - "column": 3, - "endLine": 44, - "endColumn": 8, - "problem": "InteropJSFunctionInvoke", - "suggest": "", - "rule": "Trying to catch JS errors is not permitted (arkts-interop-js2s-js-exception)", - "severity": "ERROR" - }, - { - "line": 44, - "column": 3, - "endLine": 44, - "endColumn": 8, - "problem": "CallJSFunction", - "autofix": [ + "line": 34, + "column": 5, + "endLine": 34, + "endColumn": 11, + "problem": "InteropJsObjectConditionJudgment", + "autofix": [ + { + "replacementText": "ff1.getPropertyByName('f1').toNumber()", + "start": 1118, + "end": 1124, + "line": 34, + "column": 5, + "endLine": 34, + "endColumn": 11 + } + ], + "suggest": "", + "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js2s-condition-judgment)", + "severity": "ERROR" + }, { - "start": 1288, - "end": 1293, - "replacementText": "ff4.invoke()", - "line": 44, - "column": 3, - "endLine": 44, - "endColumn": 8 - } - ], - "suggest": "", - "rule": "ArkTS directly call JS functions or parameters is not supported (arkts-interop-js2s-call-js-func)", - "severity": "ERROR" - }, - { - "line": 45, - "column": 3, - "endLine": 47, - "endColumn": 2, - "problem": "TsLikeCatchType", - "suggest": "", - "rule": "TS catch type are not supported (arkts-no-ts-like-catch-type)", - "severity": "ERROR" - }, - { - "line": 49, - "column": 11, - "endLine": 49, - "endColumn": 18, - "problem": "InteropObjectProperty", - "autofix": [ + "line": 34, + "column": 14, + "endLine": 34, + "endColumn": 16, + "problem": "NumericSemantics", + "autofix": [ + { + "start": 1127, + "end": 1129, + "replacementText": "18.0", + "line": 34, + "column": 14, + "endLine": 34, + "endColumn": 16 + } + ], + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, { - "start": 1343, - "end": 1350, - "replacementText": "ff3.getPropertyByName(\"arr\")", - "line": 49, - "column": 11, - "endLine": 49, - "endColumn": 18 - } - ], - "suggest": "", - "rule": "Properties of interop objects can't be accessed directly (arkts-interop-js2s-access-js-prop)", - "severity": "ERROR" - }, - { - "line": 49, - "column": 11, - "endLine": 49, - "endColumn": 18, - "problem": "InteropJsObjectUsage", - "autofix": [ + "line": 38, + "column": 1, + "endLine": 38, + "endColumn": 21, + "problem": "InteropJsObjectInheritance", + "suggest": "", + "rule": "Direct inheritance of interop JS classes is not supported (arkts-interop-js2s-inherit-js-class)", + "severity": "ERROR" + }, { - "replacementText": "ff3.getPropertyByName('arr')", - "start": 1343, - "end": 1350, - "line": 49, - "column": 11, - "endLine": 49, - "endColumn": 18 - } - ], - "suggest": "", - "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js-object-usage)", - "severity": "ERROR" - }, - { - "line": 50, - "column": 11, - "endLine": 50, - "endColumn": 21, - "problem": "InteropJsObjectUsage", - "autofix": [ + "line": 42, + "column": 1, + "endLine": 42, + "endColumn": 21, + "problem": "InteropJsObjectInheritance", + "suggest": "", + "rule": "Direct inheritance of interop JS classes is not supported (arkts-interop-js2s-inherit-js-class)", + "severity": "ERROR" + }, { - "replacementText": "arr.getPropertyByName('length').toNumber()", - "start": 1361, - "end": 1381, - "line": 50, - "column": 11, - "endLine": 50, - "endColumn": 21 - } - ], - "suggest": "", - "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js-object-usage)", - "severity": "ERROR" - }, - { - "line": 53, - "column": 3, - "endLine": 53, - "endColumn": 9, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, - { - "line": 51, - "column": 10, - "endLine": 51, - "endColumn": 15, - "problem": "NumericSemantics", - "autofix": [ + "line": 45, + "column": 3, + "endLine": 45, + "endColumn": 8, + "problem": "InteropJSFunctionInvoke", + "suggest": "", + "rule": "Trying to catch JS errors is not permitted (arkts-interop-js2s-js-exception)", + "severity": "ERROR" + }, { - "start": 1391, - "end": 1396, - "replacementText": "i: number = 0", - "line": 51, - "column": 10, - "endLine": 51, - "endColumn": 15 - } - ], - "suggest": "", - "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", - "severity": "ERROR" - }, - { - "line": 51, - "column": 14, - "endLine": 51, - "endColumn": 15, - "problem": "NumericSemantics", - "autofix": [ + "line": 45, + "column": 3, + "endLine": 45, + "endColumn": 8, + "problem": "CallJSFunction", + "autofix": [ + { + "start": 1289, + "end": 1294, + "replacementText": "ff4.invoke()", + "line": 45, + "column": 3, + "endLine": 45, + "endColumn": 8 + } + ], + "suggest": "", + "rule": "ArkTS directly call JS functions or parameters is not supported (arkts-interop-js2s-call-js-func)", + "severity": "ERROR" + }, { - "start": 1395, - "end": 1396, - "replacementText": "0.0", - "line": 51, - "column": 14, - "endLine": 51, - "endColumn": 15 - } - ], - "suggest": "", - "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", - "severity": "ERROR" - }, - { - "line": 52, - "column": 11, - "endLine": 52, - "endColumn": 17, - "problem": "RuntimeArrayCheck", - "suggest": "", - "rule": "Array bound not checked. (arkts-runtime-array-check)", - "severity": "ERROR" - }, - { - "line": 52, - "column": 11, - "endLine": 52, - "endColumn": 17, - "problem": "InteropJsObjectTraverseJsInstance", - "autofix": [ + "line": 46, + "column": 3, + "endLine": 48, + "endColumn": 2, + "problem": "TsLikeCatchType", + "suggest": "", + "rule": "TS catch type are not supported (arkts-no-ts-like-catch-type)", + "severity": "ERROR" + }, { - "replacementText": "arr.getPropertyByIndex(i).toNumber()", - "start": 1424, - "end": 1430, - "line": 52, - "column": 11, - "endLine": 52, - "endColumn": 17 - } - ], - "suggest": "", - "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js2s-traverse-js-instance)", - "severity": "ERROR" - }, - { - "line": 52, - "column": 11, - "endLine": 52, - "endColumn": 17, - "problem": "InterOpImportJsIndex", - "autofix": [ + "line": 50, + "column": 11, + "endLine": 50, + "endColumn": 18, + "problem": "InteropObjectProperty", + "autofix": [ + { + "start": 1344, + "end": 1351, + "replacementText": "ff3.getPropertyByName(\"arr\")", + "line": 50, + "column": 11, + "endLine": 50, + "endColumn": 18 + } + ], + "suggest": "", + "rule": "Properties of interop objects can't be accessed directly (arkts-interop-js2s-access-js-prop)", + "severity": "ERROR" + }, { - "start": 1424, - "end": 1430, - "replacementText": "arr.getPropertyByIndex(i)", - "line": 52, - "column": 11, - "endLine": 52, - "endColumn": 17 - } - ], - "suggest": "", - "rule": "Interop objects can't be indexed directly (arkts-interop-js2s-access-js-index)", - "severity": "ERROR" - }, - { - "line": 53, - "column": 3, - "endLine": 53, - "endColumn": 9, - "problem": "InteropJsObjectTraverseJsInstance", - "autofix": [ + "line": 50, + "column": 11, + "endLine": 50, + "endColumn": 18, + "problem": "InteropJsObjectUsage", + "autofix": [ + { + "replacementText": "ff3.getPropertyByName('arr')", + "start": 1344, + "end": 1351, + "line": 50, + "column": 11, + "endLine": 50, + "endColumn": 18 + } + ], + "suggest": "", + "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js-object-usage)", + "severity": "ERROR" + }, { - "replacementText": "arr.setPropertyByIndex(i, ESValue.wrap(0))", - "start": 1433, - "end": 1443, - "line": 53, - "column": 3, - "endLine": 53, - "endColumn": 9 - } - ], - "suggest": "", - "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js2s-traverse-js-instance)", - "severity": "ERROR" - }, - { - "line": 53, - "column": 3, - "endLine": 53, - "endColumn": 13, - "problem": "InterOpImportJsIndex", - "autofix": [ + "line": 51, + "column": 11, + "endLine": 51, + "endColumn": 21, + "problem": "InteropJsObjectUsage", + "autofix": [ + { + "replacementText": "arr.getPropertyByName('length').toNumber()", + "start": 1362, + "end": 1382, + "line": 51, + "column": 11, + "endLine": 51, + "endColumn": 21 + } + ], + "suggest": "", + "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js-object-usage)", + "severity": "ERROR" + }, { - "start": 1433, - "end": 1443, - "replacementText": "arr.setPropertyByIndex(i, ESValue.wrap(0))", - "line": 53, - "column": 3, - "endLine": 53, - "endColumn": 13 - } - ], - "suggest": "", - "rule": "Interop objects can't be indexed directly (arkts-interop-js2s-access-js-index)", - "severity": "ERROR" - }, - { - "line": 53, - "column": 12, - "endLine": 53, - "endColumn": 13, - "problem": "NumericSemantics", - "autofix": [ + "line": 54, + "column": 3, + "endLine": 54, + "endColumn": 9, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { - "start": 1442, - "end": 1443, - "replacementText": "0.0", - "line": 53, - "column": 12, - "endLine": 53, - "endColumn": 13 - } - ], - "suggest": "", - "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", - "severity": "ERROR" - }, - { - "line": 63, - "column": 8, - "endLine": 63, - "endColumn": 12, - "problem": "InteropJsObjectCallStaticFunc", - "suggest": "", - "rule": "Direct usage of interop JS functions is not supported (arkts-interop-js2s-js-call-static-function)", - "severity": "ERROR" - }, - { - "line": 63, - "column": 1, - "endLine": 63, - "endColumn": 13, - "problem": "CallJSFunction", - "autofix": [ + "line": 52, + "column": 10, + "endLine": 52, + "endColumn": 15, + "problem": "NumericSemantics", + "autofix": [ + { + "start": 1392, + "end": 1397, + "replacementText": "i: number = 0", + "line": 52, + "column": 10, + "endLine": 52, + "endColumn": 15 + } + ], + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, { - "start": 1544, - "end": 1556, - "replacementText": "handle.invoke(ESValue.wrap(foo2))", - "line": 63, - "column": 1, - "endLine": 63, - "endColumn": 13 - } - ], - "suggest": "", - "rule": "ArkTS directly call JS functions or parameters is not supported (arkts-interop-js2s-call-js-func)", - "severity": "ERROR" - }, - { - "line": 64, - "column": 8, - "endLine": 64, - "endColumn": 14, - "problem": "InteropJsObjectCallStaticFunc", - "suggest": "", - "rule": "Direct usage of interop JS functions is not supported (arkts-interop-js2s-js-call-static-function)", - "severity": "ERROR" - }, - { - "line": 64, - "column": 1, - "endLine": 64, - "endColumn": 15, - "problem": "CallJSFunction", - "autofix": [ + "line": 52, + "column": 14, + "endLine": 52, + "endColumn": 15, + "problem": "NumericSemantics", + "autofix": [ + { + "start": 1396, + "end": 1397, + "replacementText": "0.0", + "line": 52, + "column": 14, + "endLine": 52, + "endColumn": 15 + } + ], + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, { - "start": 1557, - "end": 1571, - "replacementText": "handle.invoke(ESValue.wrap(lambda))", - "line": 64, - "column": 1, - "endLine": 64, - "endColumn": 15 - } - ], - "suggest": "", - "rule": "ArkTS directly call JS functions or parameters is not supported (arkts-interop-js2s-call-js-func)", - "severity": "ERROR" - }, - { - "line": 66, - "column": 9, - "endLine": 66, - "endColumn": 15, - "problem": "NumericSemantics", - "autofix": [ + "line": 53, + "column": 11, + "endLine": 53, + "endColumn": 17, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, { - "start": 1581, - "end": 1587, - "replacementText": "a: number = 1;", - "line": 66, - "column": 9, - "endLine": 66, - "endColumn": 15 - } - ], - "suggest": "", - "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", - "severity": "ERROR" - }, - { - "line": 66, - "column": 13, - "endLine": 66, - "endColumn": 14, - "problem": "NumericSemantics", - "autofix": [ + "line": 53, + "column": 11, + "endLine": 53, + "endColumn": 17, + "problem": "InteropJsObjectTraverseJsInstance", + "autofix": [ + { + "replacementText": "arr.getPropertyByIndex(i).toNumber()", + "start": 1425, + "end": 1431, + "line": 53, + "column": 11, + "endLine": 53, + "endColumn": 17 + } + ], + "suggest": "", + "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js2s-traverse-js-instance)", + "severity": "ERROR" + }, { - "start": 1585, - "end": 1586, - "replacementText": "1.0", - "line": 66, - "column": 13, - "endLine": 66, - "endColumn": 14 - } - ], - "suggest": "", - "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", - "severity": "ERROR" - }, - { - "line": 66, - "column": 16, - "endLine": 66, - "endColumn": 21, - "problem": "NumericSemantics", - "autofix": [ + "line": 53, + "column": 11, + "endLine": 53, + "endColumn": 17, + "problem": "InterOpImportJsIndex", + "autofix": [ + { + "start": 1425, + "end": 1431, + "replacementText": "arr.getPropertyByIndex(i)", + "line": 53, + "column": 11, + "endLine": 53, + "endColumn": 17 + } + ], + "suggest": "", + "rule": "Interop objects can't be indexed directly (arkts-interop-js2s-access-js-index)", + "severity": "ERROR" + }, { - "start": 1588, - "end": 1593, - "replacementText": "b: number = 2;", - "line": 66, - "column": 16, - "endLine": 66, - "endColumn": 21 - } - ], - "suggest": "", - "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", - "severity": "ERROR" - }, - { - "line": 66, - "column": 19, - "endLine": 66, - "endColumn": 20, - "problem": "NumericSemantics", - "autofix": [ + "line": 54, + "column": 3, + "endLine": 54, + "endColumn": 9, + "problem": "InteropJsObjectTraverseJsInstance", + "autofix": [ + { + "replacementText": "arr.setPropertyByIndex(i, ESValue.wrap(0))", + "start": 1434, + "end": 1444, + "line": 54, + "column": 3, + "endLine": 54, + "endColumn": 9 + } + ], + "suggest": "", + "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js2s-traverse-js-instance)", + "severity": "ERROR" + }, { - "start": 1591, - "end": 1592, - "replacementText": "2.0", - "line": 66, - "column": 19, - "endLine": 66, - "endColumn": 20 - } - ], - "suggest": "", - "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", - "severity": "ERROR" - }, - { - "line": 66, - "column": 22, - "endLine": 66, - "endColumn": 26, - "problem": "NumericSemantics", - "autofix": [ + "line": 54, + "column": 3, + "endLine": 54, + "endColumn": 13, + "problem": "InterOpImportJsIndex", + "autofix": [ + { + "start": 1434, + "end": 1444, + "replacementText": "arr.setPropertyByIndex(i, ESValue.wrap(0))", + "line": 54, + "column": 3, + "endLine": 54, + "endColumn": 13 + } + ], + "suggest": "", + "rule": "Interop objects can't be indexed directly (arkts-interop-js2s-access-js-index)", + "severity": "ERROR" + }, { - "start": 1594, - "end": 1598, - "replacementText": "c: number = 3;", - "line": 66, - "column": 22, - "endLine": 66, - "endColumn": 26 - } - ], - "suggest": "", - "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", - "severity": "ERROR" - }, - { - "line": 66, - "column": 25, - "endLine": 66, - "endColumn": 26, - "problem": "NumericSemantics", - "autofix": [ + "line": 54, + "column": 12, + "endLine": 54, + "endColumn": 13, + "problem": "NumericSemantics", + "autofix": [ + { + "start": 1443, + "end": 1444, + "replacementText": "0.0", + "line": 54, + "column": 12, + "endLine": 54, + "endColumn": 13 + } + ], + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, { - "start": 1597, - "end": 1598, - "replacementText": "3.0", - "line": 66, - "column": 25, - "endLine": 66, - "endColumn": 26 - } - ], - "suggest": "", - "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", - "severity": "ERROR" - }, - { - "line": 67, - "column": 8, - "endLine": 67, - "endColumn": 15, - "problem": "InteropJsObjectExpandStaticInstance", - "suggest": "", - "rule": "Direct usage of interop JS functions is not supported (arkts-interop-js2s-js-expand-static-instance)", - "severity": "ERROR" - }, - { - "line": 67, - "column": 1, - "endLine": 67, - "endColumn": 16, - "problem": "CallJSFunction", - "autofix": [ + "line": 64, + "column": 8, + "endLine": 64, + "endColumn": 12, + "problem": "InteropJsObjectCallStaticFunc", + "suggest": "", + "rule": "Direct usage of interop JS functions is not supported (arkts-interop-js2s-js-call-static-function)", + "severity": "ERROR" + }, { - "start": 1600, - "end": 1615, - "replacementText": "expand.invoke(ESValue.wrap(new X()))", - "line": 67, - "column": 1, - "endLine": 67, - "endColumn": 16 - } - ], - "suggest": "", - "rule": "ArkTS directly call JS functions or parameters is not supported (arkts-interop-js2s-call-js-func)", - "severity": "ERROR" - }, - { - "line": 76, - "column": 8, - "endLine": 76, - "endColumn": 13, - "problem": "InteropJsObjectExpandStaticInstance", - "suggest": "", - "rule": "Direct usage of interop JS functions is not supported (arkts-interop-js2s-js-expand-static-instance)", - "severity": "ERROR" - }, - { - "line": 76, - "column": 1, - "endLine": 76, - "endColumn": 14, - "problem": "CallJSFunction", - "autofix": [ + "line": 64, + "column": 1, + "endLine": 64, + "endColumn": 13, + "problem": "CallJSFunction", + "autofix": [ + { + "start": 1545, + "end": 1557, + "replacementText": "handle.invoke(ESValue.wrap(foo2))", + "line": 64, + "column": 1, + "endLine": 64, + "endColumn": 13 + } + ], + "suggest": "", + "rule": "ArkTS directly call JS functions or parameters is not supported (arkts-interop-js2s-call-js-func)", + "severity": "ERROR" + }, { - "start": 1749, - "end": 1762, - "replacementText": "expand.invoke(ESValue.wrap(testY))", - "line": 76, - "column": 1, - "endLine": 76, - "endColumn": 14 - } - ], - "suggest": "", - "rule": "ArkTS directly call JS functions or parameters is not supported (arkts-interop-js2s-call-js-func)", - "severity": "ERROR" - }, - { - "line": 77, - "column": 8, - "endLine": 77, - "endColumn": 38, - "problem": "InteropJsObjectExpandStaticInstance", - "suggest": "", - "rule": "Direct usage of interop JS functions is not supported (arkts-interop-js2s-js-expand-static-instance)", - "severity": "ERROR" - }, - { - "line": 77, - "column": 1, - "endLine": 77, - "endColumn": 39, - "problem": "CallJSFunction", - "autofix": [ + "line": 65, + "column": 8, + "endLine": 65, + "endColumn": 14, + "problem": "InteropJsObjectCallStaticFunc", + "suggest": "", + "rule": "Direct usage of interop JS functions is not supported (arkts-interop-js2s-js-call-static-function)", + "severity": "ERROR" + }, { - "start": 1764, - "end": 1802, - "replacementText": "expand.invoke(ESValue.wrap({x: '1', y: \"hello\", z: false}))", - "line": 77, - "column": 1, - "endLine": 77, - "endColumn": 39 - } - ], - "suggest": "", - "rule": "ArkTS directly call JS functions or parameters is not supported (arkts-interop-js2s-call-js-func)", - "severity": "ERROR" - }, - { - "line": 79, - "column": 5, - "endLine": 79, - "endColumn": 32, - "problem": "InteropEqualityJudgment", - "autofix": [ + "line": 65, + "column": 1, + "endLine": 65, + "endColumn": 15, + "problem": "CallJSFunction", + "autofix": [ + { + "start": 1558, + "end": 1572, + "replacementText": "handle.invoke(ESValue.wrap(lambda))", + "line": 65, + "column": 1, + "endLine": 65, + "endColumn": 15 + } + ], + "suggest": "", + "rule": "ArkTS directly call JS functions or parameters is not supported (arkts-interop-js2s-call-js-func)", + "severity": "ERROR" + }, { - "start": 1826, - "end": 1853, - "replacementText": "orange.isVegetable1.areStrictlyEqual(123)", - "line": 79, - "column": 5, - "endLine": 79, - "endColumn": 32 - } - ], - "suggest": "", - "rule": "\"JS\" objects can't be used directly as operands of the equality operators (arkts-interop-js2s-equality-judgment)", - "severity": "ERROR" - }, - { - "line": 79, - "column": 5, - "endLine": 79, - "endColumn": 24, - "problem": "InteropObjectProperty", - "autofix": [ + "line": 67, + "column": 9, + "endLine": 67, + "endColumn": 15, + "problem": "NumericSemantics", + "autofix": [ + { + "start": 1582, + "end": 1588, + "replacementText": "a: number = 1;", + "line": 67, + "column": 9, + "endLine": 67, + "endColumn": 15 + } + ], + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, { - "start": 1826, - "end": 1845, - "replacementText": "orange.getPropertyByName(\"isVegetable1\")", - "line": 79, - "column": 5, - "endLine": 79, - "endColumn": 24 - } - ], - "suggest": "", - "rule": "Properties of interop objects can't be accessed directly (arkts-interop-js2s-access-js-prop)", - "severity": "ERROR" - }, - { - "line": 79, - "column": 5, - "endLine": 79, - "endColumn": 24, - "problem": "InteropJsObjectUsage", - "autofix": [ + "line": 67, + "column": 13, + "endLine": 67, + "endColumn": 14, + "problem": "NumericSemantics", + "autofix": [ + { + "start": 1586, + "end": 1587, + "replacementText": "1.0", + "line": 67, + "column": 13, + "endLine": 67, + "endColumn": 14 + } + ], + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, { - "replacementText": "orange.getPropertyByName('isVegetable1').toNumber()", - "start": 1826, - "end": 1845, - "line": 79, - "column": 5, - "endLine": 79, - "endColumn": 24 - } - ], - "suggest": "", - "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js-object-usage)", - "severity": "ERROR" - }, - { - "line": 79, - "column": 29, - "endLine": 79, - "endColumn": 32, - "problem": "NumericSemantics", - "autofix": [ + "line": 67, + "column": 16, + "endLine": 67, + "endColumn": 21, + "problem": "NumericSemantics", + "autofix": [ + { + "start": 1589, + "end": 1594, + "replacementText": "b: number = 2;", + "line": 67, + "column": 16, + "endLine": 67, + "endColumn": 21 + } + ], + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 67, + "column": 19, + "endLine": 67, + "endColumn": 20, + "problem": "NumericSemantics", + "autofix": [ + { + "start": 1592, + "end": 1593, + "replacementText": "2.0", + "line": 67, + "column": 19, + "endLine": 67, + "endColumn": 20 + } + ], + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 67, + "column": 22, + "endLine": 67, + "endColumn": 26, + "problem": "NumericSemantics", + "autofix": [ + { + "start": 1595, + "end": 1599, + "replacementText": "c: number = 3;", + "line": 67, + "column": 22, + "endLine": 67, + "endColumn": 26 + } + ], + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 67, + "column": 25, + "endLine": 67, + "endColumn": 26, + "problem": "NumericSemantics", + "autofix": [ + { + "start": 1598, + "end": 1599, + "replacementText": "3.0", + "line": 67, + "column": 25, + "endLine": 67, + "endColumn": 26 + } + ], + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 68, + "column": 8, + "endLine": 68, + "endColumn": 15, + "problem": "InteropJsObjectExpandStaticInstance", + "suggest": "", + "rule": "Direct usage of interop JS functions is not supported (arkts-interop-js2s-js-expand-static-instance)", + "severity": "ERROR" + }, + { + "line": 68, + "column": 1, + "endLine": 68, + "endColumn": 16, + "problem": "CallJSFunction", + "autofix": [ + { + "start": 1601, + "end": 1616, + "replacementText": "expand.invoke(ESValue.wrap(new X()))", + "line": 68, + "column": 1, + "endLine": 68, + "endColumn": 16 + } + ], + "suggest": "", + "rule": "ArkTS directly call JS functions or parameters is not supported (arkts-interop-js2s-call-js-func)", + "severity": "ERROR" + }, + { + "line": 80, + "column": 8, + "endLine": 80, + "endColumn": 13, + "problem": "InteropJsObjectExpandStaticInstance", + "suggest": "", + "rule": "Direct usage of interop JS functions is not supported (arkts-interop-js2s-js-expand-static-instance)", + "severity": "ERROR" + }, + { + "line": 80, + "column": 1, + "endLine": 80, + "endColumn": 14, + "problem": "CallJSFunction", + "autofix": [ + { + "start": 1753, + "end": 1766, + "replacementText": "expand.invoke(ESValue.wrap(testY))", + "line": 80, + "column": 1, + "endLine": 80, + "endColumn": 14 + } + ], + "suggest": "", + "rule": "ArkTS directly call JS functions or parameters is not supported (arkts-interop-js2s-call-js-func)", + "severity": "ERROR" + }, + { + "line": 81, + "column": 8, + "endLine": 81, + "endColumn": 38, + "problem": "InteropJsObjectExpandStaticInstance", + "suggest": "", + "rule": "Direct usage of interop JS functions is not supported (arkts-interop-js2s-js-expand-static-instance)", + "severity": "ERROR" + }, + { + "line": 81, + "column": 1, + "endLine": 81, + "endColumn": 39, + "problem": "CallJSFunction", + "autofix": [ + { + "start": 1768, + "end": 1806, + "replacementText": "expand.invoke(ESValue.wrap({x: '1', y: \"hello\", z: false}))", + "line": 81, + "column": 1, + "endLine": 81, + "endColumn": 39 + } + ], + "suggest": "", + "rule": "ArkTS directly call JS functions or parameters is not supported (arkts-interop-js2s-call-js-func)", + "severity": "ERROR" + }, + { + "line": 84, + "column": 5, + "endLine": 84, + "endColumn": 32, + "problem": "InteropEqualityJudgment", + "autofix": [ + { + "start": 1831, + "end": 1858, + "replacementText": "orange.isVegetable1.areStrictlyEqual(123)", + "line": 84, + "column": 5, + "endLine": 84, + "endColumn": 32 + } + ], + "suggest": "", + "rule": "\"JS\" objects can't be used directly as operands of the equality operators (arkts-interop-js2s-equality-judgment)", + "severity": "ERROR" + }, + { + "line": 84, + "column": 5, + "endLine": 84, + "endColumn": 24, + "problem": "InteropObjectProperty", + "autofix": [ + { + "start": 1831, + "end": 1850, + "replacementText": "orange.getPropertyByName(\"isVegetable1\")", + "line": 84, + "column": 5, + "endLine": 84, + "endColumn": 24 + } + ], + "suggest": "", + "rule": "Properties of interop objects can't be accessed directly (arkts-interop-js2s-access-js-prop)", + "severity": "ERROR" + }, + { + "line": 84, + "column": 5, + "endLine": 84, + "endColumn": 24, + "problem": "InteropJsObjectUsage", + "autofix": [ + { + "replacementText": "orange.getPropertyByName('isVegetable1').toNumber()", + "start": 1831, + "end": 1850, + "line": 84, + "column": 5, + "endLine": 84, + "endColumn": 24 + } + ], + "suggest": "", + "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js-object-usage)", + "severity": "ERROR" + }, + { + "line": 84, + "column": 29, + "endLine": 84, + "endColumn": 32, + "problem": "NumericSemantics", + "autofix": [ + { + "start": 1855, + "end": 1858, + "replacementText": "123.0", + "line": 84, + "column": 29, + "endLine": 84, + "endColumn": 32 + } + ], + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 88, + "column": 1, + "endLine": 92, + "endColumn": 2, + "problem": "InteropJsObjectTraverseJsInstance", + "suggest": "", + "rule": "Direct usage of interop JS objects is not supported (arkts-interop-js2s-traverse-js-instance)", + "severity": "ERROR" + }, { - "start": 1850, - "end": 1853, - "replacementText": "123.0", - "line": 79, - "column": 29, - "endLine": 79, - "endColumn": 32 + "line": 89, + "column": 18, + "endLine": 89, + "endColumn": 19, + "problem": "NumericSemantics", + "autofix": [ + { + "start": 1921, + "end": 1922, + "replacementText": "8.0", + "line": 89, + "column": 18, + "endLine": 89, + "endColumn": 19 + } + ], + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" } - ], - "suggest": "", - "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", - "severity": "ERROR" - } - ] + ] } -- Gitee