forked from babel/babel
/
visitor-keys.js
22 lines (19 loc) 路 889 Bytes
/
visitor-keys.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { types as t } from "@babel/core";
import { KEYS as ESLINT_VISITOR_KEYS } from "eslint-visitor-keys";
// AST Types that are not presented in Babel AST
export const newTypes = {
ChainExpression: ESLINT_VISITOR_KEYS.ChainExpression,
ImportExpression: ESLINT_VISITOR_KEYS.ImportExpression,
Literal: ESLINT_VISITOR_KEYS.Literal,
MethodDefinition: ["decorators"].concat(ESLINT_VISITOR_KEYS.MethodDefinition),
Property: ["decorators"].concat(ESLINT_VISITOR_KEYS.Property),
};
// AST Types that shares `"type"` property with Babel but have different shape
export const conflictTypes = {
// todo: remove this when class features are supported
ClassPrivateMethod: ["decorators"].concat(
ESLINT_VISITOR_KEYS.MethodDefinition,
),
ExportAllDeclaration: ESLINT_VISITOR_KEYS.ExportAllDeclaration,
};
export default Object.assign(newTypes, t.VISITOR_KEYS, conflictTypes);