Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React from 'react';
import defaultParserInterface from './utils/defaultESTreeParserInterface';
import pkg from 'espree/package.json';
const ID = 'espree';
export default {
...defaultParserInterface,
id: ID,
displayName: ID,
version: pkg.version,
homepage: pkg.homepage,
locationProps: new Set(['range', 'loc', 'start', 'end']),
loadParser(callback) {
require(['espree'], callback);
},
parse(espree, code, options) {
return espree.parse(code, options);
},
nodeToRange(node) {
if (typeof node.start === 'number') {
return [node.start, node.end];
}
},