Fix: add Literal type to visitorKeys (babel/babel-eslint#562)

* Fix: add Literal type to visitorKeys
* Fix: use ./visitor-keys
This commit is contained in:
Toru Nagashima 2017-12-26 10:50:13 +09:00
parent 3cb154df82
commit 624a425f7d
2 changed files with 2 additions and 2 deletions

View File

@ -1,13 +1,12 @@
"use strict"; "use strict";
const t = require("@babel/types"); const visitorKeys = require("./visitor-keys");
const analyzeScope = require("./analyze-scope"); const analyzeScope = require("./analyze-scope");
const parse = require("./parse"); const parse = require("./parse");
module.exports = function(code, options) { module.exports = function(code, options) {
const ast = parse(code, options); const ast = parse(code, options);
const scopeManager = analyzeScope(ast, options); const scopeManager = analyzeScope(ast, options);
const visitorKeys = t.VISITOR_KEYS;
return { ast, scopeManager, visitorKeys }; return { ast, scopeManager, visitorKeys };
}; };

View File

@ -5,6 +5,7 @@ const ESLINT_VISITOR_KEYS = require("eslint-visitor-keys").KEYS;
module.exports = Object.assign( module.exports = Object.assign(
{ {
Literal: ESLINT_VISITOR_KEYS.Literal,
MethodDefinition: ["decorators"].concat( MethodDefinition: ["decorators"].concat(
ESLINT_VISITOR_KEYS.MethodDefinition ESLINT_VISITOR_KEYS.MethodDefinition
), ),