Skip to content

[Tests] Need improve custom rule for allowing skip return type declaration for callbacks #819

@MaxGraey

Description

@MaxGraey

Will be great write this for internal tests:

var result = source.filter(value => value > 2); // linter with custom rule not happy currently

instead:

var result = source.filter((value: i32): bool => value > 2);

Code part in "lib/lint/src/rules/asTypeRule.ts" which should be changed:

...
  visitArrowFunction(node: ts.ArrowFunction) {
    this.checkFunctionReturnType(node);
    super.visitArrowFunction(node);
  }
...

But still guard for return type for rest cases

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions