Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

[False positive] no-async-without-await and abstract methods #4773

Closed
feimosi opened this issue Jun 24, 2019 · 1 comment · Fixed by #4782
Closed

[False positive] no-async-without-await and abstract methods #4773

feimosi opened this issue Jun 24, 2019 · 1 comment · Fixed by #4782

Comments

@feimosi
Copy link

feimosi commented Jun 24, 2019

Bug Report

  • TSLint version: tslint@5.18.0
  • TypeScript version: typescript@3.5.2
  • Running TSLint via: CLI and VSCode

Reproduction using TSLint Playground

I couldn't reproduce it in the Playground, however even invalid code is not detected by this rule what apparently means the rule is not present there at all (?)
TSLint Playground

TypeScript code being linted

export abstract class SomeService<T> {
  protected readonly abstract repository: Repository<T>;

  protected abstract async falsePositive(id: number): Promise<T | null>;

  public async truePositive() { /* */ }
}

with tslint.json configuration:

{
  "extends": [
    "tslint:all",
    "tslint-config-standard",
    "tslint-config-airbnb-base"
  ],
  "rules": {
    "no-async-without-await": true,
	"...": "..."
  }
}

Actual behavior

Treats abstract methods as an error

Expected behavior

Should ignore abstract methods because they don't have a body

@danielrentz
Copy link

Same for overloaded functions/methods, as described in #4776

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants