Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Description
ESTree just merged the representation for optional chaining.
estree/estree#204
They chose a different representation to babel's representation, which we went with originally (as it was the only representation in the ecosystem).
We now need to update our parser to match this representation.
interfaceChainExpression<:Expression{type:"ChainExpression"expression:ChainElement}interfaceChainElement<:Node{optional:boolean}extendinterfaceCallExpression<:ChainElement{}extendinterfaceMemberExpression<:ChainElement{}
In terms of timelines, we need to track ESLint here, as they will be moving to implement this as well. With it, they will update their lint rules to support it.
- Acorn:add Optional Chaining acornjs/acorn#891
- Espree:Update: support optional chaining eslint/js#446
- ESLint:
This is ofc a breaking change in the AST structure, and will unfortunately be a relatively painful one for consumers of our plugins.
I don't see this as beingtoo painful, however. There will be some new false-negatives in the ecosystem due to theChainExpression
node, but because everything is now just aCall/MemberExpression
, most of the plugins should "just work".
This is required to support ESLint 7.5.0, which added support to rules for optional chaining.
https://eslint.org/blog/2020/07/eslint-v7.5.0-released