From b4c95df81f030fe7d608c36b3742bfdfb9159d23 Mon Sep 17 00:00:00 2001 From: Utku Enes GURSEL Date: Wed, 28 May 2025 16:37:39 +0300 Subject: [PATCH] fix sdk and ASON rule Issue: ICB9IW Description: Use correct rule name for Sdk rule when we try to create a new instance from an interface and fix ASON rule. Signed-off-by: Utku Enes GURSEL --- ets2panda/linter/package.json | 1 + ets2panda/linter/src/cli/LinterCLI.ts | 7 +- ets2panda/linter/src/lib/HomeCheck.ts | 2 +- ets2panda/linter/src/lib/LinterRunner.ts | 7 +- ets2panda/linter/src/lib/TypeScriptLinter.ts | 82 +++++++--- .../src/lib/utils/consts/ArkTS2Rules.ts | 139 ++++++++++++++++- .../src/lib/utils/consts/ArkTSUtilsAPI.ts | 1 + .../linter/test/main/arktsutils_module.ets | 7 +- .../main/arktsutils_module.ets.arkts2.json | 70 ++++++--- .../main/arktsutils_module.ets.autofix.json | 146 ++++++++---------- .../main/arktsutils_module.ets.migrate.ets | 15 +- .../main/arktsutils_module.ets.migrate.json | 63 +++++++- .../return_new_interface.ets.arkts2.json | 10 +- 13 files changed, 399 insertions(+), 151 deletions(-) diff --git a/ets2panda/linter/package.json b/ets2panda/linter/package.json index 73dd2a41801..9c02abca454 100644 --- a/ets2panda/linter/package.json +++ b/ets2panda/linter/package.json @@ -24,6 +24,7 @@ "test_main": "npm run testrunner -- -d test/main", "test_ohmurl": "npm run testrunner -- -d test/ohmurl", "test_interop": "npm run testrunner -- -d test/interop", + "test_sdk": "npm run testrunner -- -d test/sdkwhite", "test_concurrent": "npm run testrunner -- -d test/concurrent", "test_rules": "npm run testrunner -- -d test/rules", "test_regression": "npm run testrunner -- -d test/regression", diff --git a/ets2panda/linter/src/cli/LinterCLI.ts b/ets2panda/linter/src/cli/LinterCLI.ts index a05def96551..45bd9fddcd7 100644 --- a/ets2panda/linter/src/cli/LinterCLI.ts +++ b/ets2panda/linter/src/cli/LinterCLI.ts @@ -89,7 +89,12 @@ async function runIdeInteractiveMode(cmdOptions: CommandLineOptions): Promise, cmdOptions: CommandLineOptions): void { +function mergeLintProblems( + filePath: string, + problems: ProblemInfo[], + mergedProblems: Map, + cmdOptions: CommandLineOptions +): void { if (!mergedProblems.has(filePath)) { mergedProblems.set(filePath, []); } diff --git a/ets2panda/linter/src/lib/HomeCheck.ts b/ets2panda/linter/src/lib/HomeCheck.ts index e7bbae43eb1..abf128b57f1 100644 --- a/ets2panda/linter/src/lib/HomeCheck.ts +++ b/ets2panda/linter/src/lib/HomeCheck.ts @@ -56,7 +56,7 @@ export function getHomeCheckConfigInfo(cmdOptions: CommandLineOptions): { languageTags: languageTags, fileOrFolderToCheck: inputFiles, logLevel: cmdOptions.verbose ? 'DEBUG' : 'INFO', - arkAnalyzerLogLevel: cmdOptions.verbose ? 'DEBUG' : 'ERROR', + arkAnalyzerLogLevel: cmdOptions.verbose ? 'DEBUG' : 'ERROR' }; return { ruleConfigInfo, projectConfigInfo }; } diff --git a/ets2panda/linter/src/lib/LinterRunner.ts b/ets2panda/linter/src/lib/LinterRunner.ts index 457dd86a6c6..04fc4174f46 100644 --- a/ets2panda/linter/src/lib/LinterRunner.ts +++ b/ets2panda/linter/src/lib/LinterRunner.ts @@ -216,7 +216,12 @@ function fix( } const qe: qEd.QuasiEditor = new qEd.QuasiEditor( - fileName, srcFile.text, linterConfig.cmdOptions.linterOptions, undefined, linterConfig.cmdOptions.outputFilePath); + fileName, + srcFile.text, + linterConfig.cmdOptions.linterOptions, + undefined, + linterConfig.cmdOptions.outputFilePath + ); updatedSourceTexts.set(fileName, qe.fix(problemInfos)); appliedFix = true; }); diff --git a/ets2panda/linter/src/lib/TypeScriptLinter.ts b/ets2panda/linter/src/lib/TypeScriptLinter.ts index c6c80448bc5..1f8d345e4f3 100644 --- a/ets2panda/linter/src/lib/TypeScriptLinter.ts +++ b/ets2panda/linter/src/lib/TypeScriptLinter.ts @@ -81,7 +81,7 @@ import { DEFAULT_DECORATOR_WHITE_LIST } from './utils/consts/DefaultDecoratorWhi import { INVALID_IDENTIFIER_KEYWORDS } from './utils/consts/InValidIndentifierKeywords'; import { WORKER_MODULES, WORKER_TEXT } from './utils/consts/WorkerAPI'; import { COLLECTIONS_TEXT, COLLECTIONS_MODULES } from './utils/consts/CollectionsAPI'; -import { ASON_TEXT, ASON_MODULES, JSON_TEXT } from './utils/consts/ArkTSUtilsAPI'; +import { ASON_TEXT, ASON_MODULES, ARKTS_UTILS_TEXT } from './utils/consts/ArkTSUtilsAPI'; import { interanlFunction } from './utils/consts/InternalFunction'; import { ETS_PART, PATH_SEPARATOR } from './utils/consts/OhmUrl'; import { @@ -3723,6 +3723,7 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { return; } this.handleInterfaceImport(node); + this.checkAsonSymbol(node); const tsIdentifier = node; this.handleTsInterop(tsIdentifier, () => { const parent = tsIdentifier.parent; @@ -3762,7 +3763,6 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { if (isArkTs2) { this.checkWorkerSymbol(tsIdentSym, node); this.checkCollectionsSymbol(tsIdentSym, node); - this.checkAsonSymbol(tsIdentSym, node); } } @@ -5020,7 +5020,7 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { const type = this.tsTypeChecker.getTypeAtLocation(calleeExpr); if (type.isClassOrInterface()) { - this.incrementCounters(calleeExpr, FaultID.ConstructorIface); + this.incrementCounters(calleeExpr, FaultID.ConstructorIfaceFromSdk); } } @@ -6695,19 +6695,65 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { } } - private checkAsonSymbol(symbol: ts.Symbol, node: ts.Node): void { - const cb = (): void => { - let autofix: Autofix[] | undefined; - const parent = node.parent; - autofix = this.autofixer?.replaceNode(parent ? parent : node, JSON_TEXT); + private checkAsonSymbol(node: ts.Identifier): void { + if (!this.options.arkts2) { + return; + } - if (ts.isImportSpecifier(parent) && ts.isIdentifier(node)) { - autofix = this.autofixer?.removeImport(node, parent); - } + if (node.text !== ASON_TEXT) { + return; + } - this.incrementCounters(node, FaultID.LimitedStdLibNoASON, autofix); - }; - this.checkSymbolAndExecute(symbol, ASON_TEXT, ASON_MODULES, cb); + const parent = node.parent; + switch (parent.kind) { + case ts.SyntaxKind.QualifiedName: + if (!ts.isQualifiedName(parent)) { + return; + } + if (parent.right.text !== node.text) { + return; + } + this.checkAsonUsage(parent.left); + + break; + case ts.SyntaxKind.PropertyAccessExpression: + if (!ts.isPropertyAccessExpression(parent)) { + return; + } + if (parent.name.text !== node.text) { + return; + } + this.checkAsonUsage(parent.expression); + + break; + default: + } + } + + private checkAsonUsage(nodeToCheck: ts.Node): void { + if (!ts.isIdentifier(nodeToCheck)) { + return; + } + const declaration = this.tsUtils.getDeclarationNode(nodeToCheck); + if (!declaration && nodeToCheck.text === ARKTS_UTILS_TEXT) { + this.incrementCounters(nodeToCheck, FaultID.LimitedStdLibNoASON); + return; + } + + if (!declaration) { + return; + } + + const sourceFile = declaration.getSourceFile(); + const fileName = path.basename(sourceFile.fileName); + + if ( + ASON_MODULES.some((moduleName) => { + return fileName.startsWith(moduleName); + }) + ) { + this.incrementCounters(nodeToCheck, FaultID.LimitedStdLibNoASON); + } } private checkCollectionsSymbol(symbol: ts.Symbol, node: ts.Node): void { @@ -6833,10 +6879,10 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { private isDeclarationInSameFile(node: ts.Node): boolean { const symbol = this.tsTypeChecker.getSymbolAtLocation(node); - const decl = TsUtils.getDeclaration(symbol); - if (decl?.getSourceFile() === node.getSourceFile()) { - return true; - } + const decl = TsUtils.getDeclaration(symbol); + if (decl?.getSourceFile() === node.getSourceFile()) { + return true; + } return false; } diff --git a/ets2panda/linter/src/lib/utils/consts/ArkTS2Rules.ts b/ets2panda/linter/src/lib/utils/consts/ArkTS2Rules.ts index 3bf672666f6..d659854b5f2 100644 --- a/ets2panda/linter/src/lib/utils/consts/ArkTS2Rules.ts +++ b/ets2panda/linter/src/lib/utils/consts/ArkTS2Rules.ts @@ -14,12 +14,139 @@ */ export const arkts2Rules: number[] = [ - 1, 25, 30, 34, 37, 29, 111, 137, 139, 140, 144, 149, 183, 184, 189, 190, 191, 192, 193, 198, 199, 202, 203, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 222, 232, 233, 234, 235, 236, 237, 238, 239, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 281, 282, 283, 284, 285, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, - 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, - 346, 347, 348, 349, 350, 351, 355, 356, 357, 358, 359, 370, 371, 372, 373, 374, 375, 376, 377, 378 + 1, + 25, + 30, + 34, + 37, + 29, + 111, + 137, + 139, + 140, + 144, + 149, + 183, + 184, + 189, + 190, + 191, + 192, + 193, + 198, + 199, + 202, + 203, + 206, + 207, + 208, + 209, + 210, + 211, + 212, + 213, + 214, + 215, + 222, + 232, + 233, + 234, + 235, + 236, + 237, + 238, + 239, + 251, + 252, + 253, + 254, + 255, + 256, + 257, + 258, + 259, + 260, + 261, + 262, + 263, + 264, + 265, + 266, + 267, + 268, + 269, + 270, + 271, + 272, + 273, + 274, + 275, + 300, + 301, + 302, + 303, + 304, + 305, + 306, + 307, + 308, + 309, + 310, + 311, + 312, + 313, + 314, + 315, + 316, + 317, + 318, + 319, + 320, + 321, + 322, + 323, + 324, + 325, + 326, + 327, + 328, + 329, + 330, + 331, + 332, + 333, + 334, + 335, + 336, + 337, + 338, + 339, + 340, + 341, + 342, + 343, + 344, + 345, + 346, + 347, + 348, + 349, + 350, + 351, + 355, + 356, + 357, + 358, + 359, + 370, + 371, + 372, + 373, + 374, + 375, + 376, + 377, + 378 ]; export const onlyArkts2SyntaxRules: Map = new Map([ diff --git a/ets2panda/linter/src/lib/utils/consts/ArkTSUtilsAPI.ts b/ets2panda/linter/src/lib/utils/consts/ArkTSUtilsAPI.ts index dcddab08b58..8218ffc5113 100644 --- a/ets2panda/linter/src/lib/utils/consts/ArkTSUtilsAPI.ts +++ b/ets2panda/linter/src/lib/utils/consts/ArkTSUtilsAPI.ts @@ -16,3 +16,4 @@ export const ASON_TEXT = 'ASON'; export const ASON_MODULES = ['@arkts.utils', '@kit.ArkTS']; export const JSON_TEXT = 'JSON'; +export const ARKTS_UTILS_TEXT = 'ArkTSUtils'; diff --git a/ets2panda/linter/test/main/arktsutils_module.ets b/ets2panda/linter/test/main/arktsutils_module.ets index 3bfeec60053..4e81dea82b9 100644 --- a/ets2panda/linter/test/main/arktsutils_module.ets +++ b/ets2panda/linter/test/main/arktsutils_module.ets @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - import { utils } from './oh_modules/@arkts.utils'; import { utils as ArkTSUtilsAlias } from './oh_modules/@arkts.utils'; @@ -32,4 +31,8 @@ function tesCollectionsUsage() { const utils3 = kitArkTSUtils.ASON.stringify(1); const utils4: string = ArkTSUtilsAlias.ASON.stringify(1); -} \ No newline at end of file + + type CreatedType = ArkTSUtils.ASON.SomeType; + + const someType: CreatedType = ArkTSUtils.ASON.SomeType; +} diff --git a/ets2panda/linter/test/main/arktsutils_module.ets.arkts2.json b/ets2panda/linter/test/main/arktsutils_module.ets.arkts2.json index a090d23f5e1..6da6e6ae158 100644 --- a/ets2panda/linter/test/main/arktsutils_module.ets.arkts2.json +++ b/ets2panda/linter/test/main/arktsutils_module.ets.arkts2.json @@ -15,19 +15,19 @@ ], "result": [ { - "line": 28, - "column": 32, - "endLine": 28, - "endColumn": 36, + "line": 27, + "column": 26, + "endLine": 27, + "endColumn": 31, "problem": "LimitedStdLibNoASON", "suggest": "", "rule": "ASON is not supported. (arkts-no-need-stdlib-ason)", "severity": "ERROR" }, { - "line": 28, + "line": 27, "column": 47, - "endLine": 28, + "endLine": 27, "endColumn": 48, "problem": "NumericSemantics", "suggest": "", @@ -35,19 +35,19 @@ "severity": "ERROR" }, { - "line": 30, - "column": 34, - "endLine": 30, - "endColumn": 38, + "line": 29, + "column": 18, + "endLine": 29, + "endColumn": 33, "problem": "LimitedStdLibNoASON", "suggest": "", "rule": "ASON is not supported. (arkts-no-need-stdlib-ason)", "severity": "ERROR" }, { - "line": 30, + "line": 29, "column": 49, - "endLine": 30, + "endLine": 29, "endColumn": 50, "problem": "NumericSemantics", "suggest": "", @@ -55,19 +55,19 @@ "severity": "ERROR" }, { - "line": 32, - "column": 32, - "endLine": 32, - "endColumn": 36, + "line": 31, + "column": 18, + "endLine": 31, + "endColumn": 31, "problem": "LimitedStdLibNoASON", "suggest": "", "rule": "ASON is not supported. (arkts-no-need-stdlib-ason)", "severity": "ERROR" }, { - "line": 32, + "line": 31, "column": 47, - "endLine": 32, + "endLine": 31, "endColumn": 48, "problem": "NumericSemantics", "suggest": "", @@ -75,24 +75,44 @@ "severity": "ERROR" }, { - "line": 34, - "column": 42, - "endLine": 34, - "endColumn": 46, + "line": 33, + "column": 26, + "endLine": 33, + "endColumn": 41, "problem": "LimitedStdLibNoASON", "suggest": "", "rule": "ASON is not supported. (arkts-no-need-stdlib-ason)", "severity": "ERROR" }, { - "line": 34, + "line": 33, "column": 57, - "endLine": 34, + "endLine": 33, "endColumn": 58, "problem": "NumericSemantics", "suggest": "", "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" + }, + { + "line": 35, + "column": 22, + "endLine": 35, + "endColumn": 32, + "problem": "LimitedStdLibNoASON", + "suggest": "", + "rule": "ASON is not supported. (arkts-no-need-stdlib-ason)", + "severity": "ERROR" + }, + { + "line": 37, + "column": 33, + "endLine": 37, + "endColumn": 43, + "problem": "LimitedStdLibNoASON", + "suggest": "", + "rule": "ASON is not supported. (arkts-no-need-stdlib-ason)", + "severity": "ERROR" } ] -} \ No newline at end of file +} diff --git a/ets2panda/linter/test/main/arktsutils_module.ets.autofix.json b/ets2panda/linter/test/main/arktsutils_module.ets.autofix.json index 77b0d7cec92..d6868a9cbf4 100644 --- a/ets2panda/linter/test/main/arktsutils_module.ets.autofix.json +++ b/ets2panda/linter/test/main/arktsutils_module.ets.autofix.json @@ -15,40 +15,29 @@ ], "result": [ { - "line": 28, - "column": 32, - "endLine": 28, - "endColumn": 36, + "line": 27, + "column": 26, + "endLine": 27, + "endColumn": 31, "problem": "LimitedStdLibNoASON", - "autofix": [ - { - "start": 981, - "end": 991, - "replacementText": "JSON", - "line": 28, - "column": 32, - "endLine": 28, - "endColumn": 36 - } - ], "suggest": "", "rule": "ASON is not supported. (arkts-no-need-stdlib-ason)", "severity": "ERROR" }, { - "line": 28, + "line": 27, "column": 47, - "endLine": 28, + "endLine": 27, "endColumn": 48, "problem": "NumericSemantics", "autofix": [ { - "start": 1002, - "end": 1003, + "start": 1001, + "end": 1002, "replacementText": "1.0", - "line": 28, + "line": 27, "column": 47, - "endLine": 28, + "endLine": 27, "endColumn": 48 } ], @@ -57,40 +46,29 @@ "severity": "ERROR" }, { - "line": 30, - "column": 34, - "endLine": 30, - "endColumn": 38, + "line": 29, + "column": 18, + "endLine": 29, + "endColumn": 33, "problem": "LimitedStdLibNoASON", - "autofix": [ - { - "start": 1024, - "end": 1044, - "replacementText": "JSON", - "line": 30, - "column": 34, - "endLine": 30, - "endColumn": 38 - } - ], "suggest": "", "rule": "ASON is not supported. (arkts-no-need-stdlib-ason)", "severity": "ERROR" }, { - "line": 30, + "line": 29, "column": 49, - "endLine": 30, + "endLine": 29, "endColumn": 50, "problem": "NumericSemantics", "autofix": [ { - "start": 1055, - "end": 1056, + "start": 1054, + "end": 1055, "replacementText": "1.0", - "line": 30, + "line": 29, "column": 49, - "endLine": 30, + "endLine": 29, "endColumn": 50 } ], @@ -99,40 +77,29 @@ "severity": "ERROR" }, { - "line": 32, - "column": 32, - "endLine": 32, - "endColumn": 36, + "line": 31, + "column": 18, + "endLine": 31, + "endColumn": 31, "problem": "LimitedStdLibNoASON", - "autofix": [ - { - "start": 1077, - "end": 1095, - "replacementText": "JSON", - "line": 32, - "column": 32, - "endLine": 32, - "endColumn": 36 - } - ], "suggest": "", "rule": "ASON is not supported. (arkts-no-need-stdlib-ason)", "severity": "ERROR" }, { - "line": 32, + "line": 31, "column": 47, - "endLine": 32, + "endLine": 31, "endColumn": 48, "problem": "NumericSemantics", "autofix": [ { - "start": 1106, - "end": 1107, + "start": 1105, + "end": 1106, "replacementText": "1.0", - "line": 32, + "line": 31, "column": 47, - "endLine": 32, + "endLine": 31, "endColumn": 48 } ], @@ -141,46 +108,55 @@ "severity": "ERROR" }, { - "line": 34, - "column": 42, - "endLine": 34, - "endColumn": 46, + "line": 33, + "column": 26, + "endLine": 33, + "endColumn": 41, "problem": "LimitedStdLibNoASON", - "autofix": [ - { - "start": 1136, - "end": 1156, - "replacementText": "JSON", - "line": 34, - "column": 42, - "endLine": 34, - "endColumn": 46 - } - ], "suggest": "", "rule": "ASON is not supported. (arkts-no-need-stdlib-ason)", "severity": "ERROR" }, { - "line": 34, + "line": 33, "column": 57, - "endLine": 34, + "endLine": 33, "endColumn": 58, "problem": "NumericSemantics", "autofix": [ { - "start": 1167, - "end": 1168, + "start": 1166, + "end": 1167, "replacementText": "1.0", - "line": 34, + "line": 33, "column": 57, - "endLine": 34, + "endLine": 33, "endColumn": 58 } ], "suggest": "", "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", "severity": "ERROR" + }, + { + "line": 35, + "column": 22, + "endLine": 35, + "endColumn": 32, + "problem": "LimitedStdLibNoASON", + "suggest": "", + "rule": "ASON is not supported. (arkts-no-need-stdlib-ason)", + "severity": "ERROR" + }, + { + "line": 37, + "column": 33, + "endLine": 37, + "endColumn": 43, + "problem": "LimitedStdLibNoASON", + "suggest": "", + "rule": "ASON is not supported. (arkts-no-need-stdlib-ason)", + "severity": "ERROR" } ] -} \ No newline at end of file +} diff --git a/ets2panda/linter/test/main/arktsutils_module.ets.migrate.ets b/ets2panda/linter/test/main/arktsutils_module.ets.migrate.ets index b2a00452ad6..3b1d7e17b6e 100644 --- a/ets2panda/linter/test/main/arktsutils_module.ets.migrate.ets +++ b/ets2panda/linter/test/main/arktsutils_module.ets.migrate.ets @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - import { utils } from './oh_modules/@arkts.utils'; import { utils as ArkTSUtilsAlias } from './oh_modules/@arkts.utils'; @@ -25,11 +24,15 @@ export { utils } from './oh_modules/@arkts.utils'; function tesCollectionsUsage() { - const utils1: string = JSON.stringify(1.0); + const utils1: string = utils.ASON.stringify(1.0); + + const utils2 = ArkTSUtilsAlias.ASON.stringify(1.0); + + const utils3 = kitArkTSUtils.ASON.stringify(1.0); - const utils2 = JSON.stringify(1.0); + const utils4: string = ArkTSUtilsAlias.ASON.stringify(1.0); - const utils3 = JSON.stringify(1.0); + type CreatedType = ArkTSUtils.ASON.SomeType; - const utils4: string = JSON.stringify(1.0); -} \ No newline at end of file + const someType: CreatedType = ArkTSUtils.ASON.SomeType; +} diff --git a/ets2panda/linter/test/main/arktsutils_module.ets.migrate.json b/ets2panda/linter/test/main/arktsutils_module.ets.migrate.json index 9f305c86d7f..1b597eff5b8 100644 --- a/ets2panda/linter/test/main/arktsutils_module.ets.migrate.json +++ b/ets2panda/linter/test/main/arktsutils_module.ets.migrate.json @@ -13,5 +13,66 @@ "See the License for the specific language governing permissions and", "limitations under the License." ], - "result": [] + "result": [ + { + "line": 27, + "column": 26, + "endLine": 27, + "endColumn": 31, + "problem": "LimitedStdLibNoASON", + "suggest": "", + "rule": "ASON is not supported. (arkts-no-need-stdlib-ason)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 18, + "endLine": 29, + "endColumn": 33, + "problem": "LimitedStdLibNoASON", + "suggest": "", + "rule": "ASON is not supported. (arkts-no-need-stdlib-ason)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 18, + "endLine": 31, + "endColumn": 31, + "problem": "LimitedStdLibNoASON", + "suggest": "", + "rule": "ASON is not supported. (arkts-no-need-stdlib-ason)", + "severity": "ERROR" + }, + { + "line": 33, + "column": 26, + "endLine": 33, + "endColumn": 41, + "problem": "LimitedStdLibNoASON", + "suggest": "", + "rule": "ASON is not supported. (arkts-no-need-stdlib-ason)", + "severity": "ERROR" + }, + { + "line": 35, + "column": 22, + "endLine": 35, + "endColumn": 32, + "problem": "LimitedStdLibNoASON", + "suggest": "", + "rule": "ASON is not supported. (arkts-no-need-stdlib-ason)", + "severity": "ERROR" + }, + { + "line": 37, + "column": 33, + "endLine": 37, + "endColumn": 43, + "problem": "LimitedStdLibNoASON", + "suggest": "", + "rule": "ASON is not supported. (arkts-no-need-stdlib-ason)", + "severity": "ERROR" + } + ] } diff --git a/ets2panda/linter/test/sdkwhite/return_new_interface.ets.arkts2.json b/ets2panda/linter/test/sdkwhite/return_new_interface.ets.arkts2.json index 92f597960e2..7b974d3450d 100644 --- a/ets2panda/linter/test/sdkwhite/return_new_interface.ets.arkts2.json +++ b/ets2panda/linter/test/sdkwhite/return_new_interface.ets.arkts2.json @@ -49,9 +49,9 @@ "column": 14, "endLine": 26, "endColumn": 15, - "problem": "ConstructorIface", + "problem": "ConstructorIfaceFromSdk", "suggest": "", - "rule": "Construct signatures are not supported in interfaces (arkts-no-ctor-signatures-iface)", + "rule": "Construct signatures are not supported in interfaces.(sdk-ctor-signatures-iface)", "severity": "ERROR" }, { @@ -79,9 +79,9 @@ "column": 14, "endLine": 30, "endColumn": 15, - "problem": "ConstructorIface", + "problem": "ConstructorIfaceFromSdk", "suggest": "", - "rule": "Construct signatures are not supported in interfaces (arkts-no-ctor-signatures-iface)", + "rule": "Construct signatures are not supported in interfaces.(sdk-ctor-signatures-iface)", "severity": "ERROR" }, { @@ -95,4 +95,4 @@ "severity": "ERROR" } ] -} \ No newline at end of file +} -- Gitee