diff --git a/linter-4.2/src/Problems.ts b/linter-4.2/src/Problems.ts index 6c2ff24e49b69f007d78f4dbeca4b30081f78875..57858c6c31fec259113f97d745f10b58947c7dff 100644 --- a/linter-4.2/src/Problems.ts +++ b/linter-4.2/src/Problems.ts @@ -20,7 +20,7 @@ export enum FaultID { ThrowStatement, IndexedAccessType, UnknownType, ForInStatement, InOperator, KeyOfOperator, ImportFromPath, FunctionExpression, IntersectionType, ObjectTypeLiteral, AddWithWrongType, CommaOperator, LimitedReturnTypeInference, - ArrowFunctionWithOmittedTypes, LambdaWithTypeParameters, ClassExpression, DestructuringAssignment, + LambdaWithTypeParameters, ClassExpression, DestructuringAssignment, DestructuringDeclaration, ForOfNonArray, VarDeclaration, CatchWithUnsupportedType, DeleteOperator, DeclWithDuplicateName, UnaryArithmNotNumber, ConstructorType, ConstructorIface, ConstructorFuncs, CallSignature, TypeAssertion, PrivateIdentifier, LocalFunction, @@ -72,7 +72,6 @@ faultsAttrs[FaultID.RegexLiteral] = {cookBookRef: '37',}; faultsAttrs[FaultID.ObjectLiteralNoContextType] = {cookBookRef: '38',}; faultsAttrs[FaultID.ObjectTypeLiteral] = {cookBookRef: '40',}; faultsAttrs[FaultID.ArrayLiteralNoContextType] = {cookBookRef: '43',}; -faultsAttrs[FaultID.ArrowFunctionWithOmittedTypes] = {migratable: true, cookBookRef: '45',}; faultsAttrs[FaultID.FunctionExpression] = {migratable: true, cookBookRef: '46',}; faultsAttrs[FaultID.LambdaWithTypeParameters] = {migratable: true, cookBookRef: '49',}; faultsAttrs[FaultID.ClassExpression] = {migratable: true, cookBookRef: '50',}; diff --git a/linter-4.2/src/TypeScriptLinter.ts b/linter-4.2/src/TypeScriptLinter.ts index dafd72b8f1d912efe1952a629542784df6e0aaaa..516d074cadf72f7d3698c153b4204f0337fc410f 100644 --- a/linter-4.2/src/TypeScriptLinter.ts +++ b/linter-4.2/src/TypeScriptLinter.ts @@ -704,20 +704,16 @@ export class TypeScriptLinter { let containsThis = this.functionContainsThis(funcExpr.body); let isGeneric = funcExpr.typeParameters !== undefined && funcExpr.typeParameters.length > 0; - let newParams = this.handleMissingParameterTypes(funcExpr); - let [hasUnfixableReturnType, newRetTypeNode] = this.handleMissingReturnType(funcExpr); - let autofixable = !isGeneric && !isGenerator && !containsThis && - newParams && !hasUnfixableReturnType; + let autofixable = !isGeneric && !isGenerator && !containsThis && !hasUnfixableReturnType; let autofix: Autofix[] | undefined; if (autofixable && this.autofixesInfo.shouldAutofix(node, FaultID.FunctionExpression)) { - autofix = [ Autofixer.fixFunctionExpression(funcExpr, newParams, newRetTypeNode) ]; + autofix = [ Autofixer.fixFunctionExpression(funcExpr, funcExpr.parameters, newRetTypeNode) ]; } this.incrementCounters(node, FaultID.FunctionExpression, autofixable, autofix); - if (!newParams) this.incrementCounters(funcExpr, FaultID.ArrowFunctionWithOmittedTypes, false); if (isGeneric) this.incrementCounters(funcExpr, FaultID.LambdaWithTypeParameters); if (isGenerator) this.incrementCounters(funcExpr, FaultID.GeneratorFunction); if (containsThis) this.incrementCounters(funcExpr, FaultID.FunctionContainsThis); @@ -732,8 +728,6 @@ export class TypeScriptLinter { const contextType = this.tsTypeChecker.getContextualType(arrowFunc); if (!(contextType && this.tsUtils.isLibraryType(contextType))) { - this.handleMissingParameterTypes(arrowFunc); - if (!arrowFunc.type) this.handleMissingReturnType(arrowFunc); if (arrowFunc.typeParameters && arrowFunc.typeParameters.length > 0) @@ -741,41 +735,6 @@ export class TypeScriptLinter { } } - private handleMissingParameterTypes(signDecl: ts.SignatureDeclaration): - ts.NodeArray | undefined { - let hasOmittedType = false; - let autofixable = true; - let autofix: Autofix[] | undefined; - let isFuncExpr = signDecl.kind === ts.SyntaxKind.FunctionExpression; - let newParams: ts.ParameterDeclaration[] = []; - for (const param of signDecl.parameters) { - if (isFuncExpr) newParams.push(param); - if (param.type) continue; - - hasOmittedType = true; - let paramType = this.tsTypeChecker.getTypeAtLocation(param); - let paramTypeNode = this.tsTypeChecker.typeToTypeNode(paramType, param, ts.NodeBuilderFlags.None); - if (!paramType || this.tsUtils.isUnsupportedType(paramType) || !paramTypeNode) { - autofixable = false; - continue; - } - - if (isFuncExpr) { - let newParam = Autofixer.fixParamWithoutType(param, paramTypeNode, true) as ts.ParameterDeclaration; - newParams[newParams.length-1] = newParam; - } else if (this.autofixesInfo.shouldAutofix(signDecl, FaultID.ArrowFunctionWithOmittedTypes)) { - if (!autofix) autofix = []; - autofix.push(Autofixer.fixParamWithoutType(param, paramTypeNode) as Autofix); - } - } - // Don't report here if in function expression context. - // See handleFunctionExpression for details. - if (hasOmittedType && !isFuncExpr) - this.incrementCounters(signDecl, FaultID.ArrowFunctionWithOmittedTypes, autofixable, autofix); - - return isFuncExpr && autofixable ? ts.factory.createNodeArray(newParams) : undefined; - } - private handleClassExpression(node: ts.Node) { let tsClassExpr = node as ts.ClassExpression; this.incrementCounters(node, FaultID.ClassExpression); diff --git a/linter-4.2/src/TypeScriptLinterConfig.ts b/linter-4.2/src/TypeScriptLinterConfig.ts index 5b8bcdb2907c4553674fe77616a9193384a4f15b..1a027488f808c3d47a6505344747fa13124d38c7 100644 --- a/linter-4.2/src/TypeScriptLinterConfig.ts +++ b/linter-4.2/src/TypeScriptLinterConfig.ts @@ -63,7 +63,6 @@ export class LinterConfig { // LinterConfig.nodeDesc[FaultID.BitOpWithWrongType] = 'bit operation with wrong operand'; LinterConfig.nodeDesc[FaultID.CommaOperator] = 'comma operator'; LinterConfig.nodeDesc[FaultID.LimitedReturnTypeInference] = 'Functions with limited return type inference'; - LinterConfig.nodeDesc[FaultID.ArrowFunctionWithOmittedTypes] = 'Arrow functions with omitted parameter types'; LinterConfig.nodeDesc[FaultID.LambdaWithTypeParameters] = 'Lambda function with type parameters'; LinterConfig.nodeDesc[FaultID.ClassExpression] = 'Class expressions'; LinterConfig.nodeDesc[FaultID.DestructuringAssignment] = 'Destructuring assignments'; diff --git a/linter-4.2/test/arkui_decorators.ts.autofix.json b/linter-4.2/test/arkui_decorators.ts.autofix.json index e02cafd75ec16aaa2fe60291965ccd92408c1afd..ce00ce37ab31381eb2dd67194f5290d2037fed6f 100644 --- a/linter-4.2/test/arkui_decorators.ts.autofix.json +++ b/linter-4.2/test/arkui_decorators.ts.autofix.json @@ -32,12 +32,6 @@ "problem": "IntersectionType", "autofixable": false }, - { - "line": 22, - "column": 32, - "problem": "ArrowFunctionWithOmittedTypes", - "autofixable": false - }, { "line": 22, "column": 33, @@ -50,12 +44,6 @@ "problem": "AnyType", "autofixable": false }, - { - "line": 24, - "column": 43, - "problem": "ArrowFunctionWithOmittedTypes", - "autofixable": false - }, { "line": 24, "column": 44, @@ -68,12 +56,6 @@ "problem": "AnyType", "autofixable": false }, - { - "line": 29, - "column": 31, - "problem": "ArrowFunctionWithOmittedTypes", - "autofixable": false - }, { "line": 29, "column": 32, @@ -86,12 +68,6 @@ "problem": "AnyType", "autofixable": false }, - { - "line": 38, - "column": 39, - "problem": "ArrowFunctionWithOmittedTypes", - "autofixable": false - }, { "line": 38, "column": 40, @@ -104,12 +80,6 @@ "problem": "AnyType", "autofixable": false }, - { - "line": 39, - "column": 62, - "problem": "ArrowFunctionWithOmittedTypes", - "autofixable": false - }, { "line": 39, "column": 63, diff --git a/linter-4.2/test/arkui_decorators.ts.strict.json b/linter-4.2/test/arkui_decorators.ts.strict.json index 2c1b9c82e5ee75d11ea1e91bd3e2535cc448eeae..47743d022401f8733f284caf86279424c98e8be6 100644 --- a/linter-4.2/test/arkui_decorators.ts.strict.json +++ b/linter-4.2/test/arkui_decorators.ts.strict.json @@ -29,11 +29,6 @@ "column": 30, "problem": "IntersectionType" }, - { - "line": 22, - "column": 32, - "problem": "ArrowFunctionWithOmittedTypes" - }, { "line": 22, "column": 33, @@ -44,11 +39,6 @@ "column": 36, "problem": "AnyType" }, - { - "line": 24, - "column": 43, - "problem": "ArrowFunctionWithOmittedTypes" - }, { "line": 24, "column": 44, @@ -59,11 +49,6 @@ "column": 47, "problem": "AnyType" }, - { - "line": 29, - "column": 31, - "problem": "ArrowFunctionWithOmittedTypes" - }, { "line": 29, "column": 32, @@ -74,11 +59,6 @@ "column": 35, "problem": "AnyType" }, - { - "line": 38, - "column": 39, - "problem": "ArrowFunctionWithOmittedTypes" - }, { "line": 38, "column": 40, @@ -89,11 +69,6 @@ "column": 43, "problem": "AnyType" }, - { - "line": 39, - "column": 62, - "problem": "ArrowFunctionWithOmittedTypes" - }, { "line": 39, "column": 63, diff --git a/linter-4.2/test/functions.ts.autofix.json b/linter-4.2/test/functions.ts.autofix.json index c9dc613ccd57ce179451cd29fbb96817806c59c0..b2f9e5af665651b562991fd259dceeb3f7e9f178 100644 --- a/linter-4.2/test/functions.ts.autofix.json +++ b/linter-4.2/test/functions.ts.autofix.json @@ -61,13 +61,14 @@ "line": 49, "column": 20, "problem": "FunctionExpression", - "autofixable": false - }, - { - "line": 49, - "column": 20, - "problem": "ArrowFunctionWithOmittedTypes", - "autofixable": false + "autofixable": true, + "autofix": [ + { + "start": 1258, + "end": 1313, + "replacementText": "(x: number, y): number => {\r\n return x * y;\r\n}" + } + ] }, { "line": 49, @@ -155,7 +156,7 @@ { "start": 1762, "end": 1798, - "replacementText": "(e: number) => {\r\n return e * 2;\r\n}" + "replacementText": "(e) => {\r\n return e * 2;\r\n}" } ] }, @@ -168,7 +169,7 @@ { "start": 1829, "end": 1871, - "replacementText": "(x: number) => {\r\n return x % 2 === 0;\r\n}" + "replacementText": "(x) => {\r\n return x % 2 === 0;\r\n}" } ] }, @@ -184,49 +185,18 @@ "problem": "LambdaWithTypeParameters", "autofixable": false }, - { - "line": 93, - "column": 18, - "problem": "ArrowFunctionWithOmittedTypes", - "autofixable": false - }, { "line": 93, "column": 19, "problem": "AnyType", "autofixable": false }, - { - "line": 95, - "column": 16, - "problem": "ArrowFunctionWithOmittedTypes", - "autofixable": false - }, { "line": 95, "column": 17, "problem": "AnyType", "autofixable": false }, - { - "line": 96, - "column": 42, - "problem": "ArrowFunctionWithOmittedTypes", - "autofixable": true, - "autofix": [ - { - "start": 2233, - "end": 2234, - "replacementText": "x: number" - } - ] - }, - { - "line": 98, - "column": 15, - "problem": "ArrowFunctionWithOmittedTypes", - "autofixable": false - }, { "line": 98, "column": 27, diff --git a/linter-4.2/test/functions.ts.strict.json b/linter-4.2/test/functions.ts.strict.json index 67f1ad7a42ab414c2a265d5b34d80c80d0102cc1..641959895c092fe40c484090323ff420f3989fcf 100644 --- a/linter-4.2/test/functions.ts.strict.json +++ b/linter-4.2/test/functions.ts.strict.json @@ -49,11 +49,6 @@ "column": 20, "problem": "FunctionExpression" }, - { - "line": 49, - "column": 20, - "problem": "ArrowFunctionWithOmittedTypes" - }, { "line": 49, "column": 41, @@ -109,36 +104,16 @@ "column": 19, "problem": "LambdaWithTypeParameters" }, - { - "line": 93, - "column": 18, - "problem": "ArrowFunctionWithOmittedTypes" - }, { "line": 93, "column": 19, "problem": "AnyType" }, - { - "line": 95, - "column": 16, - "problem": "ArrowFunctionWithOmittedTypes" - }, { "line": 95, "column": 17, "problem": "AnyType" }, - { - "line": 96, - "column": 42, - "problem": "ArrowFunctionWithOmittedTypes" - }, - { - "line": 98, - "column": 15, - "problem": "ArrowFunctionWithOmittedTypes" - }, { "line": 98, "column": 27, diff --git a/linter-4.2/test/inferred_type.ts.strict.json b/linter-4.2/test/inferred_type.ts.strict.json index 45bfefa9e2809f83147927081f102d6f838a6222..928645dd6387d5ad8bbdd821759fc7cc650f9622 100644 --- a/linter-4.2/test/inferred_type.ts.strict.json +++ b/linter-4.2/test/inferred_type.ts.strict.json @@ -39,11 +39,6 @@ "column": 14, "problem": "AnyType" }, - { - "line": 28, - "column": 11, - "problem": "ArrowFunctionWithOmittedTypes" - }, { "line": 28, "column": 23, diff --git a/linter-4.2/test/prototype_assignment.ts.autofix.json b/linter-4.2/test/prototype_assignment.ts.autofix.json index 5eec59da4cbdffd1b54450c344e83ffb2a7e1eea..ca852403d4c95705103d29f4f68ede38571a1070 100644 --- a/linter-4.2/test/prototype_assignment.ts.autofix.json +++ b/linter-4.2/test/prototype_assignment.ts.autofix.json @@ -26,12 +26,6 @@ "problem": "FunctionExpression", "autofixable": false }, - { - "line": 17, - "column": 20, - "problem": "ArrowFunctionWithOmittedTypes", - "autofixable": false - }, { "line": 17, "column": 20, @@ -68,12 +62,6 @@ "problem": "FunctionExpression", "autofixable": false }, - { - "line": 27, - "column": 26, - "problem": "ArrowFunctionWithOmittedTypes", - "autofixable": false - }, { "line": 27, "column": 26, diff --git a/linter-4.2/test/prototype_assignment.ts.strict.json b/linter-4.2/test/prototype_assignment.ts.strict.json index afe808d0fad4dc9dcf492bcbee823c31fdfbf2ff..52a5b06faa1b9f8312025a74df49a3619f36100b 100644 --- a/linter-4.2/test/prototype_assignment.ts.strict.json +++ b/linter-4.2/test/prototype_assignment.ts.strict.json @@ -24,11 +24,6 @@ "column": 20, "problem": "FunctionExpression" }, - { - "line": 17, - "column": 20, - "problem": "ArrowFunctionWithOmittedTypes" - }, { "line": 17, "column": 20, @@ -59,11 +54,6 @@ "column": 26, "problem": "FunctionExpression" }, - { - "line": 27, - "column": 26, - "problem": "ArrowFunctionWithOmittedTypes" - }, { "line": 27, "column": 26, diff --git a/linter-4.2/test/types.ts.autofix.json b/linter-4.2/test/types.ts.autofix.json index 4b172f0527388d59ad15479005b7453f4e584546..df792c988e21215de377bc415603a123243d8eee 100644 --- a/linter-4.2/test/types.ts.autofix.json +++ b/linter-4.2/test/types.ts.autofix.json @@ -340,19 +340,6 @@ "problem": "LocalFunction", "autofixable": false }, - { - "line": 139, - "column": 22, - "problem": "ArrowFunctionWithOmittedTypes", - "autofixable": true, - "autofix": [ - { - "start": 3168, - "end": 3169, - "replacementText": "x: T" - } - ] - }, { "line": 157, "column": 5, diff --git a/linter-4.2/test/types.ts.strict.json b/linter-4.2/test/types.ts.strict.json index c377289332c0177b808859722687e6b2c89cc186..ef1caa5f55839ae87bf81b66102a94e277c6af6c 100644 --- a/linter-4.2/test/types.ts.strict.json +++ b/linter-4.2/test/types.ts.strict.json @@ -239,11 +239,6 @@ "column": 3, "problem": "LocalFunction" }, - { - "line": 139, - "column": 22, - "problem": "ArrowFunctionWithOmittedTypes" - }, { "line": 157, "column": 5, diff --git a/linter/src/FaultAttrs.ts b/linter/src/FaultAttrs.ts index 5669bf6ffffeee6511b9da1bad1fd92de85f5fd0..0fab4b6c2933c639b5842a7d55f3c3e295c7194e 100644 --- a/linter/src/FaultAttrs.ts +++ b/linter/src/FaultAttrs.ts @@ -50,7 +50,6 @@ faultsAttrs[FaultID.RegexLiteral] = {cookBookRef: '37',}; faultsAttrs[FaultID.ObjectLiteralNoContextType] = {cookBookRef: '38',}; faultsAttrs[FaultID.ObjectTypeLiteral] = {cookBookRef: '40',}; faultsAttrs[FaultID.ArrayLiteralNoContextType] = {cookBookRef: '43',}; -faultsAttrs[FaultID.ArrowFunctionWithOmittedTypes] = {migratable: true, cookBookRef: '45',}; faultsAttrs[FaultID.FunctionExpression] = {migratable: true, cookBookRef: '46',}; faultsAttrs[FaultID.LambdaWithTypeParameters] = {migratable: true, cookBookRef: '49',}; faultsAttrs[FaultID.ClassExpression] = {migratable: true, cookBookRef: '50',}; diff --git a/linter/src/FaultDesc.ts b/linter/src/FaultDesc.ts index eab13903d413532beb36e7ee3d1eda2e5cb48a6d..ab625c7dabe405b9a0730b51a078c5a97e8b8c39 100644 --- a/linter/src/FaultDesc.ts +++ b/linter/src/FaultDesc.ts @@ -47,7 +47,6 @@ faultDesc[FaultID.ObjectTypeLiteral] = 'Object type literals'; faultDesc[FaultID.AddWithWrongType] = 'binary "+" with wrong operand'; faultDesc[FaultID.CommaOperator] = 'comma operator'; faultDesc[FaultID.LimitedReturnTypeInference] = 'Functions with limited return type inference'; -faultDesc[FaultID.ArrowFunctionWithOmittedTypes] = 'Arrow functions with omitted parameter types'; faultDesc[FaultID.LambdaWithTypeParameters] = 'Lambda function with type parameters'; faultDesc[FaultID.ClassExpression] = 'Class expressions'; faultDesc[FaultID.DestructuringAssignment] = 'Destructuring assignments'; diff --git a/linter/src/Problems.ts b/linter/src/Problems.ts index 658bb159a0658f3e6b7436dc967d8951964d6ca1..8aaa7d6aed74715b8a38b007b3a790aa8aa37b88 100644 --- a/linter/src/Problems.ts +++ b/linter/src/Problems.ts @@ -20,7 +20,7 @@ export enum FaultID { ThrowStatement, IndexedAccessType, UnknownType, ForInStatement, InOperator, KeyOfOperator, ImportFromPath, FunctionExpression, IntersectionType, ObjectTypeLiteral, AddWithWrongType, CommaOperator, LimitedReturnTypeInference, - ArrowFunctionWithOmittedTypes, LambdaWithTypeParameters, ClassExpression, DestructuringAssignment, + LambdaWithTypeParameters, ClassExpression, DestructuringAssignment, DestructuringDeclaration, ForOfNonArray, VarDeclaration, CatchWithUnsupportedType, DeleteOperator, DeclWithDuplicateName, UnaryArithmNotNumber, ConstructorType, ConstructorIface, ConstructorFuncs, CallSignature, TypeAssertion, PrivateIdentifier, LocalFunction, diff --git a/linter/src/TypeScriptLinter.ts b/linter/src/TypeScriptLinter.ts index 0c9ef14d4897509d355949949a7b778220bbacfb..b8ed5e104714f6718cdb6e90ffe80cacce4861ca 100644 --- a/linter/src/TypeScriptLinter.ts +++ b/linter/src/TypeScriptLinter.ts @@ -683,17 +683,13 @@ export class TypeScriptLinter { let isGenerator = funcExpr.asteriskToken !== undefined; let containsThis = functionContainsThis(funcExpr.body); let isGeneric = funcExpr.typeParameters !== undefined && funcExpr.typeParameters.length > 0; - let newParams = this.handleMissingParameterTypes(funcExpr); let [hasUnfixableReturnType, newRetTypeNode] = this.handleMissingReturnType(funcExpr); - let autofixable = !isGeneric && !isGenerator && !containsThis && newParams && !hasUnfixableReturnType; + let autofixable = !isGeneric && !isGenerator && !containsThis && !hasUnfixableReturnType; let autofix: Autofix[] | undefined; if (autofixable && this.autofixesInfo.shouldAutofix(node, FaultID.FunctionExpression)) { - autofix = [ Autofixer.fixFunctionExpression(funcExpr, newParams, newRetTypeNode) ]; + autofix = [ Autofixer.fixFunctionExpression(funcExpr, funcExpr.parameters, newRetTypeNode) ]; } this.incrementCounters(node, FaultID.FunctionExpression, autofixable, autofix); - if (!newParams) { - this.incrementCounters(funcExpr, FaultID.ArrowFunctionWithOmittedTypes, false); - } if (isGeneric) { this.incrementCounters(funcExpr, FaultID.LambdaWithTypeParameters); } @@ -715,7 +711,6 @@ export class TypeScriptLinter { } const contextType = this.tsTypeChecker.getContextualType(arrowFunc); if (!(contextType && this.tsUtils.isLibraryType(contextType))) { - this.handleMissingParameterTypes(arrowFunc); if (!arrowFunc.type) { this.handleMissingReturnType(arrowFunc); } @@ -725,43 +720,6 @@ export class TypeScriptLinter { } } - private handleMissingParameterTypes(signDecl: ts.SignatureDeclaration): - ts.NodeArray | undefined { - let hasOmittedType = false; - let autofixable = true; - let autofix: Autofix[] | undefined; - let isFuncExpr = signDecl.kind === ts.SyntaxKind.FunctionExpression; - let newParams: ts.ParameterDeclaration[] = []; - for (const param of signDecl.parameters) { - if (isFuncExpr) { - newParams.push(param); - } - if (param.type) { - continue; - } - hasOmittedType = true; - let paramType = this.tsTypeChecker.getTypeAtLocation(param); - let paramTypeNode = this.tsTypeChecker.typeToTypeNode(paramType, param, ts.NodeBuilderFlags.None); - if (!paramType || this.tsUtils.isUnsupportedType(paramType) || !paramTypeNode) { - autofixable = false; - continue; - } - if (isFuncExpr) { - let newParam = Autofixer.fixParamWithoutType(param, paramTypeNode, true) as ts.ParameterDeclaration; - newParams[newParams.length-1] = newParam; - } else if (this.autofixesInfo.shouldAutofix(signDecl, FaultID.ArrowFunctionWithOmittedTypes)) { - if (!autofix) autofix = []; - autofix.push(Autofixer.fixParamWithoutType(param, paramTypeNode) as Autofix); - } - } - // Don't report here if in function expression context. - // See handleFunctionExpression for details. - if (hasOmittedType && !isFuncExpr) { - this.incrementCounters(signDecl, FaultID.ArrowFunctionWithOmittedTypes, autofixable, autofix); - } - return isFuncExpr && autofixable ? ts.factory.createNodeArray(newParams) : undefined; - } - private handleClassExpression(node: ts.Node) { let tsClassExpr = node as ts.ClassExpression; this.incrementCounters(node, FaultID.ClassExpression); diff --git a/linter/test/arkui_decorators.ts.autofix.json b/linter/test/arkui_decorators.ts.autofix.json index e02cafd75ec16aaa2fe60291965ccd92408c1afd..ce00ce37ab31381eb2dd67194f5290d2037fed6f 100644 --- a/linter/test/arkui_decorators.ts.autofix.json +++ b/linter/test/arkui_decorators.ts.autofix.json @@ -32,12 +32,6 @@ "problem": "IntersectionType", "autofixable": false }, - { - "line": 22, - "column": 32, - "problem": "ArrowFunctionWithOmittedTypes", - "autofixable": false - }, { "line": 22, "column": 33, @@ -50,12 +44,6 @@ "problem": "AnyType", "autofixable": false }, - { - "line": 24, - "column": 43, - "problem": "ArrowFunctionWithOmittedTypes", - "autofixable": false - }, { "line": 24, "column": 44, @@ -68,12 +56,6 @@ "problem": "AnyType", "autofixable": false }, - { - "line": 29, - "column": 31, - "problem": "ArrowFunctionWithOmittedTypes", - "autofixable": false - }, { "line": 29, "column": 32, @@ -86,12 +68,6 @@ "problem": "AnyType", "autofixable": false }, - { - "line": 38, - "column": 39, - "problem": "ArrowFunctionWithOmittedTypes", - "autofixable": false - }, { "line": 38, "column": 40, @@ -104,12 +80,6 @@ "problem": "AnyType", "autofixable": false }, - { - "line": 39, - "column": 62, - "problem": "ArrowFunctionWithOmittedTypes", - "autofixable": false - }, { "line": 39, "column": 63, diff --git a/linter/test/arkui_decorators.ts.strict.json b/linter/test/arkui_decorators.ts.strict.json index 2c1b9c82e5ee75d11ea1e91bd3e2535cc448eeae..47743d022401f8733f284caf86279424c98e8be6 100644 --- a/linter/test/arkui_decorators.ts.strict.json +++ b/linter/test/arkui_decorators.ts.strict.json @@ -29,11 +29,6 @@ "column": 30, "problem": "IntersectionType" }, - { - "line": 22, - "column": 32, - "problem": "ArrowFunctionWithOmittedTypes" - }, { "line": 22, "column": 33, @@ -44,11 +39,6 @@ "column": 36, "problem": "AnyType" }, - { - "line": 24, - "column": 43, - "problem": "ArrowFunctionWithOmittedTypes" - }, { "line": 24, "column": 44, @@ -59,11 +49,6 @@ "column": 47, "problem": "AnyType" }, - { - "line": 29, - "column": 31, - "problem": "ArrowFunctionWithOmittedTypes" - }, { "line": 29, "column": 32, @@ -74,11 +59,6 @@ "column": 35, "problem": "AnyType" }, - { - "line": 38, - "column": 39, - "problem": "ArrowFunctionWithOmittedTypes" - }, { "line": 38, "column": 40, @@ -89,11 +69,6 @@ "column": 43, "problem": "AnyType" }, - { - "line": 39, - "column": 62, - "problem": "ArrowFunctionWithOmittedTypes" - }, { "line": 39, "column": 63, diff --git a/linter/test/functions.ts.autofix.json b/linter/test/functions.ts.autofix.json index c9dc613ccd57ce179451cd29fbb96817806c59c0..b2f9e5af665651b562991fd259dceeb3f7e9f178 100755 --- a/linter/test/functions.ts.autofix.json +++ b/linter/test/functions.ts.autofix.json @@ -61,13 +61,14 @@ "line": 49, "column": 20, "problem": "FunctionExpression", - "autofixable": false - }, - { - "line": 49, - "column": 20, - "problem": "ArrowFunctionWithOmittedTypes", - "autofixable": false + "autofixable": true, + "autofix": [ + { + "start": 1258, + "end": 1313, + "replacementText": "(x: number, y): number => {\r\n return x * y;\r\n}" + } + ] }, { "line": 49, @@ -155,7 +156,7 @@ { "start": 1762, "end": 1798, - "replacementText": "(e: number) => {\r\n return e * 2;\r\n}" + "replacementText": "(e) => {\r\n return e * 2;\r\n}" } ] }, @@ -168,7 +169,7 @@ { "start": 1829, "end": 1871, - "replacementText": "(x: number) => {\r\n return x % 2 === 0;\r\n}" + "replacementText": "(x) => {\r\n return x % 2 === 0;\r\n}" } ] }, @@ -184,49 +185,18 @@ "problem": "LambdaWithTypeParameters", "autofixable": false }, - { - "line": 93, - "column": 18, - "problem": "ArrowFunctionWithOmittedTypes", - "autofixable": false - }, { "line": 93, "column": 19, "problem": "AnyType", "autofixable": false }, - { - "line": 95, - "column": 16, - "problem": "ArrowFunctionWithOmittedTypes", - "autofixable": false - }, { "line": 95, "column": 17, "problem": "AnyType", "autofixable": false }, - { - "line": 96, - "column": 42, - "problem": "ArrowFunctionWithOmittedTypes", - "autofixable": true, - "autofix": [ - { - "start": 2233, - "end": 2234, - "replacementText": "x: number" - } - ] - }, - { - "line": 98, - "column": 15, - "problem": "ArrowFunctionWithOmittedTypes", - "autofixable": false - }, { "line": 98, "column": 27, diff --git a/linter/test/functions.ts.strict.json b/linter/test/functions.ts.strict.json index 67f1ad7a42ab414c2a265d5b34d80c80d0102cc1..641959895c092fe40c484090323ff420f3989fcf 100644 --- a/linter/test/functions.ts.strict.json +++ b/linter/test/functions.ts.strict.json @@ -49,11 +49,6 @@ "column": 20, "problem": "FunctionExpression" }, - { - "line": 49, - "column": 20, - "problem": "ArrowFunctionWithOmittedTypes" - }, { "line": 49, "column": 41, @@ -109,36 +104,16 @@ "column": 19, "problem": "LambdaWithTypeParameters" }, - { - "line": 93, - "column": 18, - "problem": "ArrowFunctionWithOmittedTypes" - }, { "line": 93, "column": 19, "problem": "AnyType" }, - { - "line": 95, - "column": 16, - "problem": "ArrowFunctionWithOmittedTypes" - }, { "line": 95, "column": 17, "problem": "AnyType" }, - { - "line": 96, - "column": 42, - "problem": "ArrowFunctionWithOmittedTypes" - }, - { - "line": 98, - "column": 15, - "problem": "ArrowFunctionWithOmittedTypes" - }, { "line": 98, "column": 27, diff --git a/linter/test/inferred_type.ts.strict.json b/linter/test/inferred_type.ts.strict.json index 45bfefa9e2809f83147927081f102d6f838a6222..928645dd6387d5ad8bbdd821759fc7cc650f9622 100644 --- a/linter/test/inferred_type.ts.strict.json +++ b/linter/test/inferred_type.ts.strict.json @@ -39,11 +39,6 @@ "column": 14, "problem": "AnyType" }, - { - "line": 28, - "column": 11, - "problem": "ArrowFunctionWithOmittedTypes" - }, { "line": 28, "column": 23, diff --git a/linter/test/prototype_assignment.ts.autofix.json b/linter/test/prototype_assignment.ts.autofix.json index 5eec59da4cbdffd1b54450c344e83ffb2a7e1eea..ca852403d4c95705103d29f4f68ede38571a1070 100755 --- a/linter/test/prototype_assignment.ts.autofix.json +++ b/linter/test/prototype_assignment.ts.autofix.json @@ -26,12 +26,6 @@ "problem": "FunctionExpression", "autofixable": false }, - { - "line": 17, - "column": 20, - "problem": "ArrowFunctionWithOmittedTypes", - "autofixable": false - }, { "line": 17, "column": 20, @@ -68,12 +62,6 @@ "problem": "FunctionExpression", "autofixable": false }, - { - "line": 27, - "column": 26, - "problem": "ArrowFunctionWithOmittedTypes", - "autofixable": false - }, { "line": 27, "column": 26, diff --git a/linter/test/prototype_assignment.ts.strict.json b/linter/test/prototype_assignment.ts.strict.json index afe808d0fad4dc9dcf492bcbee823c31fdfbf2ff..52a5b06faa1b9f8312025a74df49a3619f36100b 100644 --- a/linter/test/prototype_assignment.ts.strict.json +++ b/linter/test/prototype_assignment.ts.strict.json @@ -24,11 +24,6 @@ "column": 20, "problem": "FunctionExpression" }, - { - "line": 17, - "column": 20, - "problem": "ArrowFunctionWithOmittedTypes" - }, { "line": 17, "column": 20, @@ -59,11 +54,6 @@ "column": 26, "problem": "FunctionExpression" }, - { - "line": 27, - "column": 26, - "problem": "ArrowFunctionWithOmittedTypes" - }, { "line": 27, "column": 26, diff --git a/linter/test/types.ts.autofix.json b/linter/test/types.ts.autofix.json index 4b172f0527388d59ad15479005b7453f4e584546..df792c988e21215de377bc415603a123243d8eee 100644 --- a/linter/test/types.ts.autofix.json +++ b/linter/test/types.ts.autofix.json @@ -340,19 +340,6 @@ "problem": "LocalFunction", "autofixable": false }, - { - "line": 139, - "column": 22, - "problem": "ArrowFunctionWithOmittedTypes", - "autofixable": true, - "autofix": [ - { - "start": 3168, - "end": 3169, - "replacementText": "x: T" - } - ] - }, { "line": 157, "column": 5, diff --git a/linter/test/types.ts.strict.json b/linter/test/types.ts.strict.json index c377289332c0177b808859722687e6b2c89cc186..ef1caa5f55839ae87bf81b66102a94e277c6af6c 100644 --- a/linter/test/types.ts.strict.json +++ b/linter/test/types.ts.strict.json @@ -239,11 +239,6 @@ "column": 3, "problem": "LocalFunction" }, - { - "line": 139, - "column": 22, - "problem": "ArrowFunctionWithOmittedTypes" - }, { "line": 157, "column": 5,