quick-lint-js

Find bugs in JavaScript programs.

E0247: TypeScript 'implements' is not allowed in JavaScript

TypeScript interfaces are not supported in JavaScript. Therefore, using implements on a JavaScript class is a syntax error:

import stream from "node:stream";
class MyStream
    extends stream.Stream
    implements stream.ReadableStream {
  // ...
}

class DownloadError implements Error {
  constructor(url) {
    super(`Downloading ${url} failed`);
  }
}

To fix this error, remove the implements clause:

import stream from "node:stream";
class MyStream extends stream.Stream {
  // ...
}

Alternatively, replace implements with extends to inherit a class:

class DownloadError extends Error {
  constructor(url) {
    super(`Downloading ${url} failed`);
  }
}

Documentation for other errors