Problem/Motivation
In the process of fixing some javascript issues for Olivero, we tried implementing javascript's new optional chaining operator (?.) to reduce code complexity and increase legibility. This operator is valid and compiles properly using core's build:js command, but lint:core-js-passing still fails on it because eslint isn't parsing that operator properly.
Steps to reproduce
The easiest way to reproduce this at the moment will be to apply this patch to core from Olivero, and then to run `yarn build:js` (succeeds) and `yarn lint:core-js-passing` (fails).
Proposed resolution
Core is using eslint v7.10.0, and as of v7.5.0, eslint has supported optional chaining by specifying which version of ECMAScript it should be parsing as.
I propose adding the below code to core's `.eslintrc` file, per the suggestion of the v7.5.0 release announcement:
"parserOptions": {
"ecmaVersion": 2020
},
Doing this locally immediately yields a successful run of `yarn lint:core-js-passing`.
Comments