From e72f8c5204fdbba320576bc62885577d16f9528a Mon Sep 17 00:00:00 2001 From: Urakov Alexandr Date: Fri, 29 Dec 2023 09:42:15 +0300 Subject: [PATCH] [ArkTS][Linter] Port Igor's patch to fix highlight ranges Signed-off-by: Urakov Alexandr --- linter/lib/TypeScriptLinter.ts | 24 +- linter/lib/utils/TsUtils.ts | 152 +++++- linter/test/array_literals.ts.strict.json | 70 ++- linter/test/catch_clause.ts.autofix.json | 4 +- linter/test/catch_clause.ts.strict.json | 32 +- linter/test/const_assertion.ts.relax.json | 24 +- linter/test/const_assertion.ts.strict.json | 24 +- linter/test/for_stmts.ts.relax.json | 38 +- linter/test/for_stmts.ts.strict.json | 38 +- linter/test/func_return_type.ts.autofix.json | 18 +- linter/test/func_return_type.ts.strict.json | 18 +- linter/test/instanceof.ts.relax.json | 18 +- linter/test/instanceof.ts.strict.json | 18 +- linter/test/loop_over_set.ts.relax.json | 76 +-- linter/test/loop_over_set.ts.strict.json | 76 +-- linter/test/modules.ts.autofix.json | 2 +- linter/test/modules.ts.strict.json | 2 +- linter/test/type_declarations.ts.relax.json | 78 ++- linter/test/type_declarations.ts.strict.json | 86 +++- linter/test/unique_names.ts.strict.json | 478 +++++++++++++------ linter/test/unknown_params.ts.strict.json | 2 +- linter/test/utility_types.ts.relax.json | 307 +++++++++--- linter/test/utility_types.ts.strict.json | 337 +++++++++---- linter/test/var_declarations.ts.relax.json | 10 +- linter/test/var_declarations.ts.strict.json | 38 +- linter/test_rules/rule103.ts.autofix.json | 6 +- linter/test_rules/rule103.ts.strict.json | 6 +- linter/test_rules/rule104.ts.autofix.json | 16 +- linter/test_rules/rule104.ts.relax.json | 16 +- linter/test_rules/rule104.ts.strict.json | 16 +- linter/test_rules/rule142.ts.autofix.json | 20 +- linter/test_rules/rule142.ts.relax.json | 20 +- linter/test_rules/rule142.ts.strict.json | 20 +- linter/test_rules/rule4.ts.autofix.json | 2 +- linter/test_rules/rule4.ts.strict.json | 2 +- linter/test_rules/rule65.ts.autofix.json | 18 +- linter/test_rules/rule65.ts.relax.json | 18 +- linter/test_rules/rule65.ts.strict.json | 18 +- linter/test_rules/rule79.ts.autofix.json | 16 +- linter/test_rules/rule79.ts.strict.json | 16 +- linter/test_rules/rule80.ts.autofix.json | 16 +- linter/test_rules/rule80.ts.relax.json | 16 +- linter/test_rules/rule80.ts.strict.json | 16 +- linter/test_rules/rule90.ts.autofix.json | 18 +- linter/test_rules/rule90.ts.strict.json | 18 +- linter/test_rules/rule90_3.ts.autofix.json | 16 +- linter/test_rules/rule90_3.ts.strict.json | 16 +- 47 files changed, 1692 insertions(+), 604 deletions(-) diff --git a/linter/lib/TypeScriptLinter.ts b/linter/lib/TypeScriptLinter.ts index 6b889e48..3d64ba3b 100644 --- a/linter/lib/TypeScriptLinter.ts +++ b/linter/lib/TypeScriptLinter.ts @@ -207,7 +207,7 @@ export class TypeScriptLinter { this.nodeCounters[faultId]++; const { line, character } = this.getLineAndCharacterOfNode(node); if (TypeScriptLinter.ideMode) { - this.incrementCountersIdeMode(node, faultId, line, character, autofixable, autofix); + this.incrementCountersIdeMode(node, faultId, autofixable, autofix); } else { const faultDescr = faultDesc[faultId]; const faultType = LinterConfig.tsSyntaxKindNames[node.kind]; @@ -238,17 +238,15 @@ export class TypeScriptLinter { private incrementCountersIdeMode( node: ts.Node | ts.CommentRange, faultId: number, - line: number, - character: number, autofixable: boolean, autofix?: Autofix[] ): void { if (!TypeScriptLinter.ideMode) { return; } - const startPos = TsUtils.getStartPos(node); - const endPos = TsUtils.getEndPos(node); - const pos = this.sourceFile!.getLineAndCharacterOfPosition(endPos); + const [startOffset, endOffset] = TsUtils.getHighlightRange(node, faultId); + const startPos = this.sourceFile!.getLineAndCharacterOfPosition(startOffset); + const endPos = this.sourceFile!.getLineAndCharacterOfPosition(endOffset); const faultDescr = faultDesc[faultId]; const faultType = LinterConfig.tsSyntaxKindNames[node.kind]; @@ -258,12 +256,12 @@ export class TypeScriptLinter { const severity = faultsAttrs[faultId]?.severity ?? ProblemSeverity.ERROR; const isMsgNumValid = cookBookMsgNum > 0; const badNodeInfo: ProblemInfo = { - line: line, - column: character, - endLine: pos.line + 1, - endColumn: pos.character + 1, - start: startPos, - end: endPos, + line: startPos.line + 1, + column: startPos.character + 1, + endLine: endPos.line + 1, + endColumn: endPos.character + 1, + start: startOffset, + end: endOffset, type: faultType, severity: severity, problem: FaultID[faultId], @@ -452,7 +450,7 @@ export class TypeScriptLinter { for (const tsTypeExpr of hClause.types) { const tsExprType = this.tsTypeChecker.getTypeAtLocation(tsTypeExpr.expression); if (tsExprType.isClass()) { - this.incrementCounters(node, FaultID.InterfaceExtendsClass); + this.incrementCounters(tsTypeExpr, FaultID.InterfaceExtendsClass); } else if (tsExprType.isClassOrInterface()) { this.lintForInterfaceExtendsDifferentPorpertyTypes(node, tsExprType, prop2type); } diff --git a/linter/lib/utils/TsUtils.ts b/linter/lib/utils/TsUtils.ts index 7bffccf7..70fd4abf 100644 --- a/linter/lib/utils/TsUtils.ts +++ b/linter/lib/utils/TsUtils.ts @@ -25,6 +25,7 @@ import { pathContainsDirectory } from './functions/PathHelper'; import { ARKTS_IGNORE_DIRS, ARKTS_IGNORE_FILES } from './consts/ArktsIgnorePaths'; import { isAssignmentOperator } from './functions/isAssignmentOperator'; import { forEachNodeInSubtree } from './functions/ForEachNodeInSubtree'; +import { FaultID } from '../Problems'; export type CheckType = (this: TsUtils, t: ts.Type) => boolean; export class TsUtils { @@ -532,11 +533,7 @@ export class TsUtils { } // return true if two class types are not related by inheritance and structural identity check is needed - needToDeduceStructuralIdentity( - lhsType: ts.Type, - rhsType: ts.Type, - rhsExpr: ts.Expression - ): boolean { + needToDeduceStructuralIdentity(lhsType: ts.Type, rhsType: ts.Type, rhsExpr: ts.Expression): boolean { lhsType = TsUtils.getNonNullableType(lhsType); rhsType = TsUtils.getNonNullableType(rhsType); if (this.isLibraryType(lhsType)) { @@ -561,8 +558,11 @@ export class TsUtils { // missing exact rule return true; } - return lhsType.isClassOrInterface() && rhsType.isClassOrInterface() && - !this.relatedByInheritanceOrIdentical(rhsType, lhsType); + return ( + lhsType.isClassOrInterface() && + rhsType.isClassOrInterface() && + !this.relatedByInheritanceOrIdentical(rhsType, lhsType) + ); } private processParentTypes( @@ -850,8 +850,8 @@ export class TsUtils { if (!prop.name) { return false; } - const isValidComputedProperty = ts.isComputedPropertyName(prop.name) && - this.isValidComputedPropertyName(prop.name, true); + const isValidComputedProperty = + ts.isComputedPropertyName(prop.name) && this.isValidComputedPropertyName(prop.name, true); if (!ts.isStringLiteral(prop.name) && !ts.isNumericLiteral(prop.name) && !isValidComputedProperty) { return false; } @@ -978,6 +978,140 @@ export class TsUtils { (nodeOrComment as ts.Node).getEnd(); } + static getHighlightRange(nodeOrComment: ts.Node | ts.CommentRange, faultId: number): [number, number] { + return ( + this.highlightRangeHandlers.get(faultId)?.call(this, nodeOrComment) ?? [ + this.getStartPos(nodeOrComment), + this.getEndPos(nodeOrComment) + ] + ); + } + + static highlightRangeHandlers = new Map([ + [FaultID.VarDeclaration, TsUtils.getVarDeclarationHighlightRange], + [FaultID.CatchWithUnsupportedType, TsUtils.getCatchWithUnsupportedTypeHighlightRange], + [FaultID.ForInStatement, TsUtils.getForInStatementHighlightRange], + [FaultID.WithStatement, TsUtils.getWithStatementHighlightRange], + [FaultID.DeleteOperator, TsUtils.getDeleteOperatorHighlightRange], + [FaultID.TypeQuery, TsUtils.getTypeQueryHighlightRange], + [FaultID.InstanceofUnsupported, TsUtils.getInstanceofUnsupportedHighlightRange], + [FaultID.ConstAssertion, TsUtils.getConstAssertionHighlightRange], + [FaultID.LimitedReturnTypeInference, TsUtils.getLimitedReturnTypeInferenceHighlightRange], + [FaultID.LocalFunction, TsUtils.getLocalFunctionHighlightRange], + [FaultID.FunctionBind, TsUtils.getFunctionApplyCallHighlightRange], + [FaultID.FunctionApplyCall, TsUtils.getFunctionApplyCallHighlightRange], + [FaultID.DeclWithDuplicateName, TsUtils.getDeclWithDuplicateNameHighlightRange], + [FaultID.ObjectLiteralNoContextType, TsUtils.getObjectLiteralNoContextTypeHighlightRange], + [FaultID.ClassExpression, TsUtils.getClassExpressionHighlightRange] + ]); + + static getVarDeclarationHighlightRange(nodeOrComment: ts.Node | ts.CommentRange): [number, number] | undefined { + return this.getKeywordHighlightRange(nodeOrComment, 'var'); + } + + static getCatchWithUnsupportedTypeHighlightRange( + nodeOrComment: ts.Node | ts.CommentRange + ): [number, number] | undefined { + const catchClauseNode = (nodeOrComment as ts.CatchClause).variableDeclaration; + if (catchClauseNode !== undefined) { + return [catchClauseNode.getStart(), catchClauseNode.getEnd()]; + } + + return undefined; + } + + static getForInStatementHighlightRange(nodeOrComment: ts.Node | ts.CommentRange): [number, number] | undefined { + return [ + this.getEndPos((nodeOrComment as ts.ForInStatement).initializer) + 1, + this.getStartPos((nodeOrComment as ts.ForInStatement).expression) - 1 + ]; + } + + static getWithStatementHighlightRange(nodeOrComment: ts.Node | ts.CommentRange): [number, number] | undefined { + return [this.getStartPos(nodeOrComment), (nodeOrComment as ts.WithStatement).statement.getStart() - 1]; + } + + static getDeleteOperatorHighlightRange(nodeOrComment: ts.Node | ts.CommentRange): [number, number] | undefined { + return this.getKeywordHighlightRange(nodeOrComment, 'delete'); + } + + static getTypeQueryHighlightRange(nodeOrComment: ts.Node | ts.CommentRange): [number, number] | undefined { + return this.getKeywordHighlightRange(nodeOrComment, 'typeof'); + } + + static getInstanceofUnsupportedHighlightRange( + nodeOrComment: ts.Node | ts.CommentRange + ): [number, number] | undefined { + return this.getKeywordHighlightRange((nodeOrComment as ts.BinaryExpression).operatorToken, 'instanceof'); + } + + static getConstAssertionHighlightRange(nodeOrComment: ts.Node | ts.CommentRange): [number, number] | undefined { + if (nodeOrComment.kind === ts.SyntaxKind.AsExpression) { + return [ + (nodeOrComment as ts.AsExpression).expression.getEnd() + 1, + (nodeOrComment as ts.AsExpression).type.getStart() - 1 + ]; + } + return [ + (nodeOrComment as ts.TypeAssertion).expression.getEnd() + 1, + (nodeOrComment as ts.TypeAssertion).type.getEnd() + 1 + ]; + } + + static getLimitedReturnTypeInferenceHighlightRange( + nodeOrComment: ts.Node | ts.CommentRange + ): [number, number] | undefined { + let node: ts.Node | undefined; + if (nodeOrComment.kind === ts.SyntaxKind.FunctionExpression) { + // we got error about return type so it should be present + node = (nodeOrComment as ts.FunctionExpression).type; + } else if (nodeOrComment.kind === ts.SyntaxKind.FunctionDeclaration) { + node = (nodeOrComment as ts.FunctionDeclaration).name; + } + + if (node !== undefined) { + return [node.getStart(), node.getEnd()]; + } + + return undefined; + } + + static getLocalFunctionHighlightRange(nodeOrComment: ts.Node | ts.CommentRange): [number, number] | undefined { + return this.getKeywordHighlightRange(nodeOrComment, 'function'); + } + + static getFunctionApplyCallHighlightRange(nodeOrComment: ts.Node | ts.CommentRange): [number, number] | undefined { + const pointPos = (nodeOrComment as ts.Node).getText().lastIndexOf('.'); + return [this.getStartPos(nodeOrComment) + pointPos + 1, this.getEndPos(nodeOrComment)]; + } + + static getDeclWithDuplicateNameHighlightRange( + nodeOrComment: ts.Node | ts.CommentRange + ): [number, number] | undefined { + // in case of private identifier no range update is needed + const nameNode: ts.Node | undefined = (nodeOrComment as ts.NamedDeclaration).name; + if (nameNode !== undefined) { + return [nameNode.getStart(), nameNode.getEnd()]; + } + + return undefined; + } + + static getObjectLiteralNoContextTypeHighlightRange( + nodeOrComment: ts.Node | ts.CommentRange + ): [number, number] | undefined { + return this.getKeywordHighlightRange(nodeOrComment, '{'); + } + + static getClassExpressionHighlightRange(nodeOrComment: ts.Node | ts.CommentRange): [number, number] | undefined { + return this.getKeywordHighlightRange(nodeOrComment, 'class'); + } + + static getKeywordHighlightRange(nodeOrComment: ts.Node | ts.CommentRange, keyword: string): [number, number] { + const start = this.getStartPos(nodeOrComment); + return [start, start + keyword.length]; + } + isStdRecordType(type: ts.Type): boolean { /* diff --git a/linter/test/array_literals.ts.strict.json b/linter/test/array_literals.ts.strict.json index 6a703fb8..77cde082 100644 --- a/linter/test/array_literals.ts.strict.json +++ b/linter/test/array_literals.ts.strict.json @@ -17,87 +17,121 @@ { "line": 17, "column": 6, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 18, "column": 6, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 25, "column": 12, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 26, "column": 12, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 43, "column": 8, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 44, "column": 8, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 72, - "column": 1, - "problem": "LimitedReturnTypeInference" + "column": 10, + "problem": "LimitedReturnTypeInference", + "suggest": "", + "rule": "Function return type inference is limited (arkts-no-implicit-return-types)" }, { "line": 72, "column": 18, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 75, "column": 18, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 97, "column": 18, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 100, "column": 18, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 126, "column": 11, - "problem": "ArrayLiteralNoContextType" + "problem": "ArrayLiteralNoContextType", + "suggest": "", + "rule": "Array literals must contain elements of only inferrable types (arkts-no-noninferrable-arr-literals)" }, { "line": 126, "column": 13, - "problem": "ObjectLiteralNoContextType" + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)" }, { "line": 126, "column": 30, - "problem": "ObjectLiteralNoContextType" + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)" }, { "line": 18, "column": 3, - "problem": "StrictDiagnostic" + "problem": "StrictDiagnostic", + "suggest": "Property 'b' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property 'b' has no initializer and is not definitely assigned in the constructor." }, { "line": 19, "column": 3, - "problem": "StrictDiagnostic" + "problem": "StrictDiagnostic", + "suggest": "Property 'c' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property 'c' has no initializer and is not definitely assigned in the constructor." }, { "line": 20, "column": 3, - "problem": "StrictDiagnostic" + "problem": "StrictDiagnostic", + "suggest": "Property 'd' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property 'd' has no initializer and is not definitely assigned in the constructor." } ] } \ No newline at end of file diff --git a/linter/test/catch_clause.ts.autofix.json b/linter/test/catch_clause.ts.autofix.json index d4131bb8..53819a02 100755 --- a/linter/test/catch_clause.ts.autofix.json +++ b/linter/test/catch_clause.ts.autofix.json @@ -24,7 +24,7 @@ }, { "line": 18, - "column": 3, + "column": 10, "problem": "CatchWithUnsupportedType", "autofixable": true, "autofix": [ @@ -55,7 +55,7 @@ }, { "line": 24, - "column": 3, + "column": 10, "problem": "CatchWithUnsupportedType", "autofixable": true, "autofix": [ diff --git a/linter/test/catch_clause.ts.strict.json b/linter/test/catch_clause.ts.strict.json index f275f94d..7a9cf239 100644 --- a/linter/test/catch_clause.ts.strict.json +++ b/linter/test/catch_clause.ts.strict.json @@ -17,37 +17,51 @@ { "line": 17, "column": 13, - "problem": "ThrowStatement" + "problem": "ThrowStatement", + "suggest": "", + "rule": "\"throw\" statements cannot accept values of arbitrary types (arkts-limited-throw)" }, { "line": 18, - "column": 3, - "problem": "CatchWithUnsupportedType" + "column": 10, + "problem": "CatchWithUnsupportedType", + "suggest": "", + "rule": "Type annotation in catch clause is not supported (arkts-no-types-in-catch)" }, { "line": 18, "column": 13, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 23, "column": 13, - "problem": "ThrowStatement" + "problem": "ThrowStatement", + "suggest": "", + "rule": "\"throw\" statements cannot accept values of arbitrary types (arkts-limited-throw)" }, { "line": 24, - "column": 3, - "problem": "CatchWithUnsupportedType" + "column": 10, + "problem": "CatchWithUnsupportedType", + "suggest": "", + "rule": "Type annotation in catch clause is not supported (arkts-no-types-in-catch)" }, { "line": 24, "column": 13, - "problem": "UnknownType" + "problem": "UnknownType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 29, "column": 13, - "problem": "ThrowStatement" + "problem": "ThrowStatement", + "suggest": "", + "rule": "\"throw\" statements cannot accept values of arbitrary types (arkts-limited-throw)" } ] } \ No newline at end of file diff --git a/linter/test/const_assertion.ts.relax.json b/linter/test/const_assertion.ts.relax.json index 61b0b061..d38b74f0 100755 --- a/linter/test/const_assertion.ts.relax.json +++ b/linter/test/const_assertion.ts.relax.json @@ -16,23 +16,31 @@ "nodes": [ { "line": 16, - "column": 11, - "problem": "ConstAssertion" + "column": 19, + "problem": "ConstAssertion", + "suggest": "", + "rule": "\"as const\" assertions are not supported (arkts-no-as-const)" }, { "line": 17, - "column": 11, - "problem": "ConstAssertion" + "column": 20, + "problem": "ConstAssertion", + "suggest": "", + "rule": "\"as const\" assertions are not supported (arkts-no-as-const)" }, { "line": 19, - "column": 12, - "problem": "ConstAssertion" + "column": 27, + "problem": "ConstAssertion", + "suggest": "", + "rule": "\"as const\" assertions are not supported (arkts-no-as-const)" }, { "line": 20, - "column": 12, - "problem": "ConstAssertion" + "column": 28, + "problem": "ConstAssertion", + "suggest": "", + "rule": "\"as const\" assertions are not supported (arkts-no-as-const)" } ] } \ No newline at end of file diff --git a/linter/test/const_assertion.ts.strict.json b/linter/test/const_assertion.ts.strict.json index 61b0b061..d38b74f0 100755 --- a/linter/test/const_assertion.ts.strict.json +++ b/linter/test/const_assertion.ts.strict.json @@ -16,23 +16,31 @@ "nodes": [ { "line": 16, - "column": 11, - "problem": "ConstAssertion" + "column": 19, + "problem": "ConstAssertion", + "suggest": "", + "rule": "\"as const\" assertions are not supported (arkts-no-as-const)" }, { "line": 17, - "column": 11, - "problem": "ConstAssertion" + "column": 20, + "problem": "ConstAssertion", + "suggest": "", + "rule": "\"as const\" assertions are not supported (arkts-no-as-const)" }, { "line": 19, - "column": 12, - "problem": "ConstAssertion" + "column": 27, + "problem": "ConstAssertion", + "suggest": "", + "rule": "\"as const\" assertions are not supported (arkts-no-as-const)" }, { "line": 20, - "column": 12, - "problem": "ConstAssertion" + "column": 28, + "problem": "ConstAssertion", + "suggest": "", + "rule": "\"as const\" assertions are not supported (arkts-no-as-const)" } ] } \ No newline at end of file diff --git a/linter/test/for_stmts.ts.relax.json b/linter/test/for_stmts.ts.relax.json index 362fa94c..73a294f7 100644 --- a/linter/test/for_stmts.ts.relax.json +++ b/linter/test/for_stmts.ts.relax.json @@ -16,43 +16,59 @@ "nodes": [ { "line": 22, - "column": 1, - "problem": "ForInStatement" + "column": 14, + "problem": "ForInStatement", + "suggest": "", + "rule": "\"for .. in\" is not supported (arkts-no-for-in)" }, { "line": 22, "column": 17, - "problem": "ClassAsObject" + "problem": "ClassAsObject", + "suggest": "", + "rule": "Classes cannot be used as objects (arkts-no-classes-as-obj)" }, { "line": 49, - "column": 1, - "problem": "ForInStatement" + "column": 14, + "problem": "ForInStatement", + "suggest": "", + "rule": "\"for .. in\" is not supported (arkts-no-for-in)" }, { "line": 75, - "column": 1, - "problem": "ForInStatement" + "column": 14, + "problem": "ForInStatement", + "suggest": "", + "rule": "\"for .. in\" is not supported (arkts-no-for-in)" }, { "line": 91, "column": 14, - "problem": "CommaOperator" + "problem": "CommaOperator", + "suggest": "", + "rule": "The comma operator \",\" is supported only in \"for\" loops (arkts-no-comma-outside-loops)" }, { "line": 91, "column": 54, - "problem": "CommaOperator" + "problem": "CommaOperator", + "suggest": "", + "rule": "The comma operator \",\" is supported only in \"for\" loops (arkts-no-comma-outside-loops)" }, { "line": 99, "column": 7, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 124, "column": 12, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" } ] } \ No newline at end of file diff --git a/linter/test/for_stmts.ts.strict.json b/linter/test/for_stmts.ts.strict.json index 362fa94c..73a294f7 100644 --- a/linter/test/for_stmts.ts.strict.json +++ b/linter/test/for_stmts.ts.strict.json @@ -16,43 +16,59 @@ "nodes": [ { "line": 22, - "column": 1, - "problem": "ForInStatement" + "column": 14, + "problem": "ForInStatement", + "suggest": "", + "rule": "\"for .. in\" is not supported (arkts-no-for-in)" }, { "line": 22, "column": 17, - "problem": "ClassAsObject" + "problem": "ClassAsObject", + "suggest": "", + "rule": "Classes cannot be used as objects (arkts-no-classes-as-obj)" }, { "line": 49, - "column": 1, - "problem": "ForInStatement" + "column": 14, + "problem": "ForInStatement", + "suggest": "", + "rule": "\"for .. in\" is not supported (arkts-no-for-in)" }, { "line": 75, - "column": 1, - "problem": "ForInStatement" + "column": 14, + "problem": "ForInStatement", + "suggest": "", + "rule": "\"for .. in\" is not supported (arkts-no-for-in)" }, { "line": 91, "column": 14, - "problem": "CommaOperator" + "problem": "CommaOperator", + "suggest": "", + "rule": "The comma operator \",\" is supported only in \"for\" loops (arkts-no-comma-outside-loops)" }, { "line": 91, "column": 54, - "problem": "CommaOperator" + "problem": "CommaOperator", + "suggest": "", + "rule": "The comma operator \",\" is supported only in \"for\" loops (arkts-no-comma-outside-loops)" }, { "line": 99, "column": 7, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 124, "column": 12, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" } ] } \ No newline at end of file diff --git a/linter/test/func_return_type.ts.autofix.json b/linter/test/func_return_type.ts.autofix.json index baae30f2..683c01ee 100644 --- a/linter/test/func_return_type.ts.autofix.json +++ b/linter/test/func_return_type.ts.autofix.json @@ -16,7 +16,7 @@ "nodes": [ { "line": 16, - "column": 1, + "column": 10, "problem": "LimitedReturnTypeInference", "autofixable": true, "autofix": [ @@ -31,7 +31,7 @@ }, { "line": 23, - "column": 1, + "column": 10, "problem": "LimitedReturnTypeInference", "autofixable": true, "autofix": [ @@ -46,7 +46,7 @@ }, { "line": 33, - "column": 1, + "column": 10, "problem": "LimitedReturnTypeInference", "autofixable": true, "autofix": [ @@ -61,7 +61,7 @@ }, { "line": 40, - "column": 1, + "column": 10, "problem": "LimitedReturnTypeInference", "autofixable": false, "suggest": "", @@ -69,7 +69,7 @@ }, { "line": 46, - "column": 1, + "column": 10, "problem": "LimitedReturnTypeInference", "autofixable": false, "suggest": "", @@ -77,7 +77,7 @@ }, { "line": 54, - "column": 1, + "column": 10, "problem": "LimitedReturnTypeInference", "autofixable": false, "suggest": "", @@ -85,7 +85,7 @@ }, { "line": 57, - "column": 1, + "column": 10, "problem": "LimitedReturnTypeInference", "autofixable": false, "suggest": "", @@ -283,7 +283,7 @@ }, { "line": 131, - "column": 1, + "column": 10, "problem": "LimitedReturnTypeInference", "autofixable": true, "autofix": [ @@ -298,7 +298,7 @@ }, { "line": 135, - "column": 1, + "column": 18, "problem": "LimitedReturnTypeInference", "autofixable": false, "suggest": "", diff --git a/linter/test/func_return_type.ts.strict.json b/linter/test/func_return_type.ts.strict.json index 756705c0..2e0cdf0b 100644 --- a/linter/test/func_return_type.ts.strict.json +++ b/linter/test/func_return_type.ts.strict.json @@ -16,49 +16,49 @@ "nodes": [ { "line": 16, - "column": 1, + "column": 10, "problem": "LimitedReturnTypeInference", "suggest": "", "rule": "Function return type inference is limited (arkts-no-implicit-return-types)" }, { "line": 23, - "column": 1, + "column": 10, "problem": "LimitedReturnTypeInference", "suggest": "", "rule": "Function return type inference is limited (arkts-no-implicit-return-types)" }, { "line": 33, - "column": 1, + "column": 10, "problem": "LimitedReturnTypeInference", "suggest": "", "rule": "Function return type inference is limited (arkts-no-implicit-return-types)" }, { "line": 40, - "column": 1, + "column": 10, "problem": "LimitedReturnTypeInference", "suggest": "", "rule": "Function return type inference is limited (arkts-no-implicit-return-types)" }, { "line": 46, - "column": 1, + "column": 10, "problem": "LimitedReturnTypeInference", "suggest": "", "rule": "Function return type inference is limited (arkts-no-implicit-return-types)" }, { "line": 54, - "column": 1, + "column": 10, "problem": "LimitedReturnTypeInference", "suggest": "", "rule": "Function return type inference is limited (arkts-no-implicit-return-types)" }, { "line": 57, - "column": 1, + "column": 10, "problem": "LimitedReturnTypeInference", "suggest": "", "rule": "Function return type inference is limited (arkts-no-implicit-return-types)" @@ -170,14 +170,14 @@ }, { "line": 131, - "column": 1, + "column": 10, "problem": "LimitedReturnTypeInference", "suggest": "", "rule": "Function return type inference is limited (arkts-no-implicit-return-types)" }, { "line": 135, - "column": 1, + "column": 18, "problem": "LimitedReturnTypeInference", "suggest": "", "rule": "Function return type inference is limited (arkts-no-implicit-return-types)" diff --git a/linter/test/instanceof.ts.relax.json b/linter/test/instanceof.ts.relax.json index c416e034..348b7dd4 100644 --- a/linter/test/instanceof.ts.relax.json +++ b/linter/test/instanceof.ts.relax.json @@ -16,63 +16,63 @@ "nodes": [ { "line": 22, - "column": 11, + "column": 13, "problem": "InstanceofUnsupported", "suggest": "", "rule": "\"instanceof\" operator is partially supported (arkts-instanceof-ref-types)" }, { "line": 23, - "column": 11, + "column": 13, "problem": "InstanceofUnsupported", "suggest": "", "rule": "\"instanceof\" operator is partially supported (arkts-instanceof-ref-types)" }, { "line": 50, - "column": 12, + "column": 14, "problem": "InstanceofUnsupported", "suggest": "", "rule": "\"instanceof\" operator is partially supported (arkts-instanceof-ref-types)" }, { "line": 55, - "column": 25, + "column": 32, "problem": "InstanceofUnsupported", "suggest": "", "rule": "\"instanceof\" operator is partially supported (arkts-instanceof-ref-types)" }, { "line": 58, - "column": 29, + "column": 39, "problem": "InstanceofUnsupported", "suggest": "", "rule": "\"instanceof\" operator is partially supported (arkts-instanceof-ref-types)" }, { "line": 61, - "column": 16, + "column": 26, "problem": "InstanceofUnsupported", "suggest": "", "rule": "\"instanceof\" operator is partially supported (arkts-instanceof-ref-types)" }, { "line": 65, - "column": 13, + "column": 23, "problem": "InstanceofUnsupported", "suggest": "", "rule": "\"instanceof\" operator is partially supported (arkts-instanceof-ref-types)" }, { "line": 70, - "column": 16, + "column": 26, "problem": "InstanceofUnsupported", "suggest": "", "rule": "\"instanceof\" operator is partially supported (arkts-instanceof-ref-types)" }, { "line": 76, - "column": 18, + "column": 29, "problem": "InstanceofUnsupported", "suggest": "", "rule": "\"instanceof\" operator is partially supported (arkts-instanceof-ref-types)" diff --git a/linter/test/instanceof.ts.strict.json b/linter/test/instanceof.ts.strict.json index 940b1320..4d3277e0 100644 --- a/linter/test/instanceof.ts.strict.json +++ b/linter/test/instanceof.ts.strict.json @@ -16,14 +16,14 @@ "nodes": [ { "line": 22, - "column": 11, + "column": 13, "problem": "InstanceofUnsupported", "suggest": "", "rule": "\"instanceof\" operator is partially supported (arkts-instanceof-ref-types)" }, { "line": 23, - "column": 11, + "column": 13, "problem": "InstanceofUnsupported", "suggest": "", "rule": "\"instanceof\" operator is partially supported (arkts-instanceof-ref-types)" @@ -65,7 +65,7 @@ }, { "line": 50, - "column": 12, + "column": 14, "problem": "InstanceofUnsupported", "suggest": "", "rule": "\"instanceof\" operator is partially supported (arkts-instanceof-ref-types)" @@ -79,42 +79,42 @@ }, { "line": 55, - "column": 25, + "column": 32, "problem": "InstanceofUnsupported", "suggest": "", "rule": "\"instanceof\" operator is partially supported (arkts-instanceof-ref-types)" }, { "line": 58, - "column": 29, + "column": 39, "problem": "InstanceofUnsupported", "suggest": "", "rule": "\"instanceof\" operator is partially supported (arkts-instanceof-ref-types)" }, { "line": 61, - "column": 16, + "column": 26, "problem": "InstanceofUnsupported", "suggest": "", "rule": "\"instanceof\" operator is partially supported (arkts-instanceof-ref-types)" }, { "line": 65, - "column": 13, + "column": 23, "problem": "InstanceofUnsupported", "suggest": "", "rule": "\"instanceof\" operator is partially supported (arkts-instanceof-ref-types)" }, { "line": 70, - "column": 16, + "column": 26, "problem": "InstanceofUnsupported", "suggest": "", "rule": "\"instanceof\" operator is partially supported (arkts-instanceof-ref-types)" }, { "line": 76, - "column": 18, + "column": 29, "problem": "InstanceofUnsupported", "suggest": "", "rule": "\"instanceof\" operator is partially supported (arkts-instanceof-ref-types)" diff --git a/linter/test/loop_over_set.ts.relax.json b/linter/test/loop_over_set.ts.relax.json index 33be9cbb..cc487f6f 100644 --- a/linter/test/loop_over_set.ts.relax.json +++ b/linter/test/loop_over_set.ts.relax.json @@ -1,39 +1,39 @@ { - "copyright": [ - "Copyright (c) 2023-2023 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." - ], - "nodes": [ - { - "line": 3, - "column": 1, - "problem": "ForInStatement", - "suggest": "", - "rule": "\"for .. in\" is not supported (arkts-no-for-in)" - }, - { - "line": 3, - "column": 18, - "problem": "ClassAsObject", - "suggest": "", - "rule": "Classes cannot be used as objects (arkts-no-classes-as-obj)" - }, - { - "line": 7, - "column": 33, - "problem": "ClassAsObject", - "suggest": "", - "rule": "Classes cannot be used as objects (arkts-no-classes-as-obj)" - } - ] -} + "copyright": [ + "Copyright (c) 2023-2023 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." + ], + "nodes": [ + { + "line": 3, + "column": 15, + "problem": "ForInStatement", + "suggest": "", + "rule": "\"for .. in\" is not supported (arkts-no-for-in)" + }, + { + "line": 3, + "column": 18, + "problem": "ClassAsObject", + "suggest": "", + "rule": "Classes cannot be used as objects (arkts-no-classes-as-obj)" + }, + { + "line": 7, + "column": 33, + "problem": "ClassAsObject", + "suggest": "", + "rule": "Classes cannot be used as objects (arkts-no-classes-as-obj)" + } + ] +} \ No newline at end of file diff --git a/linter/test/loop_over_set.ts.strict.json b/linter/test/loop_over_set.ts.strict.json index 33be9cbb..cc487f6f 100644 --- a/linter/test/loop_over_set.ts.strict.json +++ b/linter/test/loop_over_set.ts.strict.json @@ -1,39 +1,39 @@ { - "copyright": [ - "Copyright (c) 2023-2023 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." - ], - "nodes": [ - { - "line": 3, - "column": 1, - "problem": "ForInStatement", - "suggest": "", - "rule": "\"for .. in\" is not supported (arkts-no-for-in)" - }, - { - "line": 3, - "column": 18, - "problem": "ClassAsObject", - "suggest": "", - "rule": "Classes cannot be used as objects (arkts-no-classes-as-obj)" - }, - { - "line": 7, - "column": 33, - "problem": "ClassAsObject", - "suggest": "", - "rule": "Classes cannot be used as objects (arkts-no-classes-as-obj)" - } - ] -} + "copyright": [ + "Copyright (c) 2023-2023 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." + ], + "nodes": [ + { + "line": 3, + "column": 15, + "problem": "ForInStatement", + "suggest": "", + "rule": "\"for .. in\" is not supported (arkts-no-for-in)" + }, + { + "line": 3, + "column": 18, + "problem": "ClassAsObject", + "suggest": "", + "rule": "Classes cannot be used as objects (arkts-no-classes-as-obj)" + }, + { + "line": 7, + "column": 33, + "problem": "ClassAsObject", + "suggest": "", + "rule": "Classes cannot be used as objects (arkts-no-classes-as-obj)" + } + ] +} \ No newline at end of file diff --git a/linter/test/modules.ts.autofix.json b/linter/test/modules.ts.autofix.json index d7b8c666..a7456973 100755 --- a/linter/test/modules.ts.autofix.json +++ b/linter/test/modules.ts.autofix.json @@ -119,7 +119,7 @@ }, { "line": 89, - "column": 1, + "column": 22, "problem": "DeclWithDuplicateName", "autofixable": false, "suggest": "", diff --git a/linter/test/modules.ts.strict.json b/linter/test/modules.ts.strict.json index 280ccc39..ad66b1bc 100644 --- a/linter/test/modules.ts.strict.json +++ b/linter/test/modules.ts.strict.json @@ -100,7 +100,7 @@ }, { "line": 89, - "column": 1, + "column": 22, "problem": "DeclWithDuplicateName", "suggest": "", "rule": "Use unique names for types and namespaces. (arkts-unique-names)" diff --git a/linter/test/type_declarations.ts.relax.json b/linter/test/type_declarations.ts.relax.json index aec9b187..42cdf50f 100644 --- a/linter/test/type_declarations.ts.relax.json +++ b/linter/test/type_declarations.ts.relax.json @@ -17,92 +17,128 @@ { "line": 17, "column": 10, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 36, "column": 14, - "problem": "InOperator" + "problem": "InOperator", + "suggest": "", + "rule": "\"in\" operator is not supported (arkts-no-in)" }, { "line": 36, "column": 17, - "problem": "ClassAsObject" + "problem": "ClassAsObject", + "suggest": "", + "rule": "Classes cannot be used as objects (arkts-no-classes-as-obj)" }, { "line": 41, "column": 18, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 55, "column": 1, - "problem": "InterfaceMerging" + "problem": "InterfaceMerging", + "suggest": "", + "rule": "Declaration merging is not supported (arkts-no-decl-merging)" }, { "line": 55, - "column": 1, - "problem": "InterfaceExtendsClass" + "column": 30, + "problem": "InterfaceExtendsClass", + "suggest": "", + "rule": "Interfaces cannot extend classes (arkts-extends-only-class)" }, { "line": 59, "column": 1, - "problem": "InterfaceMerging" + "problem": "InterfaceMerging", + "suggest": "", + "rule": "Declaration merging is not supported (arkts-no-decl-merging)" }, { "line": 59, - "column": 1, - "problem": "InterfaceExtendsClass" + "column": 30, + "problem": "InterfaceExtendsClass", + "suggest": "", + "rule": "Interfaces cannot extend classes (arkts-extends-only-class)" }, { "line": 63, "column": 1, - "problem": "EnumMerging" + "problem": "EnumMerging", + "suggest": "", + "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)" }, { "line": 68, "column": 1, - "problem": "EnumMerging" + "problem": "EnumMerging", + "suggest": "", + "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)" }, { "line": 84, "column": 17, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 84, "column": 25, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 96, "column": 13, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 101, - "column": 1, - "problem": "InterfaceExtendsClass" + "column": 24, + "problem": "InterfaceExtendsClass", + "suggest": "", + "rule": "Interfaces cannot extend classes (arkts-extends-only-class)" }, { "line": 103, "column": 23, - "problem": "ImplementsClass" + "problem": "ImplementsClass", + "suggest": "", + "rule": "Classes cannot be specified in \"implements\" clause (arkts-implements-only-iface)" }, { "line": 108, "column": 7, - "problem": "StructuralIdentity" + "problem": "StructuralIdentity", + "suggest": "", + "rule": "Structural typing is not supported (arkts-no-structural-typing)" }, { "line": 109, "column": 7, - "problem": "StructuralIdentity" + "problem": "StructuralIdentity", + "suggest": "", + "rule": "Structural typing is not supported (arkts-no-structural-typing)" }, { "line": 42, "column": 11, - "problem": "StrictDiagnostic" + "problem": "StrictDiagnostic", + "suggest": "Property 'pipe' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property 'pipe' has no initializer and is not definitely assigned in the constructor." } ] } \ No newline at end of file diff --git a/linter/test/type_declarations.ts.strict.json b/linter/test/type_declarations.ts.strict.json index a9097524..dc1f301b 100644 --- a/linter/test/type_declarations.ts.strict.json +++ b/linter/test/type_declarations.ts.strict.json @@ -17,102 +17,142 @@ { "line": 17, "column": 10, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 36, "column": 14, - "problem": "InOperator" + "problem": "InOperator", + "suggest": "", + "rule": "\"in\" operator is not supported (arkts-no-in)" }, { "line": 36, "column": 17, - "problem": "ClassAsObject" + "problem": "ClassAsObject", + "suggest": "", + "rule": "Classes cannot be used as objects (arkts-no-classes-as-obj)" }, { "line": 41, "column": 18, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 55, "column": 1, - "problem": "InterfaceMerging" + "problem": "InterfaceMerging", + "suggest": "", + "rule": "Declaration merging is not supported (arkts-no-decl-merging)" }, { "line": 55, - "column": 1, - "problem": "InterfaceExtendsClass" + "column": 30, + "problem": "InterfaceExtendsClass", + "suggest": "", + "rule": "Interfaces cannot extend classes (arkts-extends-only-class)" }, { "line": 59, "column": 1, - "problem": "InterfaceMerging" + "problem": "InterfaceMerging", + "suggest": "", + "rule": "Declaration merging is not supported (arkts-no-decl-merging)" }, { "line": 59, - "column": 1, - "problem": "InterfaceExtendsClass" + "column": 30, + "problem": "InterfaceExtendsClass", + "suggest": "", + "rule": "Interfaces cannot extend classes (arkts-extends-only-class)" }, { "line": 63, "column": 1, - "problem": "EnumMerging" + "problem": "EnumMerging", + "suggest": "", + "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)" }, { "line": 68, "column": 1, - "problem": "EnumMerging" + "problem": "EnumMerging", + "suggest": "", + "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)" }, { "line": 75, "column": 20, - "problem": "ClassExpression" + "problem": "ClassExpression", + "suggest": "", + "rule": "Class literals are not supported (arkts-no-class-literals)" }, { "line": 83, "column": 26, - "problem": "ClassExpression" + "problem": "ClassExpression", + "suggest": "", + "rule": "Class literals are not supported (arkts-no-class-literals)" }, { "line": 84, "column": 17, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 84, "column": 25, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 96, "column": 13, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 101, - "column": 1, - "problem": "InterfaceExtendsClass" + "column": 24, + "problem": "InterfaceExtendsClass", + "suggest": "", + "rule": "Interfaces cannot extend classes (arkts-extends-only-class)" }, { "line": 103, "column": 23, - "problem": "ImplementsClass" + "problem": "ImplementsClass", + "suggest": "", + "rule": "Classes cannot be specified in \"implements\" clause (arkts-implements-only-iface)" }, { "line": 108, "column": 7, - "problem": "StructuralIdentity" + "problem": "StructuralIdentity", + "suggest": "", + "rule": "Structural typing is not supported (arkts-no-structural-typing)" }, { "line": 109, "column": 7, - "problem": "StructuralIdentity" + "problem": "StructuralIdentity", + "suggest": "", + "rule": "Structural typing is not supported (arkts-no-structural-typing)" }, { "line": 42, "column": 11, - "problem": "StrictDiagnostic" + "problem": "StrictDiagnostic", + "suggest": "Property 'pipe' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property 'pipe' has no initializer and is not definitely assigned in the constructor." } ] } \ No newline at end of file diff --git a/linter/test/unique_names.ts.strict.json b/linter/test/unique_names.ts.strict.json index a32e3c77..c9a962d1 100644 --- a/linter/test/unique_names.ts.strict.json +++ b/linter/test/unique_names.ts.strict.json @@ -31,477 +31,667 @@ { "line": 18, "column": 8, - "problem": "DeclWithDuplicateName" + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 19, - "column": 1, - "problem": "DeclWithDuplicateName" + "column": 11, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 22, - "column": 1, - "problem": "DeclWithDuplicateName" + "column": 7, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 22, "column": 20, - "problem": "ImplementsClass" + "problem": "ImplementsClass", + "suggest": "", + "rule": "Classes cannot be specified in \"implements\" clause (arkts-implements-only-iface)" }, { "line": 29, - "column": 1, - "problem": "DeclWithDuplicateName" + "column": 11, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 30, "column": 3, - "problem": "InterfaceMerging" + "problem": "InterfaceMerging", + "suggest": "", + "rule": "Declaration merging is not supported (arkts-no-decl-merging)" }, { "line": 30, - "column": 3, - "problem": "DeclWithDuplicateName" + "column": 20, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 33, - "column": 3, - "problem": "DeclWithDuplicateName" + "column": 16, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 34, "column": 3, - "problem": "InterfaceMerging" + "problem": "InterfaceMerging", + "suggest": "", + "rule": "Declaration merging is not supported (arkts-no-decl-merging)" }, { "line": 39, - "column": 1, - "problem": "DeclWithDuplicateName" + "column": 11, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 40, "column": 3, - "problem": "InterfaceMerging" + "problem": "InterfaceMerging", + "suggest": "", + "rule": "Declaration merging is not supported (arkts-no-decl-merging)" }, { "line": 40, - "column": 3, - "problem": "DeclWithDuplicateName" + "column": 20, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 43, "column": 3, - "problem": "InterfaceMerging" + "problem": "InterfaceMerging", + "suggest": "", + "rule": "Declaration merging is not supported (arkts-no-decl-merging)" }, { "line": 48, "column": 1, - "problem": "ImportAfterStatement" + "problem": "ImportAfterStatement", + "suggest": "", + "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)" }, { "line": 48, - "column": 8, - "problem": "DeclWithDuplicateName" + "column": 13, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 49, - "column": 1, - "problem": "DeclWithDuplicateName" + "column": 11, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 52, - "column": 1, - "problem": "DeclWithDuplicateName" + "column": 7, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 54, "column": 1, - "problem": "ImportAfterStatement" + "problem": "ImportAfterStatement", + "suggest": "", + "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)" }, { "line": 54, "column": 10, - "problem": "DeclWithDuplicateName" + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 54, - "column": 13, - "problem": "DeclWithDuplicateName" + "column": 18, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 55, - "column": 1, - "problem": "DeclWithDuplicateName" + "column": 11, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 58, - "column": 1, - "problem": "DeclWithDuplicateName" + "column": 7, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 58, "column": 30, - "problem": "ImplementsClass" + "problem": "ImplementsClass", + "suggest": "", + "rule": "Classes cannot be specified in \"implements\" clause (arkts-implements-only-iface)" }, { "line": 60, - "column": 1, - "problem": "DeclWithDuplicateName" + "column": 10, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 63, - "column": 1, - "problem": "DeclWithDuplicateName" + "column": 11, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 75, "column": 9, - "problem": "DeclWithDuplicateName" + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 76, - "column": 3, - "problem": "DeclWithDuplicateName" + "column": 13, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 80, "column": 9, - "problem": "DeclWithDuplicateName" + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 81, - "column": 3, - "problem": "DeclWithDuplicateName" + "column": 8, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 83, - "column": 3, - "problem": "DeclWithDuplicateName" + "column": 9, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 84, - "column": 3, - "problem": "DeclWithDuplicateName" + "column": 13, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 88, - "column": 3, - "problem": "DeclWithDuplicateName" + "column": 12, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 88, "column": 3, - "problem": "LocalFunction" + "problem": "LocalFunction", + "suggest": "", + "rule": "Nested functions are not supported (arkts-no-nested-funcs)" }, { "line": 91, - "column": 3, - "problem": "DeclWithDuplicateName" + "column": 8, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 93, - "column": 3, - "problem": "DeclWithDuplicateName" + "column": 12, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 93, "column": 3, - "problem": "LocalFunction" + "problem": "LocalFunction", + "suggest": "", + "rule": "Nested functions are not supported (arkts-no-nested-funcs)" }, { "line": 96, - "column": 3, - "problem": "DeclWithDuplicateName" + "column": 13, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 102, "column": 11, - "problem": "DeclWithDuplicateName" + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 103, - "column": 5, - "problem": "DeclWithDuplicateName" + "column": 15, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 110, - "column": 3, - "problem": "DeclWithDuplicateName" + "column": 13, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 113, - "column": 3, - "problem": "DeclWithDuplicateName" + "column": 13, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 116, "column": 9, - "problem": "DestructuringDeclaration" + "problem": "DestructuringDeclaration", + "suggest": "", + "rule": "Destructuring variable declarations are not supported (arkts-no-destruct-decls)" }, { "line": 116, "column": 10, - "problem": "DeclWithDuplicateName" + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 116, "column": 19, - "problem": "DeclWithDuplicateName" + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 118, - "column": 3, - "problem": "DeclWithDuplicateName" + "column": 13, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 121, - "column": 3, - "problem": "DeclWithDuplicateName" + "column": 13, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 124, - "column": 3, - "problem": "DeclWithDuplicateName" + "column": 13, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 127, "column": 9, - "problem": "DestructuringDeclaration" + "problem": "DestructuringDeclaration", + "suggest": "", + "rule": "Destructuring variable declarations are not supported (arkts-no-destruct-decls)" }, { "line": 128, "column": 5, - "problem": "DeclWithDuplicateName" + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 130, "column": 7, - "problem": "DeclWithDuplicateName" + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 131, "column": 11, - "problem": "DeclWithDuplicateName" + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 134, "column": 7, - "problem": "ObjectLiteralNoContextType" + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)" }, { "line": 134, "column": 19, - "problem": "ObjectLiteralNoContextType" + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)" }, { "line": 140, "column": 13, - "problem": "DeclWithDuplicateName" + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 141, - "column": 7, - "problem": "DeclWithDuplicateName" + "column": 12, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 143, - "column": 7, - "problem": "DeclWithDuplicateName" + "column": 16, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 143, "column": 7, - "problem": "LocalFunction" + "problem": "LocalFunction", + "suggest": "", + "rule": "Nested functions are not supported (arkts-no-nested-funcs)" }, { "line": 148, - "column": 7, - "problem": "DeclWithDuplicateName" + "column": 17, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 152, - "column": 7, - "problem": "DeclWithDuplicateName" + "column": 16, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 152, "column": 7, - "problem": "LocalFunction" + "problem": "LocalFunction", + "suggest": "", + "rule": "Nested functions are not supported (arkts-no-nested-funcs)" }, { "line": 157, - "column": 7, - "problem": "DeclWithDuplicateName" + "column": 12, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 163, "column": 3, - "problem": "DeclWithDuplicateName" + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 164, "column": 3, - "problem": "DeclWithDuplicateName" + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 166, "column": 3, - "problem": "DeclWithDuplicateName" + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 169, "column": 3, - "problem": "DeclWithDuplicateName" + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 173, "column": 3, - "problem": "DeclWithDuplicateName" + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 174, "column": 3, - "problem": "DeclWithDuplicateName" + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 164, "column": 3, - "problem": "PrivateIdentifier" + "problem": "PrivateIdentifier", + "suggest": "", + "rule": "Private '#' identifiers are not supported (arkts-no-private-identifiers)" }, { "line": 169, "column": 3, - "problem": "PrivateIdentifier" + "problem": "PrivateIdentifier", + "suggest": "", + "rule": "Private '#' identifiers are not supported (arkts-no-private-identifiers)" }, { "line": 174, "column": 3, - "problem": "PrivateIdentifier" + "problem": "PrivateIdentifier", + "suggest": "", + "rule": "Private '#' identifiers are not supported (arkts-no-private-identifiers)" }, { "line": 196, - "column": 1, - "problem": "DeclWithDuplicateName" + "column": 11, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 197, - "column": 1, - "problem": "DeclWithDuplicateName" + "column": 11, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 199, - "column": 1, - "problem": "DeclWithDuplicateName" + "column": 10, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 200, - "column": 1, - "problem": "DeclWithDuplicateName" + "column": 11, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 206, "column": 1, - "problem": "EnumMerging" + "problem": "EnumMerging", + "suggest": "", + "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)" }, { "line": 207, "column": 1, - "problem": "EnumMerging" + "problem": "EnumMerging", + "suggest": "", + "rule": "\"enum\" declaration merging is not supported (arkts-no-enum-merging)" }, { "line": 209, "column": 1, - "problem": "InterfaceMerging" + "problem": "InterfaceMerging", + "suggest": "", + "rule": "Declaration merging is not supported (arkts-no-decl-merging)" }, { "line": 210, "column": 1, - "problem": "InterfaceMerging" + "problem": "InterfaceMerging", + "suggest": "", + "rule": "Declaration merging is not supported (arkts-no-decl-merging)" }, { "line": 213, "column": 7, - "problem": "DeclWithDuplicateName" + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 214, - "column": 1, - "problem": "DeclWithDuplicateName" + "column": 11, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 216, "column": 7, - "problem": "DeclWithDuplicateName" + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 217, - "column": 1, - "problem": "DeclWithDuplicateName" + "column": 11, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 219, "column": 7, - "problem": "DeclWithDuplicateName" + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 220, - "column": 1, - "problem": "DeclWithDuplicateName" + "column": 6, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 223, - "column": 1, - "problem": "DeclWithDuplicateName" + "column": 10, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 224, - "column": 1, - "problem": "DeclWithDuplicateName" + "column": 11, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 226, - "column": 1, - "problem": "DeclWithDuplicateName" + "column": 10, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 227, - "column": 1, - "problem": "DeclWithDuplicateName" + "column": 11, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 229, - "column": 1, - "problem": "DeclWithDuplicateName" + "column": 10, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 230, - "column": 1, - "problem": "DeclWithDuplicateName" + "column": 6, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 233, - "column": 1, - "problem": "DeclWithDuplicateName" + "column": 11, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 234, - "column": 1, - "problem": "DeclWithDuplicateName" + "column": 7, + "problem": "DeclWithDuplicateName", + "suggest": "", + "rule": "Use unique names for types and namespaces. (arkts-unique-names)" }, { "line": 163, "column": 3, - "problem": "StrictDiagnostic" + "problem": "StrictDiagnostic", + "suggest": "Property 'x' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property 'x' has no initializer and is not definitely assigned in the constructor." }, { "line": 164, "column": 3, - "problem": "StrictDiagnostic" + "problem": "StrictDiagnostic", + "suggest": "Property '#x' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property '#x' has no initializer and is not definitely assigned in the constructor." }, { "line": 173, "column": 3, - "problem": "StrictDiagnostic" + "problem": "StrictDiagnostic", + "suggest": "Property 'z' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property 'z' has no initializer and is not definitely assigned in the constructor." } ] } \ No newline at end of file diff --git a/linter/test/unknown_params.ts.strict.json b/linter/test/unknown_params.ts.strict.json index d842e1a6..52221ff0 100644 --- a/linter/test/unknown_params.ts.strict.json +++ b/linter/test/unknown_params.ts.strict.json @@ -16,7 +16,7 @@ "nodes": [ { "line": 18, - "column": 1, + "column": 25, "problem": "LimitedReturnTypeInference", "suggest": "", "rule": "Function return type inference is limited (arkts-no-implicit-return-types)" diff --git a/linter/test/utility_types.ts.relax.json b/linter/test/utility_types.ts.relax.json index c4505b65..5d007f90 100644 --- a/linter/test/utility_types.ts.relax.json +++ b/linter/test/utility_types.ts.relax.json @@ -17,387 +17,540 @@ { "line": 17, "column": 12, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 19, "column": 12, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 21, "column": 12, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 53, "column": 22, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 55, "column": 29, - "problem": "ObjectLiteralNoContextType" + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)" }, { "line": 71, "column": 22, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 73, "column": 29, - "problem": "ObjectLiteralNoContextType" + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)" }, { "line": 81, "column": 19, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 83, "column": 30, - "problem": "ObjectLiteralNoContextType" + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)" }, { "line": 92, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 94, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 96, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 100, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 102, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 106, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 108, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 108, "column": 43, - "problem": "UnknownType" + "problem": "UnknownType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 112, "column": 20, - "problem": "ObjectTypeLiteral" + "problem": "ObjectTypeLiteral", + "suggest": "", + "rule": "Object literals cannot be used as type declarations (arkts-no-obj-literals-as-types)" }, { "line": 116, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 118, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 120, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 122, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 122, "column": 24, - "problem": "TypeQuery" + "problem": "TypeQuery", + "suggest": "", + "rule": "\"typeof\" operator is allowed only in expression contexts (arkts-no-type-query)" }, { "line": 124, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 124, "column": 24, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 126, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 130, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 132, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 134, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 136, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 136, "column": 35, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 140, "column": 18, - "problem": "ObjectTypeLiteral" + "problem": "ObjectTypeLiteral", + "suggest": "", + "rule": "Object literals cannot be used as type declarations (arkts-no-obj-literals-as-types)" }, { "line": 141, "column": 12, - "problem": "ObjectLiteralNoContextType" + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)" }, { "line": 144, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 146, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 148, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 150, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 152, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 152, "column": 24, - "problem": "TypeQuery" + "problem": "TypeQuery", + "suggest": "", + "rule": "\"typeof\" operator is allowed only in expression contexts (arkts-no-type-query)" }, { "line": 154, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 154, "column": 24, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 156, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 165, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 165, "column": 26, - "problem": "TypeQuery" + "problem": "TypeQuery", + "suggest": "", + "rule": "\"typeof\" operator is allowed only in expression contexts (arkts-no-type-query)" }, { "line": 167, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 167, "column": 26, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 169, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 174, "column": 12, - "problem": "FunctionContainsThis" + "problem": "FunctionContainsThis", + "suggest": "", + "rule": "Using \"this\" inside stand-alone functions is not supported (arkts-no-standalone-this)" }, { "line": 177, "column": 30, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 177, "column": 48, - "problem": "TypeQuery" + "problem": "TypeQuery", + "suggest": "", + "rule": "\"typeof\" operator is allowed only in expression contexts (arkts-no-type-query)" }, { "line": 178, "column": 18, - "problem": "FunctionApplyCall" + "problem": "FunctionApplyCall", + "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" }, { "line": 184, "column": 12, - "problem": "FunctionContainsThis" + "problem": "FunctionContainsThis", + "suggest": "", + "rule": "Using \"this\" inside stand-alone functions is not supported (arkts-no-standalone-this)" }, { "line": 187, "column": 20, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 187, "column": 38, - "problem": "TypeQuery" + "problem": "TypeQuery", + "suggest": "", + "rule": "\"typeof\" operator is allowed only in expression contexts (arkts-no-type-query)" }, { "line": 187, "column": 60, - "problem": "FunctionBind" + "problem": "FunctionBind", + "suggest": "", + "rule": "\"Function.bind\" is not supported (arkts-no-func-bind)" }, { "line": 208, "column": 9, - "problem": "FunctionContainsThis" + "problem": "FunctionContainsThis", + "suggest": "", + "rule": "Using \"this\" inside stand-alone functions is not supported (arkts-no-standalone-this)" }, { "line": 209, "column": 9, - "problem": "FunctionContainsThis" + "problem": "FunctionContainsThis", + "suggest": "", + "rule": "Using \"this\" inside stand-alone functions is not supported (arkts-no-standalone-this)" }, { "line": 193, "column": 33, - "problem": "ObjectTypeLiteral" + "problem": "ObjectTypeLiteral", + "suggest": "", + "rule": "Object literals cannot be used as type declarations (arkts-no-obj-literals-as-types)" }, { "line": 195, "column": 15, - "problem": "IntersectionType" + "problem": "IntersectionType", + "suggest": "", + "rule": "Use inheritance instead of intersection types (arkts-no-intersection-types)" }, { "line": 195, "column": 19, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 195, "column": 28, - "problem": "IntersectionType" + "problem": "IntersectionType", + "suggest": "", + "rule": "Use inheritance instead of intersection types (arkts-no-intersection-types)" }, { "line": 198, "column": 60, - "problem": "IntersectionType" + "problem": "IntersectionType", + "suggest": "", + "rule": "Use inheritance instead of intersection types (arkts-no-intersection-types)" }, { "line": 199, "column": 39, - "problem": "ObjectLiteralNoContextType" + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)" }, { "line": 200, "column": 45, - "problem": "ObjectLiteralNoContextType" + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)" }, { "line": 201, "column": 12, - "problem": "ObjectLiteralNoContextType" + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)" }, { "line": 201, "column": 14, - "problem": "SpreadOperator" + "problem": "SpreadOperator", + "suggest": "", + "rule": "It is possible to spread only arrays or classes derived from arrays into the rest parameter or array literals (arkts-no-spread)" }, { "line": 201, "column": 23, - "problem": "SpreadOperator" + "problem": "SpreadOperator", + "suggest": "", + "rule": "It is possible to spread only arrays or classes derived from arrays into the rest parameter or array literals (arkts-no-spread)" }, { "line": 201, "column": 39, - "problem": "IntersectionType" + "problem": "IntersectionType", + "suggest": "", + "rule": "Use inheritance instead of intersection types (arkts-no-intersection-types)" }, { "line": 204, "column": 26, - "problem": "ObjectLiteralNoContextType" + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)" }, { "line": 205, "column": 11, - "problem": "ObjectLiteralNoContextType" + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)" }, { "line": 206, "column": 14, - "problem": "ObjectLiteralNoContextType" + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)" }, { "line": 221, "column": 25, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 223, "column": 50, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 229, "column": 24, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 231, "column": 50, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 237, "column": 19, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 242, "column": 32, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" } ] } \ No newline at end of file diff --git a/linter/test/utility_types.ts.strict.json b/linter/test/utility_types.ts.strict.json index 709b2384..22896007 100644 --- a/linter/test/utility_types.ts.strict.json +++ b/linter/test/utility_types.ts.strict.json @@ -17,422 +17,589 @@ { "line": 17, "column": 12, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 19, "column": 12, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 21, "column": 12, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 53, "column": 22, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 55, "column": 29, - "problem": "ObjectLiteralNoContextType" + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)" }, { "line": 71, "column": 22, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 73, "column": 29, - "problem": "ObjectLiteralNoContextType" + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)" }, { "line": 81, "column": 19, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 83, "column": 30, - "problem": "ObjectLiteralNoContextType" + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)" }, { "line": 92, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 94, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 96, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 100, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 102, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 106, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 108, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 108, "column": 43, - "problem": "UnknownType" + "problem": "UnknownType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 112, "column": 3, - "problem": "LocalFunction" + "problem": "LocalFunction", + "suggest": "", + "rule": "Nested functions are not supported (arkts-no-nested-funcs)" }, { "line": 112, "column": 20, - "problem": "ObjectTypeLiteral" + "problem": "ObjectTypeLiteral", + "suggest": "", + "rule": "Object literals cannot be used as type declarations (arkts-no-obj-literals-as-types)" }, { "line": 116, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 118, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 120, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 122, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 122, "column": 24, - "problem": "TypeQuery" + "problem": "TypeQuery", + "suggest": "", + "rule": "\"typeof\" operator is allowed only in expression contexts (arkts-no-type-query)" }, { "line": 124, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 124, "column": 24, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 126, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 130, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 132, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 134, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 136, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 136, "column": 35, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 140, "column": 3, - "problem": "LocalFunction" + "problem": "LocalFunction", + "suggest": "", + "rule": "Nested functions are not supported (arkts-no-nested-funcs)" }, { "line": 140, "column": 18, - "problem": "ObjectTypeLiteral" + "problem": "ObjectTypeLiteral", + "suggest": "", + "rule": "Object literals cannot be used as type declarations (arkts-no-obj-literals-as-types)" }, { "line": 141, "column": 12, - "problem": "ObjectLiteralNoContextType" + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)" }, { "line": 144, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 146, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 148, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 150, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 152, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 152, "column": 24, - "problem": "TypeQuery" + "problem": "TypeQuery", + "suggest": "", + "rule": "\"typeof\" operator is allowed only in expression contexts (arkts-no-type-query)" }, { "line": 154, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 154, "column": 24, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 156, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 165, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 165, "column": 26, - "problem": "TypeQuery" + "problem": "TypeQuery", + "suggest": "", + "rule": "\"typeof\" operator is allowed only in expression contexts (arkts-no-type-query)" }, { "line": 167, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 167, "column": 26, - "problem": "AnyType" + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { "line": 169, "column": 13, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 174, "column": 12, - "problem": "FunctionContainsThis" + "problem": "FunctionContainsThis", + "suggest": "", + "rule": "Using \"this\" inside stand-alone functions is not supported (arkts-no-standalone-this)" }, { "line": 173, "column": 3, - "problem": "LocalFunction" + "problem": "LocalFunction", + "suggest": "", + "rule": "Nested functions are not supported (arkts-no-nested-funcs)" }, { "line": 177, - "column": 3, - "problem": "LimitedReturnTypeInference" + "column": 12, + "problem": "LimitedReturnTypeInference", + "suggest": "", + "rule": "Function return type inference is limited (arkts-no-implicit-return-types)" }, { "line": 177, "column": 3, - "problem": "LocalFunction" + "problem": "LocalFunction", + "suggest": "", + "rule": "Nested functions are not supported (arkts-no-nested-funcs)" }, { "line": 177, "column": 30, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 177, "column": 48, - "problem": "TypeQuery" + "problem": "TypeQuery", + "suggest": "", + "rule": "\"typeof\" operator is allowed only in expression contexts (arkts-no-type-query)" }, { "line": 178, "column": 18, - "problem": "FunctionApplyCall" + "problem": "FunctionApplyCall", + "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" }, { "line": 184, "column": 12, - "problem": "FunctionContainsThis" + "problem": "FunctionContainsThis", + "suggest": "", + "rule": "Using \"this\" inside stand-alone functions is not supported (arkts-no-standalone-this)" }, { "line": 183, "column": 3, - "problem": "LocalFunction" + "problem": "LocalFunction", + "suggest": "", + "rule": "Nested functions are not supported (arkts-no-nested-funcs)" }, { "line": 187, "column": 20, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 187, "column": 38, - "problem": "TypeQuery" + "problem": "TypeQuery", + "suggest": "", + "rule": "\"typeof\" operator is allowed only in expression contexts (arkts-no-type-query)" }, { "line": 187, "column": 60, - "problem": "FunctionBind" + "problem": "FunctionBind", + "suggest": "", + "rule": "\"Function.bind\" is not supported (arkts-no-func-bind)" }, { "line": 208, "column": 9, - "problem": "FunctionContainsThis" + "problem": "FunctionContainsThis", + "suggest": "", + "rule": "Using \"this\" inside stand-alone functions is not supported (arkts-no-standalone-this)" }, { "line": 209, "column": 9, - "problem": "FunctionContainsThis" + "problem": "FunctionContainsThis", + "suggest": "", + "rule": "Using \"this\" inside stand-alone functions is not supported (arkts-no-standalone-this)" }, { "line": 193, "column": 33, - "problem": "ObjectTypeLiteral" + "problem": "ObjectTypeLiteral", + "suggest": "", + "rule": "Object literals cannot be used as type declarations (arkts-no-obj-literals-as-types)" }, { "line": 195, "column": 15, - "problem": "IntersectionType" + "problem": "IntersectionType", + "suggest": "", + "rule": "Use inheritance instead of intersection types (arkts-no-intersection-types)" }, { "line": 195, "column": 19, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 195, "column": 28, - "problem": "IntersectionType" + "problem": "IntersectionType", + "suggest": "", + "rule": "Use inheritance instead of intersection types (arkts-no-intersection-types)" }, { "line": 198, "column": 3, - "problem": "LocalFunction" + "problem": "LocalFunction", + "suggest": "", + "rule": "Nested functions are not supported (arkts-no-nested-funcs)" }, { "line": 198, "column": 60, - "problem": "IntersectionType" + "problem": "IntersectionType", + "suggest": "", + "rule": "Use inheritance instead of intersection types (arkts-no-intersection-types)" }, { "line": 199, "column": 39, - "problem": "ObjectLiteralNoContextType" + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)" }, { "line": 200, "column": 45, - "problem": "ObjectLiteralNoContextType" + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)" }, { "line": 201, "column": 12, - "problem": "ObjectLiteralNoContextType" + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)" }, { "line": 201, "column": 14, - "problem": "SpreadOperator" + "problem": "SpreadOperator", + "suggest": "", + "rule": "It is possible to spread only arrays or classes derived from arrays into the rest parameter or array literals (arkts-no-spread)" }, { "line": 201, "column": 23, - "problem": "SpreadOperator" + "problem": "SpreadOperator", + "suggest": "", + "rule": "It is possible to spread only arrays or classes derived from arrays into the rest parameter or array literals (arkts-no-spread)" }, { "line": 201, "column": 39, - "problem": "IntersectionType" + "problem": "IntersectionType", + "suggest": "", + "rule": "Use inheritance instead of intersection types (arkts-no-intersection-types)" }, { "line": 204, "column": 26, - "problem": "ObjectLiteralNoContextType" + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)" }, { "line": 205, "column": 11, - "problem": "ObjectLiteralNoContextType" + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)" }, { "line": 206, "column": 14, - "problem": "ObjectLiteralNoContextType" + "problem": "ObjectLiteralNoContextType", + "suggest": "", + "rule": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)" }, { "line": 221, "column": 25, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 223, "column": 50, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 229, "column": 24, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 231, "column": 50, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 237, "column": 19, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" }, { "line": 242, "column": 32, - "problem": "UtilityType" + "problem": "UtilityType", + "suggest": "", + "rule": "Some of utility types are not supported (arkts-no-utility-types)" } ] } \ No newline at end of file diff --git a/linter/test/var_declarations.ts.relax.json b/linter/test/var_declarations.ts.relax.json index 87eabb4e..86062791 100644 --- a/linter/test/var_declarations.ts.relax.json +++ b/linter/test/var_declarations.ts.relax.json @@ -16,13 +16,17 @@ "nodes": [ { "line": 31, - "column": 3, - "problem": "ForInStatement" + "column": 14, + "problem": "ForInStatement", + "suggest": "", + "rule": "\"for .. in\" is not supported (arkts-no-for-in)" }, { "line": 23, "column": 12, - "problem": "StrictDiagnostic" + "problem": "StrictDiagnostic", + "suggest": "Variable 'y' is used before being assigned.", + "rule": "Variable 'y' is used before being assigned." } ] } \ No newline at end of file diff --git a/linter/test/var_declarations.ts.strict.json b/linter/test/var_declarations.ts.strict.json index fd22371d..0f24e4b6 100644 --- a/linter/test/var_declarations.ts.strict.json +++ b/linter/test/var_declarations.ts.strict.json @@ -17,47 +17,65 @@ { "line": 17, "column": 3, - "problem": "VarDeclaration" + "problem": "VarDeclaration", + "suggest": "", + "rule": "Use \"let\" instead of \"var\" (arkts-no-var)" }, { "line": 19, "column": 3, - "problem": "LocalFunction" + "problem": "LocalFunction", + "suggest": "", + "rule": "Nested functions are not supported (arkts-no-nested-funcs)" }, { "line": 21, "column": 7, - "problem": "VarDeclaration" + "problem": "VarDeclaration", + "suggest": "", + "rule": "Use \"let\" instead of \"var\" (arkts-no-var)" }, { "line": 28, "column": 3, - "problem": "VarDeclaration" + "problem": "VarDeclaration", + "suggest": "", + "rule": "Use \"let\" instead of \"var\" (arkts-no-var)" }, { "line": 29, "column": 8, - "problem": "VarDeclaration" + "problem": "VarDeclaration", + "suggest": "", + "rule": "Use \"let\" instead of \"var\" (arkts-no-var)" }, { "line": 31, - "column": 3, - "problem": "ForInStatement" + "column": 14, + "problem": "ForInStatement", + "suggest": "", + "rule": "\"for .. in\" is not supported (arkts-no-for-in)" }, { "line": 31, "column": 8, - "problem": "VarDeclaration" + "problem": "VarDeclaration", + "suggest": "", + "rule": "Use \"let\" instead of \"var\" (arkts-no-var)" }, { "line": 37, "column": 8, - "problem": "VarDeclaration" + "problem": "VarDeclaration", + "suggest": "", + "rule": "Use \"let\" instead of \"var\" (arkts-no-var)" }, { "line": 23, "column": 12, - "problem": "StrictDiagnostic" + "problem": "StrictDiagnostic", + "suggest": "Variable 'y' is used before being assigned.", + "rule": "Variable 'y' is used before being assigned." } ] } \ No newline at end of file diff --git a/linter/test_rules/rule103.ts.autofix.json b/linter/test_rules/rule103.ts.autofix.json index 0b80e8ac..dfe21364 100644 --- a/linter/test_rules/rule103.ts.autofix.json +++ b/linter/test_rules/rule103.ts.autofix.json @@ -24,7 +24,7 @@ }, { "line": 1, - "column": 1, + "column": 11, "problem": "DeclWithDuplicateName", "autofixable": false, "suggest": "", @@ -48,7 +48,7 @@ }, { "line": 5, - "column": 1, + "column": 11, "problem": "DeclWithDuplicateName", "autofixable": false, "suggest": "", @@ -64,7 +64,7 @@ }, { "line": 9, - "column": 1, + "column": 11, "problem": "DeclWithDuplicateName", "autofixable": false, "suggest": "", diff --git a/linter/test_rules/rule103.ts.strict.json b/linter/test_rules/rule103.ts.strict.json index ed74f56a..c09577d5 100644 --- a/linter/test_rules/rule103.ts.strict.json +++ b/linter/test_rules/rule103.ts.strict.json @@ -23,7 +23,7 @@ }, { "line": 1, - "column": 1, + "column": 11, "problem": "DeclWithDuplicateName", "suggest": "", "rule": "Use unique names for types and namespaces. (arkts-unique-names)" @@ -44,7 +44,7 @@ }, { "line": 5, - "column": 1, + "column": 11, "problem": "DeclWithDuplicateName", "suggest": "", "rule": "Use unique names for types and namespaces. (arkts-unique-names)" @@ -58,7 +58,7 @@ }, { "line": 9, - "column": 1, + "column": 11, "problem": "DeclWithDuplicateName", "suggest": "", "rule": "Use unique names for types and namespaces. (arkts-unique-names)" diff --git a/linter/test_rules/rule104.ts.autofix.json b/linter/test_rules/rule104.ts.autofix.json index 72f785ae..24cc903a 100644 --- a/linter/test_rules/rule104.ts.autofix.json +++ b/linter/test_rules/rule104.ts.autofix.json @@ -1,8 +1,22 @@ { + "copyright": [ + "Copyright (c) 2023-2023 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." + ], "nodes": [ { "line": 5, - "column": 1, + "column": 37, "problem": "InterfaceExtendsClass", "autofixable": false, "suggest": "", diff --git a/linter/test_rules/rule104.ts.relax.json b/linter/test_rules/rule104.ts.relax.json index 7b41949d..61971845 100644 --- a/linter/test_rules/rule104.ts.relax.json +++ b/linter/test_rules/rule104.ts.relax.json @@ -1,8 +1,22 @@ { + "copyright": [ + "Copyright (c) 2023-2023 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." + ], "nodes": [ { "line": 5, - "column": 1, + "column": 37, "problem": "InterfaceExtendsClass", "suggest": "", "rule": "Interfaces cannot extend classes (arkts-extends-only-class)" diff --git a/linter/test_rules/rule104.ts.strict.json b/linter/test_rules/rule104.ts.strict.json index 7b41949d..61971845 100644 --- a/linter/test_rules/rule104.ts.strict.json +++ b/linter/test_rules/rule104.ts.strict.json @@ -1,8 +1,22 @@ { + "copyright": [ + "Copyright (c) 2023-2023 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." + ], "nodes": [ { "line": 5, - "column": 1, + "column": 37, "problem": "InterfaceExtendsClass", "suggest": "", "rule": "Interfaces cannot extend classes (arkts-extends-only-class)" diff --git a/linter/test_rules/rule142.ts.autofix.json b/linter/test_rules/rule142.ts.autofix.json index 8da6f5f8..7b79861c 100644 --- a/linter/test_rules/rule142.ts.autofix.json +++ b/linter/test_rules/rule142.ts.autofix.json @@ -1,8 +1,22 @@ { + "copyright": [ + "Copyright (c) 2023-2023 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." + ], "nodes": [ { "line": 2, - "column": 13, + "column": 21, "problem": "ConstAssertion", "autofixable": false, "suggest": "", @@ -10,7 +24,7 @@ }, { "line": 5, - "column": 13, + "column": 22, "problem": "ConstAssertion", "autofixable": false, "suggest": "", @@ -18,7 +32,7 @@ }, { "line": 8, - "column": 13, + "column": 31, "problem": "ConstAssertion", "autofixable": false, "suggest": "", diff --git a/linter/test_rules/rule142.ts.relax.json b/linter/test_rules/rule142.ts.relax.json index f61e4269..8386565b 100644 --- a/linter/test_rules/rule142.ts.relax.json +++ b/linter/test_rules/rule142.ts.relax.json @@ -1,22 +1,36 @@ { + "copyright": [ + "Copyright (c) 2023-2023 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." + ], "nodes": [ { "line": 2, - "column": 13, + "column": 21, "problem": "ConstAssertion", "suggest": "", "rule": "\"as const\" assertions are not supported (arkts-no-as-const)" }, { "line": 5, - "column": 13, + "column": 22, "problem": "ConstAssertion", "suggest": "", "rule": "\"as const\" assertions are not supported (arkts-no-as-const)" }, { "line": 8, - "column": 13, + "column": 31, "problem": "ConstAssertion", "suggest": "", "rule": "\"as const\" assertions are not supported (arkts-no-as-const)" diff --git a/linter/test_rules/rule142.ts.strict.json b/linter/test_rules/rule142.ts.strict.json index f61e4269..8386565b 100644 --- a/linter/test_rules/rule142.ts.strict.json +++ b/linter/test_rules/rule142.ts.strict.json @@ -1,22 +1,36 @@ { + "copyright": [ + "Copyright (c) 2023-2023 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." + ], "nodes": [ { "line": 2, - "column": 13, + "column": 21, "problem": "ConstAssertion", "suggest": "", "rule": "\"as const\" assertions are not supported (arkts-no-as-const)" }, { "line": 5, - "column": 13, + "column": 22, "problem": "ConstAssertion", "suggest": "", "rule": "\"as const\" assertions are not supported (arkts-no-as-const)" }, { "line": 8, - "column": 13, + "column": 31, "problem": "ConstAssertion", "suggest": "", "rule": "\"as const\" assertions are not supported (arkts-no-as-const)" diff --git a/linter/test_rules/rule4.ts.autofix.json b/linter/test_rules/rule4.ts.autofix.json index ba15a33c..481b5280 100644 --- a/linter/test_rules/rule4.ts.autofix.json +++ b/linter/test_rules/rule4.ts.autofix.json @@ -24,7 +24,7 @@ }, { "line": 2, - "column": 1, + "column": 6, "problem": "DeclWithDuplicateName", "autofixable": false, "suggest": "", diff --git a/linter/test_rules/rule4.ts.strict.json b/linter/test_rules/rule4.ts.strict.json index 9dda4cf2..2fbb0211 100644 --- a/linter/test_rules/rule4.ts.strict.json +++ b/linter/test_rules/rule4.ts.strict.json @@ -23,7 +23,7 @@ }, { "line": 2, - "column": 1, + "column": 6, "problem": "DeclWithDuplicateName", "suggest": "", "rule": "Use unique names for types and namespaces. (arkts-unique-names)" diff --git a/linter/test_rules/rule65.ts.autofix.json b/linter/test_rules/rule65.ts.autofix.json index 9e70ad4d..ff5ed020 100644 --- a/linter/test_rules/rule65.ts.autofix.json +++ b/linter/test_rules/rule65.ts.autofix.json @@ -1,8 +1,22 @@ { + "copyright": [ + "Copyright (c) 2023-2023 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." + ], "nodes": [ { "line": 8, - "column": 9, + "column": 11, "problem": "InstanceofUnsupported", "autofixable": false, "suggest": "", @@ -10,7 +24,7 @@ }, { "line": 9, - "column": 9, + "column": 11, "problem": "InstanceofUnsupported", "autofixable": false, "suggest": "", diff --git a/linter/test_rules/rule65.ts.relax.json b/linter/test_rules/rule65.ts.relax.json index 050b37b6..d90fe1a6 100644 --- a/linter/test_rules/rule65.ts.relax.json +++ b/linter/test_rules/rule65.ts.relax.json @@ -1,15 +1,29 @@ { + "copyright": [ + "Copyright (c) 2023-2023 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." + ], "nodes": [ { "line": 8, - "column": 9, + "column": 11, "problem": "InstanceofUnsupported", "suggest": "", "rule": "\"instanceof\" operator is partially supported (arkts-instanceof-ref-types)" }, { "line": 9, - "column": 9, + "column": 11, "problem": "InstanceofUnsupported", "suggest": "", "rule": "\"instanceof\" operator is partially supported (arkts-instanceof-ref-types)" diff --git a/linter/test_rules/rule65.ts.strict.json b/linter/test_rules/rule65.ts.strict.json index 050b37b6..d90fe1a6 100644 --- a/linter/test_rules/rule65.ts.strict.json +++ b/linter/test_rules/rule65.ts.strict.json @@ -1,15 +1,29 @@ { + "copyright": [ + "Copyright (c) 2023-2023 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." + ], "nodes": [ { "line": 8, - "column": 9, + "column": 11, "problem": "InstanceofUnsupported", "suggest": "", "rule": "\"instanceof\" operator is partially supported (arkts-instanceof-ref-types)" }, { "line": 9, - "column": 9, + "column": 11, "problem": "InstanceofUnsupported", "suggest": "", "rule": "\"instanceof\" operator is partially supported (arkts-instanceof-ref-types)" diff --git a/linter/test_rules/rule79.ts.autofix.json b/linter/test_rules/rule79.ts.autofix.json index 109518d2..37cdea09 100644 --- a/linter/test_rules/rule79.ts.autofix.json +++ b/linter/test_rules/rule79.ts.autofix.json @@ -1,8 +1,22 @@ { + "copyright": [ + "Copyright (c) 2023-2023 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." + ], "nodes": [ { "line": 4, - "column": 1, + "column": 8, "problem": "CatchWithUnsupportedType", "autofixable": true, "autofix": [ diff --git a/linter/test_rules/rule79.ts.strict.json b/linter/test_rules/rule79.ts.strict.json index 486dbc46..3c46ccef 100644 --- a/linter/test_rules/rule79.ts.strict.json +++ b/linter/test_rules/rule79.ts.strict.json @@ -1,8 +1,22 @@ { + "copyright": [ + "Copyright (c) 2023-2023 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." + ], "nodes": [ { "line": 4, - "column": 1, + "column": 8, "problem": "CatchWithUnsupportedType", "suggest": "", "rule": "Type annotation in catch clause is not supported (arkts-no-types-in-catch)" diff --git a/linter/test_rules/rule80.ts.autofix.json b/linter/test_rules/rule80.ts.autofix.json index 54c46bff..c0234d77 100644 --- a/linter/test_rules/rule80.ts.autofix.json +++ b/linter/test_rules/rule80.ts.autofix.json @@ -1,8 +1,22 @@ { + "copyright": [ + "Copyright (c) 2023-2023 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." + ], "nodes": [ { "line": 2, - "column": 1, + "column": 12, "problem": "ForInStatement", "autofixable": false, "suggest": "", diff --git a/linter/test_rules/rule80.ts.relax.json b/linter/test_rules/rule80.ts.relax.json index 6eaffeec..92266489 100644 --- a/linter/test_rules/rule80.ts.relax.json +++ b/linter/test_rules/rule80.ts.relax.json @@ -1,8 +1,22 @@ { + "copyright": [ + "Copyright (c) 2023-2023 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." + ], "nodes": [ { "line": 2, - "column": 1, + "column": 12, "problem": "ForInStatement", "suggest": "", "rule": "\"for .. in\" is not supported (arkts-no-for-in)" diff --git a/linter/test_rules/rule80.ts.strict.json b/linter/test_rules/rule80.ts.strict.json index 6eaffeec..92266489 100644 --- a/linter/test_rules/rule80.ts.strict.json +++ b/linter/test_rules/rule80.ts.strict.json @@ -1,8 +1,22 @@ { + "copyright": [ + "Copyright (c) 2023-2023 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." + ], "nodes": [ { "line": 2, - "column": 1, + "column": 12, "problem": "ForInStatement", "suggest": "", "rule": "\"for .. in\" is not supported (arkts-no-for-in)" diff --git a/linter/test_rules/rule90.ts.autofix.json b/linter/test_rules/rule90.ts.autofix.json index a4cb311e..4dce99fb 100644 --- a/linter/test_rules/rule90.ts.autofix.json +++ b/linter/test_rules/rule90.ts.autofix.json @@ -1,8 +1,22 @@ { + "copyright": [ + "Copyright (c) 2023-2023 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." + ], "nodes": [ { "line": 2, - "column": 5, + "column": 14, "problem": "LimitedReturnTypeInference", "autofixable": false, "suggest": "", @@ -10,7 +24,7 @@ }, { "line": 10, - "column": 5, + "column": 14, "problem": "LimitedReturnTypeInference", "autofixable": false, "suggest": "", diff --git a/linter/test_rules/rule90.ts.strict.json b/linter/test_rules/rule90.ts.strict.json index 5210923d..745ebb02 100644 --- a/linter/test_rules/rule90.ts.strict.json +++ b/linter/test_rules/rule90.ts.strict.json @@ -1,15 +1,29 @@ { + "copyright": [ + "Copyright (c) 2023-2023 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." + ], "nodes": [ { "line": 2, - "column": 5, + "column": 14, "problem": "LimitedReturnTypeInference", "suggest": "", "rule": "Function return type inference is limited (arkts-no-implicit-return-types)" }, { "line": 10, - "column": 5, + "column": 14, "problem": "LimitedReturnTypeInference", "suggest": "", "rule": "Function return type inference is limited (arkts-no-implicit-return-types)" diff --git a/linter/test_rules/rule90_3.ts.autofix.json b/linter/test_rules/rule90_3.ts.autofix.json index 5d907575..f323349c 100644 --- a/linter/test_rules/rule90_3.ts.autofix.json +++ b/linter/test_rules/rule90_3.ts.autofix.json @@ -1,8 +1,22 @@ { + "copyright": [ + "Copyright (c) 2023-2023 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." + ], "nodes": [ { "line": 13, - "column": 5, + "column": 14, "problem": "LimitedReturnTypeInference", "autofixable": true, "autofix": [ diff --git a/linter/test_rules/rule90_3.ts.strict.json b/linter/test_rules/rule90_3.ts.strict.json index bf82e738..4fd18515 100644 --- a/linter/test_rules/rule90_3.ts.strict.json +++ b/linter/test_rules/rule90_3.ts.strict.json @@ -1,8 +1,22 @@ { + "copyright": [ + "Copyright (c) 2023-2023 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." + ], "nodes": [ { "line": 13, - "column": 5, + "column": 14, "problem": "LimitedReturnTypeInference", "suggest": "", "rule": "Function return type inference is limited (arkts-no-implicit-return-types)" -- Gitee