Huáng Jùnliàng d7347fb8bd
eslint-parser: ES2020 features (#11815)
* chore: update espree test on nullish coalescing

* feat: add optional chaining support

* fix: adapt to estree AST shape

* chore: update lockfile

* add estree optional-chaining test fixtures

* address review comments

* chore: simplify smoke test

* export * support

Co-authored-by: Brian Ng <bng412@gmail.com>
2020-07-29 16:46:29 -04:00

19 lines
647 B
JavaScript

import { types as t } from "@babel/core";
import { KEYS as ESLINT_VISITOR_KEYS } from "eslint-visitor-keys";
/*eslint no-unused-vars: ["error", { "ignoreRestSiblings": true }]*/
const { ExportAllDeclaration, ...BABEL_VISITOR_KEYS } = t.VISITOR_KEYS;
export default Object.assign(
{
ChainExpression: ESLINT_VISITOR_KEYS.ChainExpression,
ExportAllDeclaration: ESLINT_VISITOR_KEYS.ExportAllDeclaration,
Literal: ESLINT_VISITOR_KEYS.Literal,
MethodDefinition: ["decorators"].concat(
ESLINT_VISITOR_KEYS.MethodDefinition,
),
Property: ["decorators"].concat(ESLINT_VISITOR_KEYS.Property),
},
BABEL_VISITOR_KEYS,
);