diff --git a/linter/lib/TypeScriptLinter.ts b/linter/lib/TypeScriptLinter.ts index 74dd53cce33797a457b90eb6c0f1ab88f8ca5e2a..9cf411d038864094f423aa665402227ceed7e812 100644 --- a/linter/lib/TypeScriptLinter.ts +++ b/linter/lib/TypeScriptLinter.ts @@ -211,7 +211,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]; @@ -242,17 +242,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]; @@ -262,12 +260,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], @@ -456,7 +454,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 5ac58e3bb369235993dd1ca9661830cbe1b88b13..b2782b14ae11160a4bee65435733250980196bd4 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 { @@ -540,11 +541,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)) { @@ -569,8 +566,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( @@ -858,8 +858,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; } @@ -981,6 +981,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 6a703fb8992993c91989efad2265333ded2560e9..77cde08220dfcd6b1ebd0f87d20cfb7ea1759b61 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 d4131bb815f5ac70c2500d0617b5edf526f00063..53819a024f8f41c0873fa6792abf2369762400ae 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 f275f94d87ff0953a3ebb66874dd41db77a749b0..7a9cf239b843e663ce3b63c44326d897c3696f31 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 61b0b061722b087d677699917466acc2aa014f9a..d38b74f0a2146ca0b422283e0d224a75e589beb5 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 61b0b061722b087d677699917466acc2aa014f9a..d38b74f0a2146ca0b422283e0d224a75e589beb5 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 362fa94c17e81b7d8ec8e43660e5650d82b6e561..73a294f7d67ef56703e89f24ec9577c3a8ac19db 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 362fa94c17e81b7d8ec8e43660e5650d82b6e561..73a294f7d67ef56703e89f24ec9577c3a8ac19db 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 baae30f20b4a0ec53190ff00990fd6bb536d1045..683c01ee856666cafe4b5f4ca5416c75e77075f7 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 756705c07a320cbebb128c7b79598ed26ba9b380..2e0cdf0b69757695eb91d6ceb70ee5067de9b63e 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/function_expression.ts.autofix.json b/linter/test/function_expression.ts.autofix.json index 3173e542955d2dc47270644c277838ebd03c0f43..713eb26cd13a28790bbba00c716ea4b4b596ecc6 100644 --- a/linter/test/function_expression.ts.autofix.json +++ b/linter/test/function_expression.ts.autofix.json @@ -38,7 +38,7 @@ { "start": 658, "end": 709, - "replacementText": "(x: number, y): number => {\r\n return x * y;\r\n}" + "replacementText": "(x: number, y): number => {\n return x * y;\n}" } ], "suggest": "", @@ -61,7 +61,7 @@ { "start": 759, "end": 792, - "replacementText": "() => {\r\n return 100;\r\n}" + "replacementText": "() => {\n return 100;\n}" } ], "suggest": "", @@ -76,7 +76,7 @@ { "start": 813, "end": 863, - "replacementText": "() => {\r\n return 'get result immediately';\r\n}" + "replacementText": "() => {\n return 'get result immediately';\n}" } ], "suggest": "", @@ -91,7 +91,7 @@ { "start": 870, "end": 908, - "replacementText": "() => {\r\n console.log('foo!');\r\n}" + "replacementText": "() => {\n console.log('foo!');\n}" } ], "suggest": "", @@ -106,7 +106,7 @@ { "start": 920, "end": 958, - "replacementText": "() => {\r\n console.log('bar!');\r\n}" + "replacementText": "() => {\n console.log('bar!');\n}" } ], "suggest": "", @@ -121,7 +121,7 @@ { "start": 1023, "end": 1055, - "replacementText": "(e) => {\r\n return e * 2;\r\n}" + "replacementText": "(e) => {\n return e * 2;\n}" } ], "suggest": "", @@ -136,7 +136,7 @@ { "start": 1084, "end": 1122, - "replacementText": "(x) => {\r\n return x % 2 === 0;\r\n}" + "replacementText": "(x) => {\n return x % 2 === 0;\n}" } ], "suggest": "", @@ -238,7 +238,7 @@ { "start": 1492, "end": 1649, - "replacementText": "(p: () => number): void => {\r\n let a = factorial(3);\r\n let b = p();\r\n let c = new C();\r\n c.m();\r\n}" + "replacementText": "(p: () => number): void => {\n let a = factorial(3);\n let b = p();\n let c = new C();\n c.m();\n}" } ], "suggest": "", @@ -253,7 +253,7 @@ { "start": 1663, "end": 1714, - "replacementText": "(() => {\r\n console.log('called immediately');\r\n})" + "replacementText": "(() => {\n console.log('called immediately');\n})" } ], "suggest": "", @@ -284,7 +284,7 @@ { "start": 1737, "end": 1782, - "replacementText": "(() => {\r\n console.log('index access');\r\n})" + "replacementText": "(() => {\n console.log('index access');\n})" } ], "suggest": "", @@ -299,7 +299,7 @@ { "start": 1793, "end": 1830, - "replacementText": "(() => {\r\n console.log('void');\r\n})" + "replacementText": "(() => {\n console.log('void');\n})" } ], "suggest": "", @@ -314,7 +314,7 @@ { "start": 1870, "end": 1912, - "replacementText": "(() => {\r\n console.log('async');\r\n})" + "replacementText": "(() => {\n console.log('async');\n})" } ], "suggest": "", @@ -329,7 +329,7 @@ { "start": 1941, "end": 1980, - "replacementText": "(() => {\r\n console.log('typeof');\r\n})" + "replacementText": "(() => {\n console.log('typeof');\n})" } ], "suggest": "", @@ -344,8 +344,8 @@ "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { - "line": 102, - "column": 15, + "line": 104, + "column": 7, "problem": "FunctionBind", "autofixable": false, "suggest": "", @@ -360,7 +360,7 @@ { "start": 2027, "end": 2097, - "replacementText": "((p: boolean) => {\r\n console.log('Function.bind(this)');\r\n})" + "replacementText": "((p: boolean) => {\n console.log('Function.bind(this)');\n})" } ], "suggest": "", diff --git a/linter/test/function_expression.ts.relax.json b/linter/test/function_expression.ts.relax.json index 9c09eb8f98bef564cc433152b39f969a0b680e09..565d2ad18dfe0cb25a2d8715b67d18022da1acf4 100644 --- a/linter/test/function_expression.ts.relax.json +++ b/linter/test/function_expression.ts.relax.json @@ -57,8 +57,8 @@ "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { - "line": 102, - "column": 15, + "line": 104, + "column": 7, "problem": "FunctionBind", "suggest": "", "rule": "\"Function.bind\" is not supported (arkts-no-func-bind)" diff --git a/linter/test/function_expression.ts.strict.json b/linter/test/function_expression.ts.strict.json index ae66a69916e87a615705a640a9cf18e804cd4c8e..9770abe5f998db2c4d18e253f251eecf725c6891 100644 --- a/linter/test/function_expression.ts.strict.json +++ b/linter/test/function_expression.ts.strict.json @@ -211,8 +211,8 @@ "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)" }, { - "line": 102, - "column": 15, + "line": 104, + "column": 7, "problem": "FunctionBind", "suggest": "", "rule": "\"Function.bind\" is not supported (arkts-no-func-bind)" diff --git a/linter/test/function_object_methods.ts.relax.json b/linter/test/function_object_methods.ts.relax.json index 63e7ef1b526fd8a54ce83149737d03f679257247..c9e4d85124199f1dfa6cdbbc35a767122ca6aa3f 100644 --- a/linter/test/function_object_methods.ts.relax.json +++ b/linter/test/function_object_methods.ts.relax.json @@ -23,7 +23,7 @@ }, { "line": 29, - "column": 21, + "column": 35, "problem": "FunctionBind", "suggest": "", "rule": "\"Function.bind\" is not supported (arkts-no-func-bind)" @@ -37,21 +37,21 @@ }, { "line": 30, - "column": 26, + "column": 45, "problem": "FunctionBind", "suggest": "", "rule": "\"Function.bind\" is not supported (arkts-no-func-bind)" }, { "line": 37, - "column": 23, + "column": 37, "problem": "FunctionBind", "suggest": "", "rule": "\"Function.bind\" is not supported (arkts-no-func-bind)" }, { "line": 38, - "column": 21, + "column": 40, "problem": "FunctionBind", "suggest": "", "rule": "\"Function.bind\" is not supported (arkts-no-func-bind)" @@ -65,7 +65,7 @@ }, { "line": 68, - "column": 22, + "column": 44, "problem": "FunctionApplyCall", "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" }, @@ -78,40 +78,40 @@ }, { "line": 70, - "column": 13, + "column": 35, "problem": "FunctionBind", "suggest": "", "rule": "\"Function.bind\" is not supported (arkts-no-func-bind)" }, { "line": 75, - "column": 26, + "column": 48, "problem": "FunctionBind", "suggest": "", "rule": "\"Function.bind\" is not supported (arkts-no-func-bind)" }, { "line": 78, - "column": 26, + "column": 48, "problem": "FunctionBind", "suggest": "", "rule": "\"Function.bind\" is not supported (arkts-no-func-bind)" }, { "line": 81, - "column": 9, + "column": 31, "problem": "FunctionApplyCall", "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" }, { "line": 82, - "column": 9, + "column": 31, "problem": "FunctionApplyCall", "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" }, { "line": 87, - "column": 16, + "column": 32, "problem": "FunctionApplyCall", "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" }, @@ -124,7 +124,7 @@ }, { "line": 94, - "column": 20, + "column": 37, "problem": "FunctionApplyCall", "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" }, @@ -137,40 +137,40 @@ }, { "line": 96, - "column": 13, + "column": 30, "problem": "FunctionBind", "suggest": "", "rule": "\"Function.bind\" is not supported (arkts-no-func-bind)" }, { "line": 101, - "column": 25, + "column": 42, "problem": "FunctionBind", "suggest": "", "rule": "\"Function.bind\" is not supported (arkts-no-func-bind)" }, { "line": 104, - "column": 25, + "column": 42, "problem": "FunctionBind", "suggest": "", "rule": "\"Function.bind\" is not supported (arkts-no-func-bind)" }, { "line": 107, - "column": 3, + "column": 20, "problem": "FunctionApplyCall", "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" }, { "line": 108, - "column": 3, + "column": 20, "problem": "FunctionApplyCall", "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" }, { "line": 113, - "column": 10, + "column": 21, "problem": "FunctionApplyCall", "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" }, @@ -218,31 +218,31 @@ }, { "line": 136, - "column": 13, + "column": 23, "problem": "FunctionApplyCall", "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" }, { "line": 137, - "column": 13, + "column": 23, "problem": "FunctionApplyCall", "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" }, { "line": 138, - "column": 13, + "column": 23, "problem": "FunctionApplyCall", "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" }, { "line": 139, - "column": 13, + "column": 23, "problem": "FunctionApplyCall", "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" }, { "line": 141, - "column": 1, + "column": 5, "problem": "FunctionApplyCall", "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" } diff --git a/linter/test/function_object_methods.ts.strict.json b/linter/test/function_object_methods.ts.strict.json index c8ec09cbb5b456765c29ba3d451774f949d8201b..69daf85ea247a6e3351ce452f1d205c7cb3650fc 100644 --- a/linter/test/function_object_methods.ts.strict.json +++ b/linter/test/function_object_methods.ts.strict.json @@ -23,7 +23,7 @@ }, { "line": 29, - "column": 21, + "column": 35, "problem": "FunctionBind", "suggest": "", "rule": "\"Function.bind\" is not supported (arkts-no-func-bind)" @@ -37,21 +37,21 @@ }, { "line": 30, - "column": 26, + "column": 45, "problem": "FunctionBind", "suggest": "", "rule": "\"Function.bind\" is not supported (arkts-no-func-bind)" }, { "line": 37, - "column": 23, + "column": 37, "problem": "FunctionBind", "suggest": "", "rule": "\"Function.bind\" is not supported (arkts-no-func-bind)" }, { "line": 38, - "column": 21, + "column": 40, "problem": "FunctionBind", "suggest": "", "rule": "\"Function.bind\" is not supported (arkts-no-func-bind)" @@ -65,7 +65,7 @@ }, { "line": 68, - "column": 22, + "column": 44, "problem": "FunctionApplyCall", "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" }, @@ -78,40 +78,40 @@ }, { "line": 70, - "column": 13, + "column": 35, "problem": "FunctionBind", "suggest": "", "rule": "\"Function.bind\" is not supported (arkts-no-func-bind)" }, { "line": 75, - "column": 26, + "column": 48, "problem": "FunctionBind", "suggest": "", "rule": "\"Function.bind\" is not supported (arkts-no-func-bind)" }, { "line": 78, - "column": 26, + "column": 48, "problem": "FunctionBind", "suggest": "", "rule": "\"Function.bind\" is not supported (arkts-no-func-bind)" }, { "line": 81, - "column": 9, + "column": 31, "problem": "FunctionApplyCall", "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" }, { "line": 82, - "column": 9, + "column": 31, "problem": "FunctionApplyCall", "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" }, { "line": 87, - "column": 16, + "column": 32, "problem": "FunctionApplyCall", "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" }, @@ -124,7 +124,7 @@ }, { "line": 94, - "column": 20, + "column": 37, "problem": "FunctionApplyCall", "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" }, @@ -137,40 +137,40 @@ }, { "line": 96, - "column": 13, + "column": 30, "problem": "FunctionBind", "suggest": "", "rule": "\"Function.bind\" is not supported (arkts-no-func-bind)" }, { "line": 101, - "column": 25, + "column": 42, "problem": "FunctionBind", "suggest": "", "rule": "\"Function.bind\" is not supported (arkts-no-func-bind)" }, { "line": 104, - "column": 25, + "column": 42, "problem": "FunctionBind", "suggest": "", "rule": "\"Function.bind\" is not supported (arkts-no-func-bind)" }, { "line": 107, - "column": 3, + "column": 20, "problem": "FunctionApplyCall", "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" }, { "line": 108, - "column": 3, + "column": 20, "problem": "FunctionApplyCall", "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" }, { "line": 113, - "column": 10, + "column": 21, "problem": "FunctionApplyCall", "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" }, @@ -246,31 +246,31 @@ }, { "line": 136, - "column": 13, + "column": 23, "problem": "FunctionApplyCall", "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" }, { "line": 137, - "column": 13, + "column": 23, "problem": "FunctionApplyCall", "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" }, { "line": 138, - "column": 13, + "column": 23, "problem": "FunctionApplyCall", "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" }, { "line": 139, - "column": 13, + "column": 23, "problem": "FunctionApplyCall", "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" }, { "line": 141, - "column": 1, + "column": 5, "problem": "FunctionApplyCall", "rule": "\"Function.apply\", \"Function.call\" are not supported (arkts-no-func-apply-call)" } diff --git a/linter/test/instanceof.ts.relax.json b/linter/test/instanceof.ts.relax.json index c416e034ce1c23e88959724a35ad477f48ef4b2c..348b7dd402bd6eeb5708c096b16953569dfd731a 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 940b13207260ee481330e73e59e12c837f644f5b..4d3277e0d787ee19775c4399987297154de7948c 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 33be9cbb71aa3c9d123d2ccc33e0374f6d5e209e..cc487f6f42318f5810ee92b2bad65ebc9c348988 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 33be9cbb71aa3c9d123d2ccc33e0374f6d5e209e..cc487f6f42318f5810ee92b2bad65ebc9c348988 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 d7b8c66613290821d1712d8500dd13823b677734..a7456973f6dd610435b4ed3d3048f827130ae85c 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 280ccc398b87e639a6d98a9bea729889be35a3cd..ad66b1bcd36ad0ea17f1b4533e10e50445705c40 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 aec9b187e5a32dce8d003970cb5880566d063698..42cdf50f433f60271ea280e314dbf7147b90d00b 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 a9097524e1dbafcc2d69584a2f08808fca19bb93..dc1f301bc9ed0c9544bc130e23c6a45a426cf4bc 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 a32e3c7785bdb329e251b02c6548dd67e086a9b1..c9a962d16bf0ca0f31879f01a975e70fd3df141b 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 d842e1a662d8b00d60f873d1793594be1a78bd10..52221ff05b55135a172cb1ec98c6c3ad7ee02713 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 6b30f0d8dad41856f55e5ccae53a514d0ac48429..5d007f9001218f33f37f2018736a373352875375 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": 12, - "problem": "FunctionApplyCall" + "column": 18, + "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": 54, - "problem": "FunctionBind" + "column": 60, + "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 17fe5e964920a0cac8ffd78477312f7362c0fe5e..22896007c7bb137a095d4f1929ddd7df48e23f8e 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": 12, - "problem": "FunctionApplyCall" + "column": 18, + "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": 54, - "problem": "FunctionBind" + "column": 60, + "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 87eabb4e19f3a605cb7e12b9986268f2e46788ca..8606279121e3307ee695e46628c1b88b87657ef1 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 fd22371de602464d0a25cbff6ba39c87dee87df3..0f24e4b64aef33de8214efd069c2118b4b85f02a 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 0b80e8ace95cd0133057e4dfd14154cf74cd98bb..dfe213645b8ea40fd3e3e324517d2f00acbf775e 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 ed74f56a2af3396ac4bf837d4902413f1510e660..c09577d55e7260a8d9535699d00c62ae48695a4d 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 72f785ae1c63df2792bb4966433c96cb31cf53f3..24cc903a8f07c172a2765b433494f7a55f8ff20b 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 7b41949d17e9f435905d2ae3946dd7ec32836f1f..61971845379ded79581051ad34e64272f1665ed2 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 7b41949d17e9f435905d2ae3946dd7ec32836f1f..61971845379ded79581051ad34e64272f1665ed2 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 8da6f5f88468f683b79bcb793ce48f7ecc365a62..7b79861c7be0903d9d4bf62a2a4b9965e1f434f5 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 f61e4269aaa8a99e7081a929cb2158ceb1878f00..8386565b774b7e52261fa5a1fe06f8a261ea728a 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 f61e4269aaa8a99e7081a929cb2158ceb1878f00..8386565b774b7e52261fa5a1fe06f8a261ea728a 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 ba15a33cf59aebf7b21ab330280fe27cab3ac874..481b5280ece3312fc7d119bbc055eef67102d9e2 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 9dda4cf2161cbbdb25d061ecd071e1d6774d6fdb..2fbb021179975f982eb90a33157acb8e7e0db133 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 9e70ad4de09a61930f428ca3ac85c7d068e08d55..ff5ed0209527cc9f4f1d2c3c87fa61d0f9c999ae 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 050b37b6892e06316f492c677fe4711892ab647d..d90fe1a6b6c7c9870bd2924acfaeefb4fbee16f7 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 050b37b6892e06316f492c677fe4711892ab647d..d90fe1a6b6c7c9870bd2924acfaeefb4fbee16f7 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 109518d2aea66e3bb416d2451f2c2ebe0a2b1450..37cdea0906eb1a82e95522ed5ee1e7a3e7a4f951 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 486dbc46a504eee3152cbf56c5ea4fd8d8d4b720..3c46ccefa979349773268bfd86a5393c80a90971 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 54c46bffca3fc08f3f6cb04db8809034ecd95272..c0234d77cf03fa21ec3a203db8538384606f3128 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 6eaffeec5e7386cc3f3bf9efa4dc3ab76aabed41..92266489bedbb90fd8b638c91ef26f548e54d375 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 6eaffeec5e7386cc3f3bf9efa4dc3ab76aabed41..92266489bedbb90fd8b638c91ef26f548e54d375 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 a4cb311ed4b65a0b07b2a947cee0b509f8234c3f..4dce99fb89b8e3ddcea6e99d8f154ee9be8c45ed 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 5210923dec7884d624e4baea605d05f3f534408e..745ebb0217f2c932b5f350ecc058351c35fadda3 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 5d907575415c2a253fa1bd5ef401129137148230..f323349cc582c707975cc6aa9e18480b64017cc9 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 bf82e738f0a0dad1005e5a475e3ff9ac25cc784c..4fd185150fc58442d58fc8bd6d47b2e61ca27ee4 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)"