* Prevent parseForESLint() behavior from changing after parse() is called (fixes https://github.com/babel/babel-eslint/issues/558, fixes https://github.com/eslint/eslint/issues/9767) * Avoid using the enhanced referencer after monkeypatching * Chore: add test for babel/babel-eslint#558 * Pass correct scope analyzer options * fix escope patch and improve tests * remove process.exit(1)
14 lines
351 B
JavaScript
14 lines
351 B
JavaScript
"use strict";
|
|
|
|
const t = require("@babel/types");
|
|
const analyzeScope = require("./analyze-scope");
|
|
const parse = require("./parse");
|
|
|
|
module.exports = function(code, options) {
|
|
const ast = parse(code, options);
|
|
const scopeManager = analyzeScope(ast, options);
|
|
const visitorKeys = t.VISITOR_KEYS;
|
|
|
|
return { ast, scopeManager, visitorKeys };
|
|
};
|