How to use the escope/lib/referencer.default function in escope

To help you get started, we’ve selected a few escope examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github karthikv / tradeship / patches / escope.js View on Github external
const referencer = require("escope/lib/referencer").default;

const { visitClass, visitProperty } = referencer.prototype;

// visit decorators on classes/properties to resolve their identifiers
referencer.prototype.visitClass = function(node) {
  visitDecorators.call(this, node);
  visitClass.call(this, node);
};

referencer.prototype.visitProperty = function(node) {
  visitDecorators.call(this, node);
  visitProperty.call(this, node);
};

function visitDecorators(node) {
  if (!node.decorators) {

escope

ECMAScript scope analyzer

BSD-2-Clause
Latest version published 2 years ago

Package Health Score

74 / 100
Full package analysis