splitter ??= new graphemer_1.default(); Error while using Eslint lint fix

198 views Asked by At

I have used following command in package.json file under scripts

"lint": "eslint . -c .eslintrc.json --ext .ts", "lint:fix": "eslint . -c .eslintrc.json --ext .ts --fix"

While committing to git its giving me this error

splitter ??= new graphemer_1.default();
         ^^^

I made few changes in package json script but its giving me same error

1

There are 1 answers

0
Matthieu Riegler On

To use the Nullish coalescing assignment ??= operator, you need to set the ecmaVersion to at least 2021 or latest.

"parserOptions":
{
  "ecmaVersion": 'latest'
}