ESLint doesn't allow logical assignment operators

Logical assignment operators are unsupported by ESLint, but work when the site is run.

The operators:

  • ??=
  • ||=
  • &&=

I have tried editing the .eslintrc.json file, but the ESLint option is unavailable.

Thanks!

2 Likes

I have noticed a few more missing things:

  • Private class variables/functions along with static variables:
class example {
  static staticVariable = 5;

  constructor() {
    this.#privateVariable = 0;
  }
}
  • If you make a file with a .js extension (test.js), then rename it to have a .html extension (test.html) it will still keep the .js extension colour.
  • Making a file with errors, then renaming it to having an extension without linting (.txt, .md) will still keep the errors.

Possible Reason

The initial problem and the first one on the above list may have one simple reason: The JSLint version is too old.


Welp, that’s all I have for now, have a good rest of your day!