Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import defaultParserInterface from './utils/defaultESTreeParserInterface';
import pkg from 'babel-eslint/package.json';
const ID = 'babel-eslint';
export default {
...defaultParserInterface,
id: ID,
displayName: ID,
version: pkg.version,
homepage: pkg.homepage,
locationProps: new Set(['loc', 'start', 'end', 'range']),
loadParser(callback) {
require(['babel-eslint'], callback);
},
parse(parser, code) {
const opts = {
sourceType: 'module',
};
const ast = parser.parseNoPatch(code, opts);
delete ast.tokens;
return ast;
},