How to use the eslint-scope/lib/scope.Scope function in eslint-scope

To help you get started, we’ve selected a few eslint-scope 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 eslint / typescript-eslint-parser / analyze-scope.js View on Github external
"use strict";

/* eslint-disable new-cap, no-underscore-dangle */

const escope = require("eslint-scope");
const { Definition, ParameterDefinition } = require("eslint-scope/lib/definition");
const OriginalPatternVisitor = require("eslint-scope/lib/pattern-visitor");
const Reference = require("eslint-scope/lib/reference");
const OriginalReferencer = require("eslint-scope/lib/referencer");
const Scope = require("eslint-scope/lib/scope").Scope;
const fallback = require("eslint-visitor-keys").getKeys;
const lodash = require("lodash");
const childVisitorKeys = require("./visitor-keys");

/**
 * Get `.range[0]` of a given object.
 * @param {{range: number[]}} x The object to get.
 * @returns {number} The gotten value.
 */
function byRange0(x) {
    return x.range[0];
}

/**
 * Check the TSModuleDeclaration node is `declare global {}` or not.
 * @param {TSModuleDeclaration} node The TSModuleDeclaration node to check.
github sikidamjanovic / cowrite / node_modules / @typescript-eslint / experimental-utils / dist / ts-eslint-scope / Scope.js View on Github external
"use strict";
/* eslint-disable @typescript-eslint/no-empty-interface, @typescript-eslint/no-explicit-any */
Object.defineProperty(exports, "__esModule", { value: true });
const scope_1 = require("eslint-scope/lib/scope");
const Scope = scope_1.Scope;
exports.Scope = Scope;
const GlobalScope = scope_1.GlobalScope;
exports.GlobalScope = GlobalScope;
const ModuleScope = scope_1.ModuleScope;
exports.ModuleScope = ModuleScope;
const FunctionExpressionNameScope = scope_1.FunctionExpressionNameScope;
exports.FunctionExpressionNameScope = FunctionExpressionNameScope;
const CatchScope = scope_1.CatchScope;
exports.CatchScope = CatchScope;
const WithScope = scope_1.WithScope;
exports.WithScope = WithScope;
const BlockScope = scope_1.BlockScope;
exports.BlockScope = BlockScope;
const SwitchScope = scope_1.SwitchScope;
exports.SwitchScope = SwitchScope;
const FunctionScope = scope_1.FunctionScope;