diff --git a/ets2panda/linter/rule-config.json b/ets2panda/linter/rule-config.json index e6a8017193e9c249bc88e3f1ca9ccf98f4639d94..b05b2e604f0950782f7976ea20a11c34836cffe4 100644 --- a/ets2panda/linter/rule-config.json +++ b/ets2panda/linter/rule-config.json @@ -60,8 +60,9 @@ "arkts-numeric-bigint-compare", "arkts-only-support-decimal-bigint-literal", "arkts-unsupport-operator", - "arkts-no-duplicate-function-name", - "arkts-subclass-must-call-super-constructor-with-args" + "arkts-no-duplicate-function-name", + "arkts-require-func-arg-type", + "arkts-subclass-must-call-super-constructor-with-args" ], "interop": [ "arkts-interop-js2s-inherit-js-class", diff --git a/ets2panda/linter/src/cli/CommandLineParser.ts b/ets2panda/linter/src/cli/CommandLineParser.ts index 04f6792b4dacab5d30bb281136a7f6358832371b..5da3f8192939beb3e21d5102cae3f331c915c06b 100644 --- a/ets2panda/linter/src/cli/CommandLineParser.ts +++ b/ets2panda/linter/src/cli/CommandLineParser.ts @@ -218,7 +218,7 @@ function getConfigureRulePath(options: OptionValues): string { } const stats = fs.statSync(path.normalize(options.ruleConfig)); if (!stats.isFile()) { - Logger.error(`The file at ${options.ruleConfigPath} path does not exist! + Logger.error(`The file at ${options.ruleConfigPath} path does not exist! And will use the default configure rule`); return getDefaultConfigurePath(); } diff --git a/ets2panda/linter/src/lib/CookBookMsg.ts b/ets2panda/linter/src/lib/CookBookMsg.ts index a99f72046c0ea148319576a5c3979911e5a9ed05..1fd7af89d2375f8cace387db01167577568d3df3 100644 --- a/ets2panda/linter/src/lib/CookBookMsg.ts +++ b/ets2panda/linter/src/lib/CookBookMsg.ts @@ -103,7 +103,7 @@ cookBookTag[72] = ''; cookBookTag[73] = ''; cookBookTag[74] = 'Destructuring variable declarations are not supported (arkts-no-destruct-decls)'; cookBookTag[75] = ''; -cookBookTag[76] = ''; +cookBookTag[76] = 'Type of parameter must be defined explicitly (arkts-require-func-arg-type)'; cookBookTag[77] = ''; cookBookTag[78] = ''; cookBookTag[79] = 'Type annotation in catch clause is not supported (arkts-no-types-in-catch)'; diff --git a/ets2panda/linter/src/lib/FaultAttrs.ts b/ets2panda/linter/src/lib/FaultAttrs.ts index 24902b1ec9be55ebb71d987607070802238dfc54..a545087ab6ea490af179b38c24734833e3f9e13b 100644 --- a/ets2panda/linter/src/lib/FaultAttrs.ts +++ b/ets2panda/linter/src/lib/FaultAttrs.ts @@ -64,6 +64,7 @@ faultsAttrs[FaultID.InOperator] = new FaultAttributes(66); faultsAttrs[FaultID.DestructuringAssignment] = new FaultAttributes(69); faultsAttrs[FaultID.CommaOperator] = new FaultAttributes(71); faultsAttrs[FaultID.DestructuringDeclaration] = new FaultAttributes(74); +faultsAttrs[FaultID.ParameterType] = new FaultAttributes(76); faultsAttrs[FaultID.CatchWithUnsupportedType] = new FaultAttributes(79); faultsAttrs[FaultID.ForInStatement] = new FaultAttributes(80); faultsAttrs[FaultID.MappedType] = new FaultAttributes(83); diff --git a/ets2panda/linter/src/lib/FaultDesc.ts b/ets2panda/linter/src/lib/FaultDesc.ts index 25fe395b073c1a37b74217053bc5f3b9b967664a..b61164a321e66235280a845dcb5cbdc2e9c7de5a 100644 --- a/ets2panda/linter/src/lib/FaultDesc.ts +++ b/ets2panda/linter/src/lib/FaultDesc.ts @@ -38,6 +38,7 @@ faultDesc[FaultID.UnknownType] = '"unknown" type'; faultDesc[FaultID.ForInStatement] = '"for-In" statements'; faultDesc[FaultID.InOperator] = '"in" operations'; faultDesc[FaultID.FunctionExpression] = 'function expressions'; +faultDesc[FaultID.ParameterType] = 'parameter type'; faultDesc[FaultID.IntersectionType] = 'intersection types and type literals'; faultDesc[FaultID.ObjectTypeLiteral] = 'Object type literals'; faultDesc[FaultID.CommaOperator] = 'comma operator'; diff --git a/ets2panda/linter/src/lib/Problems.ts b/ets2panda/linter/src/lib/Problems.ts index ab24db5928960e58ed088f0fd98e4bb03b95d9b4..e1642ba890cceb395b9ec7dbbf80ae1833dcf9fe 100644 --- a/ets2panda/linter/src/lib/Problems.ts +++ b/ets2panda/linter/src/lib/Problems.ts @@ -78,6 +78,7 @@ export enum FaultID { ImportAssignment, GenericCallNoTypeArgs, ParameterProperties, + ParameterType, InstanceofUnsupported, ShorthandAmbientModuleDecl, WildcardsInModuleName, diff --git a/ets2panda/linter/src/lib/TypeScriptLinter.ts b/ets2panda/linter/src/lib/TypeScriptLinter.ts index 9a0f958dd60d3038f55a62e81d0ad1584875003d..e35ceab2c99f028fd6c5eb743c3198e01fe35b6a 100644 --- a/ets2panda/linter/src/lib/TypeScriptLinter.ts +++ b/ets2panda/linter/src/lib/TypeScriptLinter.ts @@ -2092,6 +2092,9 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { if (tsFunctionDeclaration.body) { this.reportThisKeywordsInScope(tsFunctionDeclaration.body); } + if (this.options.arkts2) { + this.handleParamType(tsFunctionDeclaration); + } const funcDeclParent = tsFunctionDeclaration.parent; if (!ts.isSourceFile(funcDeclParent) && !ts.isModuleBlock(funcDeclParent)) { const autofix = this.autofixer?.fixNestedFunction(tsFunctionDeclaration); @@ -2124,6 +2127,15 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { this.handleLimitedVoidFunction(tsFunctionDeclaration); } + private handleParamType(decl: ts.FunctionLikeDeclaration): void { + for (const param of decl.parameters) { + if (param.type) { + continue; + } + this.incrementCounters(param, FaultID.ParameterType); + } + } + private handleMissingReturnType( funcLikeDecl: ts.FunctionLikeDeclaration | ts.MethodSignature ): [boolean, ts.TypeNode | undefined] { @@ -3700,6 +3712,9 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { } } } + if (this.options.arkts2) { + this.handleParamType(tsMethodDecl); + } if (tsMethodDecl.body && isStatic) { this.reportThisKeywordsInScope(tsMethodDecl.body); } diff --git a/ets2panda/linter/src/lib/autofixes/Autofixer.ts b/ets2panda/linter/src/lib/autofixes/Autofixer.ts index 6c0a96ff547a2811936705f49ccca19ffc4b3383..fe3d2d3db616f70311afe7491ab129f03f058595 100644 --- a/ets2panda/linter/src/lib/autofixes/Autofixer.ts +++ b/ets2panda/linter/src/lib/autofixes/Autofixer.ts @@ -4150,7 +4150,7 @@ export class Autofixer { return undefined; } - private static findParentVariableDeclaration(node: ts.Node): ts.VariableDeclaration | undefined { + private static findParentVariableDeclaration(node: ts.Node): ts.VariableDeclaration | undefined { while (node) { if (ts.isVariableDeclaration(node)) { return node; @@ -5362,11 +5362,9 @@ export class Autofixer { } fixSideEffectImport(importDeclNode: ts.ImportDeclaration): Autofix[] { - const initModuleCall = ts.factory.createCallExpression( - ts.factory.createIdentifier("initModule"), - undefined, - [importDeclNode.moduleSpecifier] - ); + const initModuleCall = ts.factory.createCallExpression(ts.factory.createIdentifier('initModule'), undefined, [ + importDeclNode.moduleSpecifier + ]); const expressionStatement = ts.factory.createExpressionStatement(initModuleCall); const replacedText = this.printer.printNode( ts.EmitHint.Unspecified, @@ -5374,10 +5372,12 @@ export class Autofixer { importDeclNode.getSourceFile() ); - return [{ - start: importDeclNode.getStart(), - end: importDeclNode.getEnd(), - replacementText: replacedText - }]; + return [ + { + start: importDeclNode.getStart(), + end: importDeclNode.getEnd(), + replacementText: replacedText + } + ]; } } diff --git a/ets2panda/linter/test/builtin/builtin_not_support_property_descriptor.ets.arkts2.json b/ets2panda/linter/test/builtin/builtin_not_support_property_descriptor.ets.arkts2.json index dcb5f51adacdac07a38c4bbff93dff9e6eef2f42..971a2bc65f74c58502743a89075ad9c35f5df3f4 100644 --- a/ets2panda/linter/test/builtin/builtin_not_support_property_descriptor.ets.arkts2.json +++ b/ets2panda/linter/test/builtin/builtin_not_support_property_descriptor.ets.arkts2.json @@ -134,6 +134,16 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, + { + "line": 28, + "column": 7, + "endLine": 28, + "endColumn": 8, + "problem": "ParameterType", + "suggest": "", + "rule": "Type of parameter must be defined explicitly (arkts-require-func-arg-type)", + "severity": "ERROR" + }, { "line": 37, "column": 1, @@ -234,6 +244,16 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, + { + "line": 49, + "column": 9, + "endLine": 49, + "endColumn": 10, + "problem": "ParameterType", + "suggest": "", + "rule": "Type of parameter must be defined explicitly (arkts-require-func-arg-type)", + "severity": "ERROR" + }, { "line": 57, "column": 11, @@ -285,4 +305,4 @@ "severity": "ERROR" } ] -} \ No newline at end of file +} diff --git a/ets2panda/linter/test/main/arkts-require-func-arg-type.ets b/ets2panda/linter/test/main/arkts-require-func-arg-type.ets new file mode 100644 index 0000000000000000000000000000000000000000..fa688edec8041d27fc0065562f5df524dcef238c --- /dev/null +++ b/ets2panda/linter/test/main/arkts-require-func-arg-type.ets @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function foo1(a = 2){} + +function foo2(a = 2, b:number = 3){} + +function foo3(a = 2, b = 3){} + +class Calculator { + // Method with parameters + add(a, b): number { + return a + b; + } + + multiply(x: number, y): number { + return x * y; + } +} diff --git a/ets2panda/linter/test/main/arkts-require-func-arg-type.ets.args.json b/ets2panda/linter/test/main/arkts-require-func-arg-type.ets.args.json new file mode 100644 index 0000000000000000000000000000000000000000..66fb88f85945924e8be0e83d90123507033f4c5d --- /dev/null +++ b/ets2panda/linter/test/main/arkts-require-func-arg-type.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "Copyright (c) 2025 Huawei Device Co., Ltd.", + "Licensed under the Apache License, Version 2.0 (the 'License');", + "you may not use this file except in compliance with the License.", + "You may obtain a copy of the License at", + "", + "http://www.apache.org/licenses/LICENSE-2.0", + "", + "Unless required by applicable law or agreed to in writing, software", + "distributed under the License is distributed on an 'AS IS' BASIS,", + "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", + "See the License for the specific language governing permissions and", + "limitations under the License." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/main/arkts-require-func-arg-type.ets.arkts2.json b/ets2panda/linter/test/main/arkts-require-func-arg-type.ets.arkts2.json new file mode 100644 index 0000000000000000000000000000000000000000..d46010af5f9074ecd83285bb8ed5809eabe2ddb3 --- /dev/null +++ b/ets2panda/linter/test/main/arkts-require-func-arg-type.ets.arkts2.json @@ -0,0 +1,168 @@ +{ + "copyright": [ + "Copyright (c) 2025 Huawei Device Co., Ltd.", + "Licensed under the Apache License, Version 2.0 (the 'License');", + "you may not use this file except in compliance with the License.", + "You may obtain a copy of the License at", + "", + "http://www.apache.org/licenses/LICENSE-2.0", + "", + "Unless required by applicable law or agreed to in writing, software", + "distributed under the License is distributed on an 'AS IS' BASIS,", + "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", + "See the License for the specific language governing permissions and", + "limitations under the License." + ], + "result": [ + { + "line": 16, + "column": 15, + "endLine": 16, + "endColumn": 20, + "problem": "ParameterType", + "suggest": "", + "rule": "Type of parameter must be defined explicitly (arkts-require-func-arg-type)", + "severity": "ERROR" + }, + { + "line": 16, + "column": 19, + "endLine": 16, + "endColumn": 20, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 15, + "endLine": 18, + "endColumn": 20, + "problem": "ParameterType", + "suggest": "", + "rule": "Type of parameter must be defined explicitly (arkts-require-func-arg-type)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 19, + "endLine": 18, + "endColumn": 20, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 33, + "endLine": 18, + "endColumn": 34, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 15, + "endLine": 20, + "endColumn": 20, + "problem": "ParameterType", + "suggest": "", + "rule": "Type of parameter must be defined explicitly (arkts-require-func-arg-type)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 22, + "endLine": 20, + "endColumn": 27, + "problem": "ParameterType", + "suggest": "", + "rule": "Type of parameter must be defined explicitly (arkts-require-func-arg-type)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 19, + "endLine": 20, + "endColumn": 20, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 26, + "endLine": 20, + "endColumn": 27, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 7, + "endLine": 24, + "endColumn": 8, + "problem": "ParameterType", + "suggest": "", + "rule": "Type of parameter must be defined explicitly (arkts-require-func-arg-type)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 10, + "endLine": 24, + "endColumn": 11, + "problem": "ParameterType", + "suggest": "", + "rule": "Type of parameter must be defined explicitly (arkts-require-func-arg-type)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 7, + "endLine": 24, + "endColumn": 8, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 10, + "endLine": 24, + "endColumn": 11, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 23, + "endLine": 28, + "endColumn": 24, + "problem": "ParameterType", + "suggest": "", + "rule": "Type of parameter must be defined explicitly (arkts-require-func-arg-type)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 23, + "endLine": 28, + "endColumn": 24, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + } + ] +} diff --git a/ets2panda/linter/test/main/arkts-require-func-arg-type.ets.json b/ets2panda/linter/test/main/arkts-require-func-arg-type.ets.json new file mode 100644 index 0000000000000000000000000000000000000000..e2df81fe91730df3834d19d02b08f5278fb98ff5 --- /dev/null +++ b/ets2panda/linter/test/main/arkts-require-func-arg-type.ets.json @@ -0,0 +1,48 @@ +{ + "copyright": [ + "Copyright (c) 2025 Huawei Device Co., Ltd.", + "Licensed under the Apache License, Version 2.0 (the 'License');", + "you may not use this file except in compliance with the License.", + "You may obtain a copy of the License at", + "", + "http://www.apache.org/licenses/LICENSE-2.0", + "", + "Unless required by applicable law or agreed to in writing, software", + "distributed under the License is distributed on an 'AS IS' BASIS,", + "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", + "See the License for the specific language governing permissions and", + "limitations under the License." + ], + "result": [ + { + "line": 24, + "column": 7, + "endLine": 24, + "endColumn": 8, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 10, + "endLine": 24, + "endColumn": 11, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 23, + "endLine": 28, + "endColumn": 24, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + } + ] +} diff --git a/ets2panda/linter/test/main/numeric_semantics.ets.arkts2.json b/ets2panda/linter/test/main/numeric_semantics.ets.arkts2.json index 0cb967d9fef64e76cb78c887e31e707987585d35..678117efd62dab74ca90ebe59754cc70e425a23a 100644 --- a/ets2panda/linter/test/main/numeric_semantics.ets.arkts2.json +++ b/ets2panda/linter/test/main/numeric_semantics.ets.arkts2.json @@ -374,6 +374,26 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, + { + "line": 92, + "column": 19, + "endLine": 92, + "endColumn": 24, + "problem": "ParameterType", + "suggest": "", + "rule": "Type of parameter must be defined explicitly (arkts-require-func-arg-type)", + "severity": "ERROR" + }, + { + "line": 92, + "column": 26, + "endLine": 92, + "endColumn": 31, + "problem": "ParameterType", + "suggest": "", + "rule": "Type of parameter must be defined explicitly (arkts-require-func-arg-type)", + "severity": "ERROR" + }, { "line": 92, "column": 1, @@ -1305,4 +1325,4 @@ "severity": "ERROR" } ] -} \ No newline at end of file +} diff --git a/ets2panda/linter/test/main/numeric_semantics.ets.autofix.json b/ets2panda/linter/test/main/numeric_semantics.ets.autofix.json index 6ece33eb7ae5eef6d36f8ee43560d4709b45c56f..3094cb1fe24d8b112035f0d2652a33f8e35ec6b7 100644 --- a/ets2panda/linter/test/main/numeric_semantics.ets.autofix.json +++ b/ets2panda/linter/test/main/numeric_semantics.ets.autofix.json @@ -759,6 +759,26 @@ "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" }, + { + "line": 92, + "column": 19, + "endLine": 92, + "endColumn": 24, + "problem": "ParameterType", + "suggest": "", + "rule": "Type of parameter must be defined explicitly (arkts-require-func-arg-type)", + "severity": "ERROR" + }, + { + "line": 92, + "column": 26, + "endLine": 92, + "endColumn": 31, + "problem": "ParameterType", + "suggest": "", + "rule": "Type of parameter must be defined explicitly (arkts-require-func-arg-type)", + "severity": "ERROR" + }, { "line": 92, "column": 1, @@ -2491,4 +2511,4 @@ "severity": "ERROR" } ] -} \ No newline at end of file +} diff --git a/ets2panda/linter/test/main/numeric_semantics.ets.migrate.json b/ets2panda/linter/test/main/numeric_semantics.ets.migrate.json index ca3c08f73a465f3bebee27773db588d4ef40c245..ae0621e24de33924117743a1b7bf713ee3b4e9ac 100644 --- a/ets2panda/linter/test/main/numeric_semantics.ets.migrate.json +++ b/ets2panda/linter/test/main/numeric_semantics.ets.migrate.json @@ -255,4 +255,4 @@ "severity": "ERROR" } ] -} \ No newline at end of file +} diff --git a/ets2panda/linter/test/main/sdk_ability_lifecycle_monitor.ets.arkts2.json b/ets2panda/linter/test/main/sdk_ability_lifecycle_monitor.ets.arkts2.json index 9a76fd60376d25fe87eb98c5bad5f73c7682fb7c..3b80a2fd3ea2be483cf6002819b13ec3004e0be3 100644 --- a/ets2panda/linter/test/main/sdk_ability_lifecycle_monitor.ets.arkts2.json +++ b/ets2panda/linter/test/main/sdk_ability_lifecycle_monitor.ets.arkts2.json @@ -24,6 +24,16 @@ "rule": "Object literal properties can only contain name-value pairs (arkts-obj-literal-props)", "severity": "ERROR" }, + { + "line": 22, + "column": 23, + "endLine": 22, + "endColumn": 30, + "problem": "ParameterType", + "suggest": "", + "rule": "Type of parameter must be defined explicitly (arkts-require-func-arg-type)", + "severity": "ERROR" + }, { "line": 22, "column": 23, @@ -64,6 +74,16 @@ "rule": "Object literal properties can only contain name-value pairs (arkts-obj-literal-props)", "severity": "ERROR" }, + { + "line": 57, + "column": 23, + "endLine": 57, + "endColumn": 30, + "problem": "ParameterType", + "suggest": "", + "rule": "Type of parameter must be defined explicitly (arkts-require-func-arg-type)", + "severity": "ERROR" + }, { "line": 57, "column": 23, @@ -95,4 +115,4 @@ "severity": "ERROR" } ] -} \ No newline at end of file +} diff --git a/ets2panda/linter/test/main/sdk_ability_lifecycle_monitor.ets.json b/ets2panda/linter/test/main/sdk_ability_lifecycle_monitor.ets.json index 81beed97c616587a30286ec0e80e1fd643531b12..1c4d10326a5b1828a3bb1db67b90efb20d4c477b 100644 --- a/ets2panda/linter/test/main/sdk_ability_lifecycle_monitor.ets.json +++ b/ets2panda/linter/test/main/sdk_ability_lifecycle_monitor.ets.json @@ -35,4 +35,4 @@ "severity": "ERROR" } ] -} \ No newline at end of file +} diff --git a/ets2panda/linter/test/main/sdk_ability_lifecycle_monitor_2.ets.arkts2.json b/ets2panda/linter/test/main/sdk_ability_lifecycle_monitor_2.ets.arkts2.json index e4b1cf0272d520cfef98a19210a6d6f54b659d81..f577df3546443ea934c88f8f1f08741bdcc54c69 100644 --- a/ets2panda/linter/test/main/sdk_ability_lifecycle_monitor_2.ets.arkts2.json +++ b/ets2panda/linter/test/main/sdk_ability_lifecycle_monitor_2.ets.arkts2.json @@ -24,6 +24,16 @@ "rule": "Object literal properties can only contain name-value pairs (arkts-obj-literal-props)", "severity": "ERROR" }, + { + "line": 29, + "column": 23, + "endLine": 29, + "endColumn": 30, + "problem": "ParameterType", + "suggest": "", + "rule": "Type of parameter must be defined explicitly (arkts-require-func-arg-type)", + "severity": "ERROR" + }, { "line": 29, "column": 23, @@ -55,4 +65,4 @@ "severity": "ERROR" } ] -} \ No newline at end of file +} diff --git a/ets2panda/linter/test/sdkwhite/decl_with_duplicate_name_sdk.ets.arkts2.json b/ets2panda/linter/test/sdkwhite/decl_with_duplicate_name_sdk.ets.arkts2.json index d351a537bd6a910bd2443741e098df05f14db2d7..76d25532694166291452e1d717bbc7c68b7b324b 100644 --- a/ets2panda/linter/test/sdkwhite/decl_with_duplicate_name_sdk.ets.arkts2.json +++ b/ets2panda/linter/test/sdkwhite/decl_with_duplicate_name_sdk.ets.arkts2.json @@ -194,6 +194,16 @@ "rule": "API path have changed - please update your imports accordingly (sdk-no-decl-with-duplicate-name)", "severity": "ERROR" }, + { + "line": 54, + "column": 15, + "endLine": 54, + "endColumn": 37, + "problem": "ParameterType", + "suggest": "", + "rule": "Type of parameter must be defined explicitly (arkts-require-func-arg-type)", + "severity": "ERROR" + }, { "line": 54, "column": 15, @@ -425,4 +435,4 @@ "severity": "ERROR" } ] -} \ No newline at end of file +}