From 651eb6283b1299d3946e24fe39f2ddab7971fdef Mon Sep 17 00:00:00 2001 From: zhongning Date: Sat, 21 Jun 2025 17:53:42 +0800 Subject: [PATCH] fix issue for InteropDirectAccessToTSTypes Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/ICCLV1 Test scenarios:Fix bugs for InteropDirectAccessToTSTypes Signed-off-by: zhongning --- ets2panda/linter/src/lib/TypeScriptLinter.ts | 48 +- .../src/lib/utils/functions/ProcessWrite.ts | 2 +- .../test/interop/ignore_files/unique_types.ts | 223 +++- .../linter/test/interop/unique_types.ets | 389 +++++- .../test/interop/unique_types.ets.arkts2.json | 1010 ++++++++++++++- .../interop/unique_types.ets.autofix.json | 1110 ++++++++++++++++- .../linter/test/interop/unique_types.ets.json | 573 ++++++++- .../test/interop/unique_types.ets.migrate.ets | 389 +++++- .../interop/unique_types.ets.migrate.json | 928 +++++++++++++- .../literals_as_prop_names.ets.arkts2.json | 10 - .../literals_as_prop_names.ets.autofix.json | 10 - .../literals_as_prop_names.ets.migrate.json | 10 - 12 files changed, 4507 insertions(+), 195 deletions(-) diff --git a/ets2panda/linter/src/lib/TypeScriptLinter.ts b/ets2panda/linter/src/lib/TypeScriptLinter.ts index 7a6dd23d96..30d053e829 100644 --- a/ets2panda/linter/src/lib/TypeScriptLinter.ts +++ b/ets2panda/linter/src/lib/TypeScriptLinter.ts @@ -1186,7 +1186,8 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { const baseExprSym = this.tsUtils.trueSymbolAtLocation(propertyAccessNode.expression); const baseExprType = this.tsTypeChecker.getTypeAtLocation(propertyAccessNode.expression); this.handleTsInterop(propertyAccessNode, () => { - this.checkInteropForPropertyAccess(propertyAccessNode); + const type = this.tsTypeChecker.getTypeAtLocation(propertyAccessNode.expression); + this.checkUsageOfTsTypes(type, propertyAccessNode.expression); }); this.propertyAccessExpressionForInterop(propertyAccessNode); if (this.isPrototypePropertyAccess(propertyAccessNode, exprSym, baseExprSym, baseExprType)) { @@ -1203,7 +1204,6 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { if (this.options.advancedClassChecks && this.tsUtils.isClassObjectExpression(propertyAccessNode.expression)) { this.incrementCounters(propertyAccessNode.expression, FaultID.ClassAsObject); } - if (!!baseExprSym && TsUtils.symbolHasEsObjectType(baseExprSym)) { const faultId = this.options.arkts2 ? FaultID.EsValueTypeError : FaultID.EsValueType; this.incrementCounters(propertyAccessNode, faultId); @@ -1343,44 +1343,16 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { } } - private checkInteropForPropertyAccess(pan: ts.PropertyAccessExpression): void { - if (ts.isBinaryExpression(pan.parent)) { - this.checkAssignmentOfPan(pan.parent, pan); - } else { - const type = this.tsTypeChecker.getTypeAtLocation(pan.expression); - this.checkUsageOfTsTypes(type, pan.expression); - } - } - - private checkAssignmentOfPan(binaryExpr: ts.BinaryExpression, pan: ts.PropertyAccessExpression): void { - if (binaryExpr.left !== pan) { - return; - } - - if (binaryExpr.operatorToken.kind !== ts.SyntaxKind.EqualsToken) { - this.incrementCounters(pan, FaultID.InteropDirectAccessToTSTypes); - return; - } - - const rhs = binaryExpr.right; - const lhs = binaryExpr.left as ts.PropertyAccessExpression; - - const autofix = this.autofixer?.fixInteropTsType(binaryExpr, lhs, rhs); - this.incrementCounters(pan, FaultID.InteropDirectAccessToTSTypes, autofix); - } - private checkUsageOfTsTypes(baseType: ts.Type, node: ts.Node): void { - if (this.tsUtils.isStringType(baseType)) { - return; - } - if (this.tsUtils.isStdNumberType(baseType)) { - return; - } - if (this.tsUtils.isStdBooleanType(baseType)) { - return; + const typeString = this.tsTypeChecker.typeToString(baseType); + if ( + TsUtils.isAnyType(baseType) || + TsUtils.isUnknownType(baseType) || + this.tsUtils.isStdFunctionType(baseType) || + typeString === 'symbol' + ) { + this.incrementCounters(node, FaultID.InteropDirectAccessToTSTypes); } - - this.incrementCounters(node, FaultID.InteropDirectAccessToTSTypes); } checkUnionTypes(propertyAccessNode: ts.PropertyAccessExpression): void { diff --git a/ets2panda/linter/src/lib/utils/functions/ProcessWrite.ts b/ets2panda/linter/src/lib/utils/functions/ProcessWrite.ts index bb379f6f83..ef8e100ae8 100644 --- a/ets2panda/linter/src/lib/utils/functions/ProcessWrite.ts +++ b/ets2panda/linter/src/lib/utils/functions/ProcessWrite.ts @@ -27,4 +27,4 @@ export async function processSyncErr(message: string): Promise { resolve('success'); }); }); -} \ No newline at end of file +} diff --git a/ets2panda/linter/test/interop/ignore_files/unique_types.ts b/ets2panda/linter/test/interop/ignore_files/unique_types.ts index 1c19752b63..f56856f73a 100644 --- a/ets2panda/linter/test/interop/ignore_files/unique_types.ts +++ b/ets2panda/linter/test/interop/ignore_files/unique_types.ts @@ -13,24 +13,217 @@ * limitations under the License. */ -type SomeType = { - name: string, +// any 类型 +let any_var: any = 10; +any_var = "string"; +export {any_var} + +// unknown类型 +export let unknown_var:unknown = 10; + +// Symbol类型 +export let symbol_var: symbol = Symbol("description"); + +// Function类型 +export let function_var: Function = function() { + console.log("Hello, World!"); + return true; +}; + +export class A { + static instance = new A(); } -enum X { - a = 0, - b = '1', +export interface B { + name:string } -type UnionString = "A" | "B"; -type TemplateLiteralType = `${UnionString}_id`; +//用例一 +export function throw_number() { + throw 123; +} -export let objectLiteralType: SomeType; -export let mixedEnumType: X; -export let intersectionType: SomeType & X; -export let templateLiteralType: TemplateLiteralType; +export function throw_string() { + throw "error"; +} -export function tsFunction() { - throw 123; -}; -export let stringType: string; +export function throw_boolean() { + throw true; +} + +export function throw_bigint() { + throw 111n; +} + +export function throw_obj() { + throw { name:'error' }; +} + +export function throw_error() { + throw new Error("error"); +} + +export class SubError extends Error { + extraField: number = 123; + foo() { return 456; } +} + +export function throwErrorSubClass() { + throw new SubError(); +} +export function throwRangeError() { + throw new RangeError(); +} + +//用例二 +export class ObjectLiteralClass { + name:string = "" +} + +export interface ObjectLiteralInter { + name:string +} +//用例三 +//类装饰器 +export function MyClassDecorator(klass: Object) {} + +//属性装饰器 +export function propertyDecorator(target: Object, propertyKey: string) { + console.log(Property Decorator called on: ${target.constructor.name} with propertyKey: ${propertyKey}); +} + +//方法装饰器 +export function methodDecorator(target: Object, propertyKey: string , descriptor: PropertyDescriptor) { + console.log(Method Decorator called on: ${target.constructor.name} with propertyKey: ${propertyKey}); + descriptor.value = function (...args: any[]) { + console.log(Called: ${propertyKey} with, args); + return args[0] * 2; + }; + return descriptor; +} + +// 参数装饰器 +export function parameterDecorator(target: Object, propertyKey: string , parameterIndex: number) { + console.log(Parameter Decorator called on: ${target.constructor.name} with propertyKey: ${propertyKey} and parameterIndex: ${parameterIndex}); +} + +// 访问器装饰器 +export function accessorDecorator(target: any, propertyKey: string, descriptor: PropertyDescriptor) { + const originalGet = descriptor.get; + const originalSet = descriptor.set; + + descriptor.get = function() { + console.log(Getter for ${propertyKey} called.); + return originalGet.apply(this); + }; + descriptor.set = function(value) { + console.log(Setter for ${propertyKey} called with value: ${value}); + originalSet.apply(this, [value]); + }; + return descriptor; +} + +// 装饰器工厂 +export function readonly1(isReadonly: boolean) { + return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) { + if (isReadonly) { + descriptor.writable = false; + } + }; +} + +export let num_boxed = new Number(123) +export let bool_boxed = new Boolean(true) +export let str_boxed = new String('hello') +export let bigint_boxed = BigInt(123n) + +export function ts_object_method(prx: any) { + Object.getOwnPropertyDescriptor(prx, "a") // arkts-interop-ts2s-ts-object-on-static-instance * 2 + arkts-limited-stdlib not undefined + Object.getOwnPropertyDescriptors(prx) // arkts-interop-ts2s-ts-object-on-static-instance * 2 not {} + Object.getOwnPropertyNames(prx) // arkts-interop-ts2s-ts-object-on-static-instance * 2 ["a"] + Object.hasOwn(prx, "a") // true + Object.isExtensible(prx) // arkts-interop-ts2s-ts-object-on-static-instance * 2 true + Object.isFrozen(prx) // arkts-interop-ts2s-ts-object-on-static-instance * 2 false + Object.isSealed(prx) // arkts-interop-ts2s-ts-object-on-static-instance * 2 false + Object.keys(prx) // arkts-interop-ts2s-ts-object-on-static-instance * 2 ["a"] + Object.setPrototypeOf(prx, {}) // arkts-interop-ts2s-ts-object-on-static-instance * 2 + arkts-limited-stdlib OK + Object.values(prx) // arkts-interop-ts2s-ts-object-on-static-instance * 2 + arkts-no-inferred-generic-params [1] + prx.hasOwnProperty("a") // true + prx.propertyIsEnumerable("a") // true +} + +export function ts_object_method_getOwnPropertyDescriptor(prx: any) { + return Object.getOwnPropertyDescriptor(prx, "a") // arkts-interop-ts2s-ts-object-on-static-instance * 2 + arkts-limited-stdlib not undefined +} +export function ts_object_method_getOwnPropertyDescriptors(prx: any) { + return Object.getOwnPropertyDescriptors(prx)// arkts-interop-ts2s-ts-object-on-static-instance * 2 + arkts-limited-stdlib not {} +} +export function ts_object_method_getOwnPropertyNames(prx: any) { + return Object.getOwnPropertyNames(prx) // arkts-interop-ts2s-ts-object-on-static-instance * 2 ["a"] +} +export function ts_object_method_hasOwn(prx: any) { + return Object.hasOwn(prx, "a") // true +} +export function ts_object_method_isExtensible(prx: any) { + return Object.isExtensible(prx) // arkts-interop-ts2s-ts-object-on-static-instance * 2 + arkts-limited-stdlib true +} +export function ts_object_method_isFrozen(prx: any) { + return Object.isFrozen(prx) // arkts-interop-ts2s-ts-object-on-static-instance * 2 + arkts-limited-stdlib false +} + +export function ts_object_method_isSealed(prx: any) { + return Object.isSealed(prx) // arkts-interop-ts2s-ts-object-on-static-instance * 2 + arkts-limited-stdlib false +} + +export function ts_object_method_keys(prx: any) { + return Object.keys(prx) // arkts-interop-ts2s-ts-object-on-static-instance * 3 ["a"] +} + +export function ts_object_method_setPrototypeOf(prx: any) { + return Object.setPrototypeOf(prx, {}) // arkts-limited-stdlib OK +} + +export function ts_object_method_values(prx: any) { + return Object.values(prx) // arkts-interop-ts2s-ts-object-on-static-instance * 2 + arkts-no-inferred-generic-params [1] +} + +interface Iface { + a:number +} +export let interObj:Iface = {a:1} + +export function ts_reflect_method(prx: any) { + Reflect.apply(prx.getName, {a: 12}) // arkts-interop-ts2s-ts-object-on-static-instance * 2 12 + Reflect.defineProperty(prx, 'newField', {value: 7}) // arkts-interop-ts2s-ts-object-on-static-instance * 2 true + Reflect.deleteProperty(prx, "a") // arkts-interop-ts2s-ts-object-on-static-instance * 2 true + Reflect.getOwnPropertyDescriptor(prx, "a") // arkts-interop-ts2s-ts-object-on-static-instance * 2 not undefined + Reflect.ownKeys(prx) // arkts-interop-ts2s-ts-object-on-static-instance * 2 ['a'] + Reflect.isExtensible(prx) // arkts-interop-ts2s-ts-object-on-static-instance * 2 true + Reflect.set(prx, 'newField', 7) // arkts-interop-ts2s-ts-object-on-static-instance * 2 true + Reflect.setPrototypeOf(prx, {}) // arkts-interop-ts2s-ts-object-on-static-instance * 2 true +} + +export function ts_reflect_method_apply(prx: any) { + Reflect.apply(prx.getName, {a: 12}) // arkts-interop-ts2s-ts-object-on-static-instance * 2 12 +} +export function ts_reflect_method_defineProperty(prx: any) { + Reflect.defineProperty(prx, 'newField', {value: 7}) // arkts-interop-ts2s-ts-object-on-static-instance * 2 true +} +export function ts_reflect_method_deleteProperty(prx: any) { + Reflect.deleteProperty(prx, "a") // arkts-interop-ts2s-ts-object-on-static-instance * 2 true +} +export function ts_reflect_method_getOwnPropertyDescriptor(prx: any) { + Reflect.getOwnPropertyDescriptor(prx, "a") // arkts-interop-ts2s-ts-object-on-static-instance * 2 not undefined +} +export function ts_reflect_method_ownKeys(prx: any) { + Reflect.ownKeys(prx) // arkts-interop-ts2s-ts-object-on-static-instance * 2 ['a'] +} +export function ts_reflect_method_isExtensible(prx: any) { + Reflect.isExtensible(prx) // arkts-interop-ts2s-ts-object-on-static-instance * 2 true +} +export function ts_reflect_method_set(prx: any) { + Reflect.set(prx, 'newField', 7) // arkts-interop-ts2s-ts-object-on-static-instance * 2 true +} +export function ts_reflect_method_setPrototypeOf(prx: any) { + Reflect.setPrototypeOf(prx, {}) // arkts-interop-ts2s-ts-object-on-static-instance * 2 true +} \ No newline at end of file diff --git a/ets2panda/linter/test/interop/unique_types.ets b/ets2panda/linter/test/interop/unique_types.ets index da2c034f53..9c16a54d2b 100644 --- a/ets2panda/linter/test/interop/unique_types.ets +++ b/ets2panda/linter/test/interop/unique_types.ets @@ -14,22 +14,387 @@ */ import { - objectLiteralType, - intersectionType, - tsFunction, - stringType, - enumType + any_var, + unknown_var, + symbol_var, + function_var, + A, + B, + TestHelper, + throw_number, + throw_string, + throw_boolean, + throw_bigint, + throw_obj, + throw_error, + throwErrorSubClass, + SubError, + throwRangeError, + ObjectLiteralClass, + ObjectLiteralInter, + MyClassDecorator, + propertyDecorator, + methodDecorator, + parameterDecorator, + accessorDecorator, + readonly1, + num_boxed, + bool_boxed, + str_boxed, + bigint_boxed, + ts_object_method, + ts_object_method_getOwnPropertyDescriptor, + ts_object_method_getOwnPropertyDescriptors, + ts_object_method_getOwnPropertyNames, + ts_object_method_hasOwn, + ts_object_method_isExtensible, + ts_object_method_isFrozen, + ts_object_method_isSealed, + ts_object_method_keys, + ts_object_method_values, + interObj, + ts_reflect_method, + ts_reflect_method_apply, + ts_reflect_method_defineProperty, + ts_reflect_method_deleteProperty, + ts_reflect_method_getOwnPropertyDescriptor, + ts_reflect_method_ownKeys, + ts_reflect_method_isExtensible, + ts_reflect_method_set, + ts_reflect_method_setPrototypeOf } from "./ignore_files/unique_types"; -objectLiteralType.name = "test" -intersectionType.name = "test"; +typeof any_var === 'object'; +typeof unknown_var === 'number'; +typeof symbol_var === 'object'; +function_var() === true; +A.instance; +let obj: B = { name: "hello" }; -try { -tsFunction(); -} catch (e) { +export function test_ts_non_standard_exception(testCaseRet: Array) { + let test_helper = new TestHelper("TEST_TS_NON_STANDARD_EXCEPTION"); + + test_helper.test(() => { + try { + throw_number(); // arkts-interop-ts2s-ts-exception + } catch (e) { + return e as number === 123; + } + return false; + }, "e as number === 123"); + + test_helper.test(() => { + try { + throw_boolean(); // arkts-interop-ts2s-ts-exception + } catch (e) { + return e as boolean === true; + } + return false; + }, "e as boolean === true"); + + test_helper.test(() => { + try { + throw_bigint(); // arkts-interop-ts2s-ts-exception + } catch (e) { + return e as bigint === 111n; + } + return false; + }, "e as bigint === 111n"); + + test_helper.test(() => { + try { + throw_string(); // arkts-interop-ts2s-ts-exception + } catch (e) { + return e as string === "error"; + } + return false; + }, "e as string === "error""); + + test_helper.test(() => { + try { + throw_obj(); // arkts-interop-ts2s-ts-exception + } catch (e) { + return e.name === "error"; + } + return false; + }, "e.name === "error""); + + test_helper.test(() => { + try { + throw_error(); + } catch (e) { + let errObj: Error = e as Error; + return errObj.name === "error"; + } + return false; + }, "errObj.name === "error""); + + test_helper.test(() => { + try { + throwErrorSubClass(); // arkts-interop-ts2s-ts-exception + } catch (e) { + let errObj = e as SubError; + return errObj.extraField === 123 && errObj.foo() === 456; + } + return false; + }, "errObj.extraField === 123 && errObj.foo() === 456"); + + test_helper.test(() => { + let flag = false + try { + throwRangeError(); // arkts-interop-ts2s-ts-exception + } catch (e) { + let errObj: RangeError = e as RangeError; + return errObj instanceof RangeError; + } + return flag; + }, "Throw: throwRangeError"); + + testCaseRet.push(test_helper.done()); +} + +export function test_object_literal(testCaseRet: Array) { + let test_helper = new TestHelper("TEST_OBJECT_LITERAL"); + + test_helper.test(() => { + let obj: ObjectLiteralClass = { name: "hello" }; // arkts-obj-literal-generate-class-instance + return obj.name === "hello" && obj instanceof ObjectLiteralClass; + }, "obj.name === "hello""); + + test_helper.test(() => { + let obj: ObjectLiteralInter = { name: "hello" }; // arkts-obj-literal-generate-class-instance + return obj.name === "hello" && obj instanceof ObjectLiteralInter; + }, "obj.name === "hello""); + + testCaseRet.push(test_helper.done()); +} + +// 1 ArkTS使用TS装饰器 +// 规则名 arkts-interop-ts2s-no-ts-decorator +// case 1 类装饰器 top level +@MyClassDecorator // arkts-no-ts-decorators + arkts-interop-ts2s-no-ts-decorator +class K {} + +//case 2 类属性装饰器 +class MyClass { + @propertyDecorator// arkts-no-ts-decorators + myProperty: string; +} + +//case 3 方法装饰器 +class MathFunctions { + @methodDecorator// arkts-no-ts-decorators + double1(value: number): number { + return value; + } +} + +//case 4 方法装饰器 +class MyClass1 { + log(value: string, @parameterDecorator metadata: any) {// arkts-no-ts-decorators + console.log(Logged: ${value}); + } +} + +//case 5 访问器装饰器 +class Person { + private _name: string; + @accessorDecorator// arkts-no-ts-decorators + get name(): string { + return this._name; + } + set name(value: string) { + this._name = value; + } +} + +//case 6 访问器工厂 +class Person1 { + private _age: number; + @readonly(true)// arkts-no-ts-decorators + get age(): number { + return this._age; + } + set age(value: number) { + this._age = value; + } +} + +namespace NS{ + // case 7 类装饰器 top level + @MyClassDecorator// arkts-no-ts-decorators + arkts-interop-ts2s-no-ts-decorator + class K {} + + //case 8 类属性装饰器 + class MyClass { + @propertyDecorator// arkts-no-ts-decorators + myProperty: string; + } + + //case 9 方法装饰器 + class MathFunctions { + @methodDecorator// arkts-no-ts-decorators + double1(value: number): number { + return value; + } + } + + //case 10 方法装饰器 + class MyClass1 { + log(value: string, @parameterDecorator metadata: any) {// arkts-no-ts-decorators + console.log(Logged: ${value}); + } + } + + //case 11 访问器装饰器 + class Person { + private _name: string; + constructor(name: string) { + this._name = name; + } + @accessorDecorator// arkts-no-ts-decorators + get name(): string { + return this._name; + } + set name(value: string) { + this._name = value; + } + } + + //case 12 访问器工厂 + class Person1 { + private _age: number; + constructor(age: number) { + this._age = age; + } + @readonly1(true)// arkts-no-ts-decorators + get age(): number { + return this._age; + } + set age(value: number) { + this._age = value; + } + } +} + +export function test_ts_boxed_type(testCaseRet: Array) { + let test_helper = new TestHelper("TEST_TS_BOXED_TYPE"); + + test_helper.test(() => { + return typeof num_boxed === object; + }, "typeof num_boxed === object"); + + test_helper.test(() => { + return typeof bool_boxed === object; + }, "typeof bool_boxed === object"); + + test_helper.test(() => { + return typeof str_boxed === object; + }, "typeof str_boxed === object"); + + test_helper.test(() => { + return typeof bigint_boxed === object; + }, "typeof bigint_boxed === object"); + testCaseRet.push(test_helper.done()); +} + +export function test_ts_object_method(testCaseRet: Array) { + let test_helper = new TestHelper("TEST_TS_OBJECT_METHOD"); + + test_helper.test(() => { + ts_object_method(new Object2()) + ts_object_method_getOwnPropertyDescriptor(new Object2()) + ts_object_method_getOwnPropertyDescriptors(new Object2()) + ts_object_method_getOwnPropertyNames(new Object2()) + ts_object_method_hasOwn(new Object2()) + ts_object_method_isExtensible(new Object2()) + ts_object_method_isFrozen(new Object2()) + ts_object_method_isSealed(new Object2()) + ts_object_method_keys(new Object2()) + ts_object_method_keys(new Object2()) + ts_object_method_values(new Object2()) + return true; + }, "true"); + + test_helper.test(() => { + interface Iface { + a:number + } + let a1:Iface = {a:1} + ts_object_method(a1) + ts_object_method_getOwnPropertyDescriptor(a1) + ts_object_method_getOwnPropertyDescriptors(a1) + ts_object_method_getOwnPropertyNames(a1) + ts_object_method_hasOwn(a1) + ts_object_method_isExtensible(a1) + ts_object_method_isFrozen(a1) + ts_object_method_isSealed(a1) + ts_object_method_keys(a1) + ts_object_method_keys(a1) + ts_object_method_values(a1) + return true; + }, "true"); + + test_helper.test(() => { + ts_object_method(interObj) + return true; + }, "false"); + + testCaseRet.push(test_helper.done()); +} + +class Reflect2 { + a: string = 'hello' + getName() { return this.a } } -stringType = "test" //should pass +// 5 Object内置方法作用在ArkTS对象 +// 规则名 arkts-interop-ts2s-ts-object-on-static-instance +export function test_ts_reflect_method(testCaseRet: Array) { + let test_helper = new TestHelper("TEST_TS_REFLECT_METHOD"); + test_helper.test(() => { + ts_reflect_method(new Reflect2()) + ts_reflect_method_apply(new Reflect2()) + ts_reflect_method_defineProperty(new Reflect2()) + ts_reflect_method_deleteProperty(new Reflect2()) + ts_reflect_method_getOwnPropertyDescriptor(new Reflect2()) + ts_reflect_method_ownKeys(new Reflect2()) + ts_reflect_method_isExtensible(new Reflect2()) + ts_reflect_method_set(new Reflect2()) + ts_reflect_method_setPrototypeOf(new Reflect2()) + return true; + }, "reflect class 1.2 "); + + test_helper.test(() => { + interface Iface { + a:number + } + let a1:Iface = {a:1} + ts_reflect_method(a1) + ts_reflect_method_apply(a1) + ts_reflect_method_defineProperty(a1) + ts_reflect_method_deleteProperty(a1) + ts_reflect_method_getOwnPropertyDescriptor(a1) + ts_reflect_method_ownKeys(a1) + ts_reflect_method_isExtensible(a1) + ts_reflect_method_set(a1) + ts_reflect_method_setPrototypeOf(a1) + return true; + }, "reflect interface 1.2"); + + test_helper.test(() => { + ts_reflect_method(interObj) + ts_reflect_method_apply(interObj) + ts_reflect_method_defineProperty(interObj) + ts_reflect_method_deleteProperty(interObj) + ts_reflect_method_getOwnPropertyDescriptor(interObj) + ts_reflect_method_ownKeys(interObj) + ts_reflect_method_isExtensible(interObj) + ts_reflect_method_set(interObj) + ts_reflect_method_setPrototypeOf(interObj) + return true; + }, "reflect interObj 1.0 "); -enumType = "A"; //should fail + testCaseRet.push(test_helper.done()); +} \ No newline at end of file diff --git a/ets2panda/linter/test/interop/unique_types.ets.arkts2.json b/ets2panda/linter/test/interop/unique_types.ets.arkts2.json index b3274fd874..0a842e31ba 100644 --- a/ets2panda/linter/test/interop/unique_types.ets.arkts2.json +++ b/ets2panda/linter/test/interop/unique_types.ets.arkts2.json @@ -15,63 +15,1023 @@ ], "result": [ { - "line": 24, - "column": 1, - "endLine": 24, - "endColumn": 23, + "line": 68, + "column": 8, + "endLine": 68, + "endColumn": 15, "problem": "InteropDirectAccessToTSTypes", "suggest": "", "rule": "Cannot access typescript types directly (arkts-interop-ts2s-static-access-ts-type)", "severity": "ERROR" }, { - "line": 26, - "column": 1, - "endLine": 26, - "endColumn": 22, + "line": 69, + "column": 8, + "endLine": 69, + "endColumn": 19, "problem": "InteropDirectAccessToTSTypes", "suggest": "", "rule": "Cannot access typescript types directly (arkts-interop-ts2s-static-access-ts-type)", "severity": "ERROR" }, { - "line": 29, + "line": 70, + "column": 8, + "endLine": 70, + "endColumn": 18, + "problem": "InteropDirectAccessToTSTypes", + "suggest": "", + "rule": "Cannot access typescript types directly (arkts-interop-ts2s-static-access-ts-type)", + "severity": "ERROR" + }, + { + "line": 71, "column": 1, - "endLine": 29, + "endLine": 71, "endColumn": 13, - "problem": "InteropTSFunctionInvoke", + "problem": "ExplicitFunctionType", "suggest": "", - "rule": "Trying to catch typescript errors is not permitted (arkts-interop-ts2s-ts-exception)", + "rule": "The function type should be explicit (arkts-no-ts-like-function-call)", "severity": "ERROR" }, { - "line": 29, + "line": 71, "column": 1, - "endLine": 29, - "endColumn": 11, + "endLine": 71, + "endColumn": 13, "problem": "InteropDirectAccessToTSTypes", "suggest": "", "rule": "Cannot access typescript types directly (arkts-interop-ts2s-static-access-ts-type)", "severity": "ERROR" }, { - "line": 33, + "line": 76, + "column": 7, + "endLine": 76, + "endColumn": 69, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 76, + "column": 25, + "endLine": 76, + "endColumn": 35, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 80, + "column": 7, + "endLine": 80, + "endColumn": 21, + "problem": "InteropTSFunctionInvoke", + "suggest": "", + "rule": "Trying to catch typescript errors is not permitted (arkts-interop-ts2s-ts-exception)", + "severity": "ERROR" + }, + { + "line": 82, + "column": 30, + "endLine": 82, + "endColumn": 33, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 89, + "column": 7, + "endLine": 89, + "endColumn": 22, + "problem": "InteropTSFunctionInvoke", + "suggest": "", + "rule": "Trying to catch typescript errors is not permitted (arkts-interop-ts2s-ts-exception)", + "severity": "ERROR" + }, + { + "line": 98, + "column": 7, + "endLine": 98, + "endColumn": 21, + "problem": "InteropTSFunctionInvoke", + "suggest": "", + "rule": "Trying to catch typescript errors is not permitted (arkts-interop-ts2s-ts-exception)", + "severity": "ERROR" + }, + { + "line": 107, + "column": 7, + "endLine": 107, + "endColumn": 21, + "problem": "InteropTSFunctionInvoke", + "suggest": "", + "rule": "Trying to catch typescript errors is not permitted (arkts-interop-ts2s-ts-exception)", + "severity": "ERROR" + }, + { + "line": 116, + "column": 7, + "endLine": 116, + "endColumn": 18, + "problem": "InteropTSFunctionInvoke", + "suggest": "", + "rule": "Trying to catch typescript errors is not permitted (arkts-interop-ts2s-ts-exception)", + "severity": "ERROR" + }, + { + "line": 138, + "column": 36, + "endLine": 138, + "endColumn": 39, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 138, + "column": 60, + "endLine": 138, + "endColumn": 63, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 158, + "column": 7, + "endLine": 158, + "endColumn": 58, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 158, + "column": 25, + "endLine": 158, + "endColumn": 35, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 176, "column": 1, - "endLine": 33, + "endLine": 176, + "endColumn": 18, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 181, + "column": 3, + "endLine": 181, + "endColumn": 21, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 187, + "column": 3, + "endLine": 187, + "endColumn": 19, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 195, + "column": 22, + "endLine": 195, + "endColumn": 41, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 195, + "column": 52, + "endLine": 195, + "endColumn": 55, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 196, + "column": 27, + "endLine": 196, + "endColumn": 32, + "problem": "ObjectLiteralProperty", + "suggest": "", + "rule": "Object literal properties can only contain name-value pairs (arkts-obj-literal-props)", + "severity": "ERROR" + }, + { + "line": 203, + "column": 3, + "endLine": 203, + "endColumn": 21, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 215, + "column": 3, + "endLine": 215, + "endColumn": 18, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 226, + "column": 3, + "endLine": 226, "endColumn": 20, - "problem": "InteropDirectAccessToTSTypes", + "problem": "DecoratorsNotSupported", "suggest": "", - "rule": "Cannot access typescript types directly (arkts-interop-ts2s-static-access-ts-type)", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", "severity": "ERROR" }, { - "line": 33, - "column": 1, - "endLine": 33, - "endColumn": 11, - "problem": "InteropDirectAccessToTSTypes", + "line": 231, + "column": 5, + "endLine": 231, + "endColumn": 23, + "problem": "DecoratorsNotSupported", "suggest": "", - "rule": "Cannot access typescript types directly (arkts-interop-ts2s-static-access-ts-type)", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 237, + "column": 5, + "endLine": 237, + "endColumn": 21, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 245, + "column": 24, + "endLine": 245, + "endColumn": 43, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 245, + "column": 54, + "endLine": 245, + "endColumn": 57, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 246, + "column": 29, + "endLine": 246, + "endColumn": 34, + "problem": "ObjectLiteralProperty", + "suggest": "", + "rule": "Object literal properties can only contain name-value pairs (arkts-obj-literal-props)", + "severity": "ERROR" + }, + { + "line": 256, + "column": 5, + "endLine": 256, + "endColumn": 23, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 271, + "column": 5, + "endLine": 271, + "endColumn": 21, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 282, + "column": 7, + "endLine": 282, + "endColumn": 57, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 282, + "column": 25, + "endLine": 282, + "endColumn": 35, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 303, + "column": 7, + "endLine": 303, + "endColumn": 60, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 303, + "column": 25, + "endLine": 303, + "endColumn": 35, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 306, + "column": 5, + "endLine": 306, + "endColumn": 36, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 306, + "column": 26, + "endLine": 306, + "endColumn": 33, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 307, + "column": 5, + "endLine": 307, + "endColumn": 61, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 307, + "column": 51, + "endLine": 307, + "endColumn": 58, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 308, + "column": 5, + "endLine": 308, + "endColumn": 62, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 308, + "column": 52, + "endLine": 308, + "endColumn": 59, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 309, + "column": 46, + "endLine": 309, + "endColumn": 53, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 310, + "column": 5, + "endLine": 310, + "endColumn": 43, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 310, + "column": 33, + "endLine": 310, + "endColumn": 40, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 311, + "column": 5, + "endLine": 311, + "endColumn": 49, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 311, + "column": 39, + "endLine": 311, + "endColumn": 46, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 312, + "column": 5, + "endLine": 312, + "endColumn": 45, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 312, + "column": 35, + "endLine": 312, + "endColumn": 42, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 313, + "column": 5, + "endLine": 313, + "endColumn": 45, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 313, + "column": 35, + "endLine": 313, + "endColumn": 42, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 314, + "column": 5, + "endLine": 314, + "endColumn": 41, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 314, + "column": 31, + "endLine": 314, + "endColumn": 38, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 315, + "column": 5, + "endLine": 315, + "endColumn": 41, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 315, + "column": 31, + "endLine": 315, + "endColumn": 38, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 316, + "column": 33, + "endLine": 316, + "endColumn": 40, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 324, + "column": 23, + "endLine": 324, + "endColumn": 24, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 325, + "column": 5, + "endLine": 325, + "endColumn": 25, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 326, + "column": 5, + "endLine": 326, + "endColumn": 50, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 327, + "column": 5, + "endLine": 327, + "endColumn": 51, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 329, + "column": 5, + "endLine": 329, + "endColumn": 32, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 330, + "column": 5, + "endLine": 330, + "endColumn": 38, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 331, + "column": 5, + "endLine": 331, + "endColumn": 34, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 332, + "column": 5, + "endLine": 332, + "endColumn": 34, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 333, + "column": 5, + "endLine": 333, + "endColumn": 30, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 334, + "column": 5, + "endLine": 334, + "endColumn": 30, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 340, + "column": 5, + "endLine": 340, + "endColumn": 31, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 355, + "column": 7, + "endLine": 355, + "endColumn": 61, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 355, + "column": 25, + "endLine": 355, + "endColumn": 35, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 357, + "column": 5, + "endLine": 357, + "endColumn": 38, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 358, + "column": 5, + "endLine": 358, + "endColumn": 44, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 359, + "column": 5, + "endLine": 359, + "endColumn": 53, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 360, + "column": 5, + "endLine": 360, + "endColumn": 53, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 361, + "column": 5, + "endLine": 361, + "endColumn": 63, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 362, + "column": 5, + "endLine": 362, + "endColumn": 46, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 363, + "column": 5, + "endLine": 363, + "endColumn": 51, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 364, + "column": 5, + "endLine": 364, + "endColumn": 42, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 365, + "column": 5, + "endLine": 365, + "endColumn": 53, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 373, + "column": 23, + "endLine": 373, + "endColumn": 24, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 374, + "column": 5, + "endLine": 374, + "endColumn": 26, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 375, + "column": 5, + "endLine": 375, + "endColumn": 32, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 376, + "column": 5, + "endLine": 376, + "endColumn": 41, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 377, + "column": 5, + "endLine": 377, + "endColumn": 41, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 378, + "column": 5, + "endLine": 378, + "endColumn": 51, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 379, + "column": 5, + "endLine": 379, + "endColumn": 34, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 380, + "column": 5, + "endLine": 380, + "endColumn": 39, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 381, + "column": 5, + "endLine": 381, + "endColumn": 30, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 382, + "column": 5, + "endLine": 382, + "endColumn": 41, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 387, + "column": 5, + "endLine": 387, + "endColumn": 32, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 388, + "column": 5, + "endLine": 388, + "endColumn": 38, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 389, + "column": 5, + "endLine": 389, + "endColumn": 47, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 390, + "column": 5, + "endLine": 390, + "endColumn": 47, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 391, + "column": 5, + "endLine": 391, + "endColumn": 57, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 392, + "column": 5, + "endLine": 392, + "endColumn": 40, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 393, + "column": 5, + "endLine": 393, + "endColumn": 45, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 394, + "column": 5, + "endLine": 394, + "endColumn": 36, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 395, + "column": 5, + "endLine": 395, + "endColumn": 47, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 182, + "column": 3, + "endLine": 182, + "endColumn": 13, + "problem": "StrictDiagnostic", + "suggest": "Property 'myProperty' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property 'myProperty' has no initializer and is not definitely assigned in the constructor.", + "severity": "ERROR" + }, + { + "line": 202, + "column": 11, + "endLine": 202, + "endColumn": 16, + "problem": "StrictDiagnostic", + "suggest": "Property '_name' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property '_name' has no initializer and is not definitely assigned in the constructor.", + "severity": "ERROR" + }, + { + "line": 214, + "column": 11, + "endLine": 214, + "endColumn": 15, + "problem": "StrictDiagnostic", + "suggest": "Property '_age' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property '_age' has no initializer and is not definitely assigned in the constructor.", + "severity": "ERROR" + }, + { + "line": 232, + "column": 5, + "endLine": 232, + "endColumn": 15, + "problem": "StrictDiagnostic", + "suggest": "Property 'myProperty' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property 'myProperty' has no initializer and is not definitely assigned in the constructor.", "severity": "ERROR" } ] diff --git a/ets2panda/linter/test/interop/unique_types.ets.autofix.json b/ets2panda/linter/test/interop/unique_types.ets.autofix.json index a6deb3a499..dc9b95cad8 100644 --- a/ets2panda/linter/test/interop/unique_types.ets.autofix.json +++ b/ets2panda/linter/test/interop/unique_types.ets.autofix.json @@ -15,85 +15,1111 @@ ], "result": [ { - "line": 24, - "column": 1, - "endLine": 24, - "endColumn": 23, + "line": 68, + "column": 8, + "endLine": 68, + "endColumn": 15, + "problem": "InteropDirectAccessToTSTypes", + "suggest": "", + "rule": "Cannot access typescript types directly (arkts-interop-ts2s-static-access-ts-type)", + "severity": "ERROR" + }, + { + "line": 69, + "column": 8, + "endLine": 69, + "endColumn": 19, + "problem": "InteropDirectAccessToTSTypes", + "suggest": "", + "rule": "Cannot access typescript types directly (arkts-interop-ts2s-static-access-ts-type)", + "severity": "ERROR" + }, + { + "line": 70, + "column": 8, + "endLine": 70, + "endColumn": 18, "problem": "InteropDirectAccessToTSTypes", + "suggest": "", + "rule": "Cannot access typescript types directly (arkts-interop-ts2s-static-access-ts-type)", + "severity": "ERROR" + }, + { + "line": 71, + "column": 1, + "endLine": 71, + "endColumn": 13, + "problem": "ExplicitFunctionType", "autofix": [ { - "start": 731, - "end": 762, - "replacementText": "objectLiteralType.setPropertyByName('name',ESValue.wrap(\"test\"))", - "line": 24, + "replacementText": "function_var.unsafeCall", + "start": 1767, + "end": 1779, + "line": 71, "column": 1, - "endLine": 24, - "endColumn": 23 + "endLine": 71, + "endColumn": 13 } ], "suggest": "", - "rule": "Cannot access typescript types directly (arkts-interop-ts2s-static-access-ts-type)", + "rule": "The function type should be explicit (arkts-no-ts-like-function-call)", "severity": "ERROR" }, { - "line": 26, + "line": 71, "column": 1, - "endLine": 26, - "endColumn": 22, + "endLine": 71, + "endColumn": 13, "problem": "InteropDirectAccessToTSTypes", + "suggest": "", + "rule": "Cannot access typescript types directly (arkts-interop-ts2s-static-access-ts-type)", + "severity": "ERROR" + }, + { + "line": 76, + "column": 7, + "endLine": 76, + "endColumn": 69, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 76, + "column": 25, + "endLine": 76, + "endColumn": 35, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 80, + "column": 7, + "endLine": 80, + "endColumn": 21, + "problem": "InteropTSFunctionInvoke", + "suggest": "", + "rule": "Trying to catch typescript errors is not permitted (arkts-interop-ts2s-ts-exception)", + "severity": "ERROR" + }, + { + "line": 82, + "column": 30, + "endLine": 82, + "endColumn": 33, + "problem": "NumericSemantics", "autofix": [ { - "start": 764, - "end": 794, - "replacementText": "intersectionType.setPropertyByName('name',ESValue.wrap(\"test\"))", - "line": 26, - "column": 1, - "endLine": 26, - "endColumn": 22 + "start": 2118, + "end": 2121, + "replacementText": "123.0", + "line": 82, + "column": 30, + "endLine": 82, + "endColumn": 33 } ], "suggest": "", - "rule": "Cannot access typescript types directly (arkts-interop-ts2s-static-access-ts-type)", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, { - "line": 29, - "column": 1, - "endLine": 29, - "endColumn": 13, + "line": 89, + "column": 7, + "endLine": 89, + "endColumn": 22, "problem": "InteropTSFunctionInvoke", "suggest": "", "rule": "Trying to catch typescript errors is not permitted (arkts-interop-ts2s-ts-exception)", "severity": "ERROR" }, { - "line": 29, - "column": 1, - "endLine": 29, - "endColumn": 11, - "problem": "InteropDirectAccessToTSTypes", + "line": 98, + "column": 7, + "endLine": 98, + "endColumn": 21, + "problem": "InteropTSFunctionInvoke", "suggest": "", - "rule": "Cannot access typescript types directly (arkts-interop-ts2s-static-access-ts-type)", + "rule": "Trying to catch typescript errors is not permitted (arkts-interop-ts2s-ts-exception)", "severity": "ERROR" }, { - "line": 33, + "line": 107, + "column": 7, + "endLine": 107, + "endColumn": 21, + "problem": "InteropTSFunctionInvoke", + "suggest": "", + "rule": "Trying to catch typescript errors is not permitted (arkts-interop-ts2s-ts-exception)", + "severity": "ERROR" + }, + { + "line": 116, + "column": 7, + "endLine": 116, + "endColumn": 18, + "problem": "InteropTSFunctionInvoke", + "suggest": "", + "rule": "Trying to catch typescript errors is not permitted (arkts-interop-ts2s-ts-exception)", + "severity": "ERROR" + }, + { + "line": 138, + "column": 36, + "endLine": 138, + "endColumn": 39, + "problem": "NumericSemantics", + "autofix": [ + { + "start": 3384, + "end": 3387, + "replacementText": "123.0", + "line": 138, + "column": 36, + "endLine": 138, + "endColumn": 39 + } + ], + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 138, + "column": 60, + "endLine": 138, + "endColumn": 63, + "problem": "NumericSemantics", + "autofix": [ + { + "start": 3408, + "end": 3411, + "replacementText": "456.0", + "line": 138, + "column": 60, + "endLine": 138, + "endColumn": 63 + } + ], + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 158, + "column": 7, + "endLine": 158, + "endColumn": 58, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 158, + "column": 25, + "endLine": 158, + "endColumn": 35, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 176, "column": 1, - "endLine": 33, + "endLine": 176, + "endColumn": 18, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 181, + "column": 3, + "endLine": 181, + "endColumn": 21, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 187, + "column": 3, + "endLine": 187, + "endColumn": 19, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 195, + "column": 22, + "endLine": 195, + "endColumn": 41, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 195, + "column": 52, + "endLine": 195, + "endColumn": 55, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 196, + "column": 27, + "endLine": 196, + "endColumn": 32, + "problem": "ObjectLiteralProperty", + "autofix": [ + { + "start": 4999, + "end": 5004, + "replacementText": "value: value", + "line": 196, + "column": 27, + "endLine": 196, + "endColumn": 32 + } + ], + "suggest": "", + "rule": "Object literal properties can only contain name-value pairs (arkts-obj-literal-props)", + "severity": "ERROR" + }, + { + "line": 203, + "column": 3, + "endLine": 203, + "endColumn": 21, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 215, + "column": 3, + "endLine": 215, + "endColumn": 18, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 226, + "column": 3, + "endLine": 226, "endColumn": 20, - "problem": "InteropDirectAccessToTSTypes", + "problem": "DecoratorsNotSupported", "suggest": "", - "rule": "Cannot access typescript types directly (arkts-interop-ts2s-static-access-ts-type)", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", "severity": "ERROR" }, { - "line": 33, - "column": 1, - "endLine": 33, - "endColumn": 11, - "problem": "InteropDirectAccessToTSTypes", + "line": 231, + "column": 5, + "endLine": 231, + "endColumn": 23, + "problem": "DecoratorsNotSupported", "suggest": "", - "rule": "Cannot access typescript types directly (arkts-interop-ts2s-static-access-ts-type)", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 237, + "column": 5, + "endLine": 237, + "endColumn": 21, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 245, + "column": 24, + "endLine": 245, + "endColumn": 43, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 245, + "column": 54, + "endLine": 245, + "endColumn": 57, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 246, + "column": 29, + "endLine": 246, + "endColumn": 34, + "problem": "ObjectLiteralProperty", + "autofix": [ + { + "start": 5984, + "end": 5989, + "replacementText": "value: value", + "line": 246, + "column": 29, + "endLine": 246, + "endColumn": 34 + } + ], + "suggest": "", + "rule": "Object literal properties can only contain name-value pairs (arkts-obj-literal-props)", + "severity": "ERROR" + }, + { + "line": 256, + "column": 5, + "endLine": 256, + "endColumn": 23, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 271, + "column": 5, + "endLine": 271, + "endColumn": 21, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 282, + "column": 7, + "endLine": 282, + "endColumn": 57, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 282, + "column": 25, + "endLine": 282, + "endColumn": 35, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 303, + "column": 7, + "endLine": 303, + "endColumn": 60, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 303, + "column": 25, + "endLine": 303, + "endColumn": 35, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 306, + "column": 5, + "endLine": 306, + "endColumn": 36, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 306, + "column": 26, + "endLine": 306, + "endColumn": 33, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 307, + "column": 5, + "endLine": 307, + "endColumn": 61, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 307, + "column": 51, + "endLine": 307, + "endColumn": 58, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 308, + "column": 5, + "endLine": 308, + "endColumn": 62, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 308, + "column": 52, + "endLine": 308, + "endColumn": 59, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 309, + "column": 46, + "endLine": 309, + "endColumn": 53, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 310, + "column": 5, + "endLine": 310, + "endColumn": 43, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 310, + "column": 33, + "endLine": 310, + "endColumn": 40, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 311, + "column": 5, + "endLine": 311, + "endColumn": 49, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 311, + "column": 39, + "endLine": 311, + "endColumn": 46, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 312, + "column": 5, + "endLine": 312, + "endColumn": 45, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 312, + "column": 35, + "endLine": 312, + "endColumn": 42, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 313, + "column": 5, + "endLine": 313, + "endColumn": 45, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 313, + "column": 35, + "endLine": 313, + "endColumn": 42, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 314, + "column": 5, + "endLine": 314, + "endColumn": 41, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 314, + "column": 31, + "endLine": 314, + "endColumn": 38, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 315, + "column": 5, + "endLine": 315, + "endColumn": 41, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 315, + "column": 31, + "endLine": 315, + "endColumn": 38, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 316, + "column": 33, + "endLine": 316, + "endColumn": 40, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 324, + "column": 23, + "endLine": 324, + "endColumn": 24, + "problem": "NumericSemantics", + "autofix": [ + { + "start": 7971, + "end": 7972, + "replacementText": "1.0", + "line": 324, + "column": 23, + "endLine": 324, + "endColumn": 24 + } + ], + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 325, + "column": 5, + "endLine": 325, + "endColumn": 25, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 326, + "column": 5, + "endLine": 326, + "endColumn": 50, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 327, + "column": 5, + "endLine": 327, + "endColumn": 51, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 329, + "column": 5, + "endLine": 329, + "endColumn": 32, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 330, + "column": 5, + "endLine": 330, + "endColumn": 38, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 331, + "column": 5, + "endLine": 331, + "endColumn": 34, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 332, + "column": 5, + "endLine": 332, + "endColumn": 34, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 333, + "column": 5, + "endLine": 333, + "endColumn": 30, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 334, + "column": 5, + "endLine": 334, + "endColumn": 30, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 340, + "column": 5, + "endLine": 340, + "endColumn": 31, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 355, + "column": 7, + "endLine": 355, + "endColumn": 61, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 355, + "column": 25, + "endLine": 355, + "endColumn": 35, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 357, + "column": 5, + "endLine": 357, + "endColumn": 38, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 358, + "column": 5, + "endLine": 358, + "endColumn": 44, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 359, + "column": 5, + "endLine": 359, + "endColumn": 53, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 360, + "column": 5, + "endLine": 360, + "endColumn": 53, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 361, + "column": 5, + "endLine": 361, + "endColumn": 63, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 362, + "column": 5, + "endLine": 362, + "endColumn": 46, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 363, + "column": 5, + "endLine": 363, + "endColumn": 51, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 364, + "column": 5, + "endLine": 364, + "endColumn": 42, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 365, + "column": 5, + "endLine": 365, + "endColumn": 53, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 373, + "column": 23, + "endLine": 373, + "endColumn": 24, + "problem": "NumericSemantics", + "autofix": [ + { + "start": 9425, + "end": 9426, + "replacementText": "1.0", + "line": 373, + "column": 23, + "endLine": 373, + "endColumn": 24 + } + ], + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 374, + "column": 5, + "endLine": 374, + "endColumn": 26, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 375, + "column": 5, + "endLine": 375, + "endColumn": 32, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 376, + "column": 5, + "endLine": 376, + "endColumn": 41, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 377, + "column": 5, + "endLine": 377, + "endColumn": 41, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 378, + "column": 5, + "endLine": 378, + "endColumn": 51, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 379, + "column": 5, + "endLine": 379, + "endColumn": 34, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 380, + "column": 5, + "endLine": 380, + "endColumn": 39, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 381, + "column": 5, + "endLine": 381, + "endColumn": 30, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 382, + "column": 5, + "endLine": 382, + "endColumn": 41, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 387, + "column": 5, + "endLine": 387, + "endColumn": 32, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 388, + "column": 5, + "endLine": 388, + "endColumn": 38, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 389, + "column": 5, + "endLine": 389, + "endColumn": 47, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 390, + "column": 5, + "endLine": 390, + "endColumn": 47, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 391, + "column": 5, + "endLine": 391, + "endColumn": 57, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 392, + "column": 5, + "endLine": 392, + "endColumn": 40, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 393, + "column": 5, + "endLine": 393, + "endColumn": 45, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 394, + "column": 5, + "endLine": 394, + "endColumn": 36, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 395, + "column": 5, + "endLine": 395, + "endColumn": 47, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 182, + "column": 3, + "endLine": 182, + "endColumn": 13, + "problem": "StrictDiagnostic", + "suggest": "Property 'myProperty' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property 'myProperty' has no initializer and is not definitely assigned in the constructor.", + "severity": "ERROR" + }, + { + "line": 202, + "column": 11, + "endLine": 202, + "endColumn": 16, + "problem": "StrictDiagnostic", + "suggest": "Property '_name' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property '_name' has no initializer and is not definitely assigned in the constructor.", + "severity": "ERROR" + }, + { + "line": 214, + "column": 11, + "endLine": 214, + "endColumn": 15, + "problem": "StrictDiagnostic", + "suggest": "Property '_age' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property '_age' has no initializer and is not definitely assigned in the constructor.", + "severity": "ERROR" + }, + { + "line": 232, + "column": 5, + "endLine": 232, + "endColumn": 15, + "problem": "StrictDiagnostic", + "suggest": "Property 'myProperty' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property 'myProperty' has no initializer and is not definitely assigned in the constructor.", "severity": "ERROR" } ] diff --git a/ets2panda/linter/test/interop/unique_types.ets.json b/ets2panda/linter/test/interop/unique_types.ets.json index ca88f857e9..8de3ea7a62 100644 --- a/ets2panda/linter/test/interop/unique_types.ets.json +++ b/ets2panda/linter/test/interop/unique_types.ets.json @@ -13,5 +13,576 @@ "See the License for the specific language governing permissions and", "limitations under the License." ], - "result": [] + "result": [ + { + "line": 76, + "column": 7, + "endLine": 76, + "endColumn": 69, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 158, + "column": 7, + "endLine": 158, + "endColumn": 58, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 195, + "column": 52, + "endLine": 195, + "endColumn": 55, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 245, + "column": 54, + "endLine": 245, + "endColumn": 57, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 282, + "column": 7, + "endLine": 282, + "endColumn": 57, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 303, + "column": 7, + "endLine": 303, + "endColumn": 60, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 306, + "column": 5, + "endLine": 306, + "endColumn": 36, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 307, + "column": 5, + "endLine": 307, + "endColumn": 61, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 308, + "column": 5, + "endLine": 308, + "endColumn": 62, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 310, + "column": 5, + "endLine": 310, + "endColumn": 43, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 311, + "column": 5, + "endLine": 311, + "endColumn": 49, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 312, + "column": 5, + "endLine": 312, + "endColumn": 45, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 313, + "column": 5, + "endLine": 313, + "endColumn": 45, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 314, + "column": 5, + "endLine": 314, + "endColumn": 41, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 315, + "column": 5, + "endLine": 315, + "endColumn": 41, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 325, + "column": 5, + "endLine": 325, + "endColumn": 25, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 326, + "column": 5, + "endLine": 326, + "endColumn": 50, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 327, + "column": 5, + "endLine": 327, + "endColumn": 51, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 329, + "column": 5, + "endLine": 329, + "endColumn": 32, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 330, + "column": 5, + "endLine": 330, + "endColumn": 38, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 331, + "column": 5, + "endLine": 331, + "endColumn": 34, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 332, + "column": 5, + "endLine": 332, + "endColumn": 34, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 333, + "column": 5, + "endLine": 333, + "endColumn": 30, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 334, + "column": 5, + "endLine": 334, + "endColumn": 30, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 340, + "column": 5, + "endLine": 340, + "endColumn": 31, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 355, + "column": 7, + "endLine": 355, + "endColumn": 61, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 357, + "column": 5, + "endLine": 357, + "endColumn": 38, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 358, + "column": 5, + "endLine": 358, + "endColumn": 44, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 359, + "column": 5, + "endLine": 359, + "endColumn": 53, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 360, + "column": 5, + "endLine": 360, + "endColumn": 53, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 361, + "column": 5, + "endLine": 361, + "endColumn": 63, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 362, + "column": 5, + "endLine": 362, + "endColumn": 46, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 363, + "column": 5, + "endLine": 363, + "endColumn": 51, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 364, + "column": 5, + "endLine": 364, + "endColumn": 42, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 365, + "column": 5, + "endLine": 365, + "endColumn": 53, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 374, + "column": 5, + "endLine": 374, + "endColumn": 26, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 375, + "column": 5, + "endLine": 375, + "endColumn": 32, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 376, + "column": 5, + "endLine": 376, + "endColumn": 41, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 377, + "column": 5, + "endLine": 377, + "endColumn": 41, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 378, + "column": 5, + "endLine": 378, + "endColumn": 51, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 379, + "column": 5, + "endLine": 379, + "endColumn": 34, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 380, + "column": 5, + "endLine": 380, + "endColumn": 39, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 381, + "column": 5, + "endLine": 381, + "endColumn": 30, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 382, + "column": 5, + "endLine": 382, + "endColumn": 41, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 387, + "column": 5, + "endLine": 387, + "endColumn": 32, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 388, + "column": 5, + "endLine": 388, + "endColumn": 38, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 389, + "column": 5, + "endLine": 389, + "endColumn": 47, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 390, + "column": 5, + "endLine": 390, + "endColumn": 47, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 391, + "column": 5, + "endLine": 391, + "endColumn": 57, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 392, + "column": 5, + "endLine": 392, + "endColumn": 40, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 393, + "column": 5, + "endLine": 393, + "endColumn": 45, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 394, + "column": 5, + "endLine": 394, + "endColumn": 36, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 395, + "column": 5, + "endLine": 395, + "endColumn": 47, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 182, + "column": 3, + "endLine": 182, + "endColumn": 13, + "problem": "StrictDiagnostic", + "suggest": "Property 'myProperty' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property 'myProperty' has no initializer and is not definitely assigned in the constructor.", + "severity": "ERROR" + }, + { + "line": 202, + "column": 11, + "endLine": 202, + "endColumn": 16, + "problem": "StrictDiagnostic", + "suggest": "Property '_name' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property '_name' has no initializer and is not definitely assigned in the constructor.", + "severity": "ERROR" + }, + { + "line": 214, + "column": 11, + "endLine": 214, + "endColumn": 15, + "problem": "StrictDiagnostic", + "suggest": "Property '_age' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property '_age' has no initializer and is not definitely assigned in the constructor.", + "severity": "ERROR" + }, + { + "line": 232, + "column": 5, + "endLine": 232, + "endColumn": 15, + "problem": "StrictDiagnostic", + "suggest": "Property 'myProperty' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property 'myProperty' has no initializer and is not definitely assigned in the constructor.", + "severity": "ERROR" + } + ] } \ No newline at end of file diff --git a/ets2panda/linter/test/interop/unique_types.ets.migrate.ets b/ets2panda/linter/test/interop/unique_types.ets.migrate.ets index 884003da24..9d4191f91e 100644 --- a/ets2panda/linter/test/interop/unique_types.ets.migrate.ets +++ b/ets2panda/linter/test/interop/unique_types.ets.migrate.ets @@ -14,22 +14,387 @@ */ import { - objectLiteralType, - intersectionType, - tsFunction, - stringType, - enumType + any_var, + unknown_var, + symbol_var, + function_var, + A, + B, + TestHelper, + throw_number, + throw_string, + throw_boolean, + throw_bigint, + throw_obj, + throw_error, + throwErrorSubClass, + SubError, + throwRangeError, + ObjectLiteralClass, + ObjectLiteralInter, + MyClassDecorator, + propertyDecorator, + methodDecorator, + parameterDecorator, + accessorDecorator, + readonly1, + num_boxed, + bool_boxed, + str_boxed, + bigint_boxed, + ts_object_method, + ts_object_method_getOwnPropertyDescriptor, + ts_object_method_getOwnPropertyDescriptors, + ts_object_method_getOwnPropertyNames, + ts_object_method_hasOwn, + ts_object_method_isExtensible, + ts_object_method_isFrozen, + ts_object_method_isSealed, + ts_object_method_keys, + ts_object_method_values, + interObj, + ts_reflect_method, + ts_reflect_method_apply, + ts_reflect_method_defineProperty, + ts_reflect_method_deleteProperty, + ts_reflect_method_getOwnPropertyDescriptor, + ts_reflect_method_ownKeys, + ts_reflect_method_isExtensible, + ts_reflect_method_set, + ts_reflect_method_setPrototypeOf } from "./ignore_files/unique_types"; -objectLiteralType.setPropertyByName('name',ESValue.wrap("test")) -intersectionType.setPropertyByName('name',ESValue.wrap("test")); +typeof any_var === 'object'; +typeof unknown_var === 'number'; +typeof symbol_var === 'object'; +function_var.unsafeCall() === true; +A.instance; +let obj: B = { name: "hello" }; -try { -tsFunction(); -} catch (e) { +export function test_ts_non_standard_exception(testCaseRet: Array) { + let test_helper = new TestHelper("TEST_TS_NON_STANDARD_EXCEPTION"); + + test_helper.test(() => { + try { + throw_number(); // arkts-interop-ts2s-ts-exception + } catch (e) { + return e as number === 123.0; + } + return false; + }, "e as number === 123"); + + test_helper.test(() => { + try { + throw_boolean(); // arkts-interop-ts2s-ts-exception + } catch (e) { + return e as boolean === true; + } + return false; + }, "e as boolean === true"); + + test_helper.test(() => { + try { + throw_bigint(); // arkts-interop-ts2s-ts-exception + } catch (e) { + return e as bigint === 111n; + } + return false; + }, "e as bigint === 111n"); + + test_helper.test(() => { + try { + throw_string(); // arkts-interop-ts2s-ts-exception + } catch (e) { + return e as string === "error"; + } + return false; + }, "e as string === "error""); + + test_helper.test(() => { + try { + throw_obj(); // arkts-interop-ts2s-ts-exception + } catch (e) { + return e.name === "error"; + } + return false; + }, "e.name === "error""); + + test_helper.test(() => { + try { + throw_error(); + } catch (e) { + let errObj: Error = e as Error; + return errObj.name === "error"; + } + return false; + }, "errObj.name === "error""); + + test_helper.test(() => { + try { + throwErrorSubClass(); // arkts-interop-ts2s-ts-exception + } catch (e) { + let errObj = e as SubError; + return errObj.extraField === 123.0 && errObj.foo() === 456.0; + } + return false; + }, "errObj.extraField === 123 && errObj.foo() === 456"); + + test_helper.test(() => { + let flag = false + try { + throwRangeError(); // arkts-interop-ts2s-ts-exception + } catch (e) { + let errObj: RangeError = e as RangeError; + return errObj instanceof RangeError; + } + return flag; + }, "Throw: throwRangeError"); + + testCaseRet.push(test_helper.done()); +} + +export function test_object_literal(testCaseRet: Array) { + let test_helper = new TestHelper("TEST_OBJECT_LITERAL"); + + test_helper.test(() => { + let obj: ObjectLiteralClass = { name: "hello" }; // arkts-obj-literal-generate-class-instance + return obj.name === "hello" && obj instanceof ObjectLiteralClass; + }, "obj.name === "hello""); + + test_helper.test(() => { + let obj: ObjectLiteralInter = { name: "hello" }; // arkts-obj-literal-generate-class-instance + return obj.name === "hello" && obj instanceof ObjectLiteralInter; + }, "obj.name === "hello""); + + testCaseRet.push(test_helper.done()); +} + +// 1 ArkTS使用TS装饰器 +// 规则名 arkts-interop-ts2s-no-ts-decorator +// case 1 类装饰器 top level +@MyClassDecorator // arkts-no-ts-decorators + arkts-interop-ts2s-no-ts-decorator +class K {} + +//case 2 类属性装饰器 +class MyClass { + @propertyDecorator// arkts-no-ts-decorators + myProperty: string; +} + +//case 3 方法装饰器 +class MathFunctions { + @methodDecorator// arkts-no-ts-decorators + double1(value: number): number { + return value; + } +} + +//case 4 方法装饰器 +class MyClass1 { + log(value: string, @parameterDecorator metadata: any) {// arkts-no-ts-decorators + console.log(Logged: ${value: value}); + } +} + +//case 5 访问器装饰器 +class Person { + private _name: string; + @accessorDecorator// arkts-no-ts-decorators + get name(): string { + return this._name; + } + set name(value: string) { + this._name = value; + } +} + +//case 6 访问器工厂 +class Person1 { + private _age: number; + @readonly(true)// arkts-no-ts-decorators + get age(): number { + return this._age; + } + set age(value: number) { + this._age = value; + } +} + +namespace NS{ + // case 7 类装饰器 top level + @MyClassDecorator// arkts-no-ts-decorators + arkts-interop-ts2s-no-ts-decorator + class K {} + + //case 8 类属性装饰器 + class MyClass { + @propertyDecorator// arkts-no-ts-decorators + myProperty: string; + } + + //case 9 方法装饰器 + class MathFunctions { + @methodDecorator// arkts-no-ts-decorators + double1(value: number): number { + return value; + } + } + + //case 10 方法装饰器 + class MyClass1 { + log(value: string, @parameterDecorator metadata: any) {// arkts-no-ts-decorators + console.log(Logged: ${value: value}); + } + } + + //case 11 访问器装饰器 + class Person { + private _name: string; + constructor(name: string) { + this._name = name; + } + @accessorDecorator// arkts-no-ts-decorators + get name(): string { + return this._name; + } + set name(value: string) { + this._name = value; + } + } + + //case 12 访问器工厂 + class Person1 { + private _age: number; + constructor(age: number) { + this._age = age; + } + @readonly1(true)// arkts-no-ts-decorators + get age(): number { + return this._age; + } + set age(value: number) { + this._age = value; + } + } +} + +export function test_ts_boxed_type(testCaseRet: Array) { + let test_helper = new TestHelper("TEST_TS_BOXED_TYPE"); + + test_helper.test(() => { + return typeof num_boxed === object; + }, "typeof num_boxed === object"); + + test_helper.test(() => { + return typeof bool_boxed === object; + }, "typeof bool_boxed === object"); + + test_helper.test(() => { + return typeof str_boxed === object; + }, "typeof str_boxed === object"); + + test_helper.test(() => { + return typeof bigint_boxed === object; + }, "typeof bigint_boxed === object"); + testCaseRet.push(test_helper.done()); +} + +export function test_ts_object_method(testCaseRet: Array) { + let test_helper = new TestHelper("TEST_TS_OBJECT_METHOD"); + + test_helper.test(() => { + ts_object_method(new Object2()) + ts_object_method_getOwnPropertyDescriptor(new Object2()) + ts_object_method_getOwnPropertyDescriptors(new Object2()) + ts_object_method_getOwnPropertyNames(new Object2()) + ts_object_method_hasOwn(new Object2()) + ts_object_method_isExtensible(new Object2()) + ts_object_method_isFrozen(new Object2()) + ts_object_method_isSealed(new Object2()) + ts_object_method_keys(new Object2()) + ts_object_method_keys(new Object2()) + ts_object_method_values(new Object2()) + return true; + }, "true"); + + test_helper.test(() => { + interface Iface { + a:number + } + let a1:Iface = {a:1.0} + ts_object_method(a1) + ts_object_method_getOwnPropertyDescriptor(a1) + ts_object_method_getOwnPropertyDescriptors(a1) + ts_object_method_getOwnPropertyNames(a1) + ts_object_method_hasOwn(a1) + ts_object_method_isExtensible(a1) + ts_object_method_isFrozen(a1) + ts_object_method_isSealed(a1) + ts_object_method_keys(a1) + ts_object_method_keys(a1) + ts_object_method_values(a1) + return true; + }, "true"); + + test_helper.test(() => { + ts_object_method(interObj) + return true; + }, "false"); + + testCaseRet.push(test_helper.done()); +} + +class Reflect2 { + a: string = 'hello' + getName() { return this.a } } -stringType = "test" //should pass +// 5 Object内置方法作用在ArkTS对象 +// 规则名 arkts-interop-ts2s-ts-object-on-static-instance +export function test_ts_reflect_method(testCaseRet: Array) { + let test_helper = new TestHelper("TEST_TS_REFLECT_METHOD"); + test_helper.test(() => { + ts_reflect_method(new Reflect2()) + ts_reflect_method_apply(new Reflect2()) + ts_reflect_method_defineProperty(new Reflect2()) + ts_reflect_method_deleteProperty(new Reflect2()) + ts_reflect_method_getOwnPropertyDescriptor(new Reflect2()) + ts_reflect_method_ownKeys(new Reflect2()) + ts_reflect_method_isExtensible(new Reflect2()) + ts_reflect_method_set(new Reflect2()) + ts_reflect_method_setPrototypeOf(new Reflect2()) + return true; + }, "reflect class 1.2 "); + + test_helper.test(() => { + interface Iface { + a:number + } + let a1:Iface = {a:1.0} + ts_reflect_method(a1) + ts_reflect_method_apply(a1) + ts_reflect_method_defineProperty(a1) + ts_reflect_method_deleteProperty(a1) + ts_reflect_method_getOwnPropertyDescriptor(a1) + ts_reflect_method_ownKeys(a1) + ts_reflect_method_isExtensible(a1) + ts_reflect_method_set(a1) + ts_reflect_method_setPrototypeOf(a1) + return true; + }, "reflect interface 1.2"); + + test_helper.test(() => { + ts_reflect_method(interObj) + ts_reflect_method_apply(interObj) + ts_reflect_method_defineProperty(interObj) + ts_reflect_method_deleteProperty(interObj) + ts_reflect_method_getOwnPropertyDescriptor(interObj) + ts_reflect_method_ownKeys(interObj) + ts_reflect_method_isExtensible(interObj) + ts_reflect_method_set(interObj) + ts_reflect_method_setPrototypeOf(interObj) + return true; + }, "reflect interObj 1.0 "); -enumType = "A"; //should fail + testCaseRet.push(test_helper.done()); +} \ No newline at end of file diff --git a/ets2panda/linter/test/interop/unique_types.ets.migrate.json b/ets2panda/linter/test/interop/unique_types.ets.migrate.json index 6e0fbe1a85..a3a12f1bce 100644 --- a/ets2panda/linter/test/interop/unique_types.ets.migrate.json +++ b/ets2panda/linter/test/interop/unique_types.ets.migrate.json @@ -15,43 +15,933 @@ ], "result": [ { - "line": 29, - "column": 1, - "endLine": 29, - "endColumn": 13, - "problem": "InteropTSFunctionInvoke", + "line": 68, + "column": 8, + "endLine": 68, + "endColumn": 15, + "problem": "InteropDirectAccessToTSTypes", "suggest": "", - "rule": "Trying to catch typescript errors is not permitted (arkts-interop-ts2s-ts-exception)", + "rule": "Cannot access typescript types directly (arkts-interop-ts2s-static-access-ts-type)", "severity": "ERROR" }, { - "line": 29, - "column": 1, - "endLine": 29, - "endColumn": 11, + "line": 69, + "column": 8, + "endLine": 69, + "endColumn": 19, "problem": "InteropDirectAccessToTSTypes", "suggest": "", "rule": "Cannot access typescript types directly (arkts-interop-ts2s-static-access-ts-type)", "severity": "ERROR" }, { - "line": 33, - "column": 1, - "endLine": 33, - "endColumn": 20, + "line": 70, + "column": 8, + "endLine": 70, + "endColumn": 18, "problem": "InteropDirectAccessToTSTypes", "suggest": "", "rule": "Cannot access typescript types directly (arkts-interop-ts2s-static-access-ts-type)", "severity": "ERROR" }, { - "line": 33, + "line": 76, + "column": 7, + "endLine": 76, + "endColumn": 69, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 76, + "column": 25, + "endLine": 76, + "endColumn": 35, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 80, + "column": 7, + "endLine": 80, + "endColumn": 21, + "problem": "InteropTSFunctionInvoke", + "suggest": "", + "rule": "Trying to catch typescript errors is not permitted (arkts-interop-ts2s-ts-exception)", + "severity": "ERROR" + }, + { + "line": 89, + "column": 7, + "endLine": 89, + "endColumn": 22, + "problem": "InteropTSFunctionInvoke", + "suggest": "", + "rule": "Trying to catch typescript errors is not permitted (arkts-interop-ts2s-ts-exception)", + "severity": "ERROR" + }, + { + "line": 98, + "column": 7, + "endLine": 98, + "endColumn": 21, + "problem": "InteropTSFunctionInvoke", + "suggest": "", + "rule": "Trying to catch typescript errors is not permitted (arkts-interop-ts2s-ts-exception)", + "severity": "ERROR" + }, + { + "line": 107, + "column": 7, + "endLine": 107, + "endColumn": 21, + "problem": "InteropTSFunctionInvoke", + "suggest": "", + "rule": "Trying to catch typescript errors is not permitted (arkts-interop-ts2s-ts-exception)", + "severity": "ERROR" + }, + { + "line": 116, + "column": 7, + "endLine": 116, + "endColumn": 18, + "problem": "InteropTSFunctionInvoke", + "suggest": "", + "rule": "Trying to catch typescript errors is not permitted (arkts-interop-ts2s-ts-exception)", + "severity": "ERROR" + }, + { + "line": 158, + "column": 7, + "endLine": 158, + "endColumn": 58, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 158, + "column": 25, + "endLine": 158, + "endColumn": 35, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 176, "column": 1, - "endLine": 33, - "endColumn": 11, - "problem": "InteropDirectAccessToTSTypes", + "endLine": 176, + "endColumn": 18, + "problem": "DecoratorsNotSupported", "suggest": "", - "rule": "Cannot access typescript types directly (arkts-interop-ts2s-static-access-ts-type)", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 181, + "column": 3, + "endLine": 181, + "endColumn": 21, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 187, + "column": 3, + "endLine": 187, + "endColumn": 19, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 195, + "column": 22, + "endLine": 195, + "endColumn": 41, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 195, + "column": 52, + "endLine": 195, + "endColumn": 55, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 203, + "column": 3, + "endLine": 203, + "endColumn": 21, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 215, + "column": 3, + "endLine": 215, + "endColumn": 18, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 226, + "column": 3, + "endLine": 226, + "endColumn": 20, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 231, + "column": 5, + "endLine": 231, + "endColumn": 23, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 237, + "column": 5, + "endLine": 237, + "endColumn": 21, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 245, + "column": 24, + "endLine": 245, + "endColumn": 43, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 245, + "column": 54, + "endLine": 245, + "endColumn": 57, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 256, + "column": 5, + "endLine": 256, + "endColumn": 23, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 271, + "column": 5, + "endLine": 271, + "endColumn": 21, + "problem": "DecoratorsNotSupported", + "suggest": "", + "rule": "Decorators are not supported(arkts-no-ts-decorators)", + "severity": "ERROR" + }, + { + "line": 282, + "column": 7, + "endLine": 282, + "endColumn": 57, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 282, + "column": 25, + "endLine": 282, + "endColumn": 35, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 303, + "column": 7, + "endLine": 303, + "endColumn": 60, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 303, + "column": 25, + "endLine": 303, + "endColumn": 35, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 306, + "column": 5, + "endLine": 306, + "endColumn": 36, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 306, + "column": 26, + "endLine": 306, + "endColumn": 33, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 307, + "column": 5, + "endLine": 307, + "endColumn": 61, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 307, + "column": 51, + "endLine": 307, + "endColumn": 58, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 308, + "column": 5, + "endLine": 308, + "endColumn": 62, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 308, + "column": 52, + "endLine": 308, + "endColumn": 59, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 309, + "column": 46, + "endLine": 309, + "endColumn": 53, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 310, + "column": 5, + "endLine": 310, + "endColumn": 43, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 310, + "column": 33, + "endLine": 310, + "endColumn": 40, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 311, + "column": 5, + "endLine": 311, + "endColumn": 49, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 311, + "column": 39, + "endLine": 311, + "endColumn": 46, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 312, + "column": 5, + "endLine": 312, + "endColumn": 45, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 312, + "column": 35, + "endLine": 312, + "endColumn": 42, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 313, + "column": 5, + "endLine": 313, + "endColumn": 45, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 313, + "column": 35, + "endLine": 313, + "endColumn": 42, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 314, + "column": 5, + "endLine": 314, + "endColumn": 41, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 314, + "column": 31, + "endLine": 314, + "endColumn": 38, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 315, + "column": 5, + "endLine": 315, + "endColumn": 41, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 315, + "column": 31, + "endLine": 315, + "endColumn": 38, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 316, + "column": 33, + "endLine": 316, + "endColumn": 40, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 325, + "column": 5, + "endLine": 325, + "endColumn": 25, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 326, + "column": 5, + "endLine": 326, + "endColumn": 50, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 327, + "column": 5, + "endLine": 327, + "endColumn": 51, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 329, + "column": 5, + "endLine": 329, + "endColumn": 32, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 330, + "column": 5, + "endLine": 330, + "endColumn": 38, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 331, + "column": 5, + "endLine": 331, + "endColumn": 34, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 332, + "column": 5, + "endLine": 332, + "endColumn": 34, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 333, + "column": 5, + "endLine": 333, + "endColumn": 30, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 334, + "column": 5, + "endLine": 334, + "endColumn": 30, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 340, + "column": 5, + "endLine": 340, + "endColumn": 31, + "problem": "InteropCallObjectParam", + "suggest": "", + "rule": "Class type is not compatible with \"Object\" parameter in interop call (arkts-interop-d2s-static-object-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 355, + "column": 7, + "endLine": 355, + "endColumn": 61, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 355, + "column": 25, + "endLine": 355, + "endColumn": 35, + "problem": "DynamicCtorCall", + "suggest": "", + "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", + "severity": "ERROR" + }, + { + "line": 357, + "column": 5, + "endLine": 357, + "endColumn": 38, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 358, + "column": 5, + "endLine": 358, + "endColumn": 44, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 359, + "column": 5, + "endLine": 359, + "endColumn": 53, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 360, + "column": 5, + "endLine": 360, + "endColumn": 53, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 361, + "column": 5, + "endLine": 361, + "endColumn": 63, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 362, + "column": 5, + "endLine": 362, + "endColumn": 46, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 363, + "column": 5, + "endLine": 363, + "endColumn": 51, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 364, + "column": 5, + "endLine": 364, + "endColumn": 42, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 365, + "column": 5, + "endLine": 365, + "endColumn": 53, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 374, + "column": 5, + "endLine": 374, + "endColumn": 26, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 375, + "column": 5, + "endLine": 375, + "endColumn": 32, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 376, + "column": 5, + "endLine": 376, + "endColumn": 41, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 377, + "column": 5, + "endLine": 377, + "endColumn": 41, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 378, + "column": 5, + "endLine": 378, + "endColumn": 51, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 379, + "column": 5, + "endLine": 379, + "endColumn": 34, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 380, + "column": 5, + "endLine": 380, + "endColumn": 39, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 381, + "column": 5, + "endLine": 381, + "endColumn": 30, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 382, + "column": 5, + "endLine": 382, + "endColumn": 41, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 387, + "column": 5, + "endLine": 387, + "endColumn": 32, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 388, + "column": 5, + "endLine": 388, + "endColumn": 38, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 389, + "column": 5, + "endLine": 389, + "endColumn": 47, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 390, + "column": 5, + "endLine": 390, + "endColumn": 47, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 391, + "column": 5, + "endLine": 391, + "endColumn": 57, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 392, + "column": 5, + "endLine": 392, + "endColumn": 40, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 393, + "column": 5, + "endLine": 393, + "endColumn": 45, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 394, + "column": 5, + "endLine": 394, + "endColumn": 36, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 395, + "column": 5, + "endLine": 395, + "endColumn": 47, + "problem": "InteropCallReflect", + "suggest": "", + "rule": "Reflect API usage is not allowed in interop calls when an \"Object\" parameter receives a class instance (arkts-interop-d2s-static-reflect-on-dynamic-instance)", + "severity": "ERROR" + }, + { + "line": 182, + "column": 3, + "endLine": 182, + "endColumn": 13, + "problem": "StrictDiagnostic", + "suggest": "Property 'myProperty' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property 'myProperty' has no initializer and is not definitely assigned in the constructor.", + "severity": "ERROR" + }, + { + "line": 202, + "column": 11, + "endLine": 202, + "endColumn": 16, + "problem": "StrictDiagnostic", + "suggest": "Property '_name' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property '_name' has no initializer and is not definitely assigned in the constructor.", + "severity": "ERROR" + }, + { + "line": 214, + "column": 11, + "endLine": 214, + "endColumn": 15, + "problem": "StrictDiagnostic", + "suggest": "Property '_age' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property '_age' has no initializer and is not definitely assigned in the constructor.", + "severity": "ERROR" + }, + { + "line": 232, + "column": 5, + "endLine": 232, + "endColumn": 15, + "problem": "StrictDiagnostic", + "suggest": "Property 'myProperty' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property 'myProperty' has no initializer and is not definitely assigned in the constructor.", "severity": "ERROR" } ] diff --git a/ets2panda/linter/test/main/literals_as_prop_names.ets.arkts2.json b/ets2panda/linter/test/main/literals_as_prop_names.ets.arkts2.json index f6d45915a0..5062fc598a 100644 --- a/ets2panda/linter/test/main/literals_as_prop_names.ets.arkts2.json +++ b/ets2panda/linter/test/main/literals_as_prop_names.ets.arkts2.json @@ -274,16 +274,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 84, - "column": 12, - "endLine": 84, - "endColumn": 31, - "problem": "InteropDirectAccessToTSTypes", - "suggest": "", - "rule": "Cannot access typescript types directly (arkts-interop-ts2s-static-access-ts-type)", - "severity": "ERROR" - }, { "line": 84, "column": 36, diff --git a/ets2panda/linter/test/main/literals_as_prop_names.ets.autofix.json b/ets2panda/linter/test/main/literals_as_prop_names.ets.autofix.json index c006698019..27cafa7c7b 100644 --- a/ets2panda/linter/test/main/literals_as_prop_names.ets.autofix.json +++ b/ets2panda/linter/test/main/literals_as_prop_names.ets.autofix.json @@ -656,16 +656,6 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, - { - "line": 84, - "column": 12, - "endLine": 84, - "endColumn": 31, - "problem": "InteropDirectAccessToTSTypes", - "suggest": "", - "rule": "Cannot access typescript types directly (arkts-interop-ts2s-static-access-ts-type)", - "severity": "ERROR" - }, { "line": 84, "column": 36, diff --git a/ets2panda/linter/test/main/literals_as_prop_names.ets.migrate.json b/ets2panda/linter/test/main/literals_as_prop_names.ets.migrate.json index 2597882d05..1224bb8ee6 100644 --- a/ets2panda/linter/test/main/literals_as_prop_names.ets.migrate.json +++ b/ets2panda/linter/test/main/literals_as_prop_names.ets.migrate.json @@ -74,16 +74,6 @@ "rule": "This keyword cannot be used as identifiers (arkts-invalid-identifier)", "severity": "ERROR" }, - { - "line": 90, - "column": 12, - "endLine": 90, - "endColumn": 31, - "problem": "InteropDirectAccessToTSTypes", - "suggest": "", - "rule": "Cannot access typescript types directly (arkts-interop-ts2s-static-access-ts-type)", - "severity": "ERROR" - }, { "line": 90, "column": 36, -- Gitee