quick-lint-js

Find bugs in JavaScript programs.

E0078: missing expression between parentheses

Parentheses (( and )) serve three purposes in JavaScript:

It is a syntax error to write ( immediately followed by ) (with nothing between) when grouping in expressions:

function fma(a, b, c) {
  return () + c;
}

const config = ();

takeCookiesFromCookieJar()
  .then(cookies => eatCookies()
    .then(()));

To fix this error, write an expression between the parentheses:

function fma(a, b, c) {
  return (a*b) + c;
}

Alternatively, put the name of a function before the parentheses to call a function with no arguments:

const config = loadConfig();

Alternatively, write the rest of your arrow function:

takeCookiesFromCookieJar()
  .then(cookies => eatCookies()
    .then(() => putAwayCookieJar()));

Introduced in quick-lint-js version 0.2.0.

Documentation for other errors