quick-lint-js

Find bugs in JavaScript programs.

E0218: TypeScript interface methods cannot be marked as a generator

* on a method allows using the yield keyword in the body of the method. TypeScript interface methods do not have bodies. Therefore, * does not make sense on TypeScript interface methods, and it is a syntax error to write it:

interface RandomSource {
  *makeRandomNumbers(): Generator<number>;
}

To fix this error, remove the *:

interface RandomSource {
  makeRandomNumbers(): Generator<number>;
}

Documentation for other errors