Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

➕ Added estraverse dependency #685

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions lib/patch-eslint-scope.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
var Module = require("module");
var path = require("path");
var t = require("@babel/types");
var estraverse = require("estraverse");

function getModules() {
try {
Expand Down Expand Up @@ -33,22 +34,18 @@ function getModules() {
referencer = eslintMod.require("escope/lib/referencer");
}

var estraverse = eslintMod.require("estraverse");

if (referencer.__esModule) referencer = referencer.default;

return {
Definition,
escope,
estraverse,
referencer,
};
}

function monkeypatch(modules) {
var Definition = modules.Definition;
var escope = modules.escope;
var estraverse = modules.estraverse;
var referencer = modules.referencer;

Object.assign(estraverse.VisitorKeys, t.VISITOR_KEYS);
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"@babel/traverse": "^7.0.0",
"@babel/types": "^7.0.0",
"eslint-scope": "3.7.1",
"eslint-visitor-keys": "^1.0.0"
"eslint-visitor-keys": "^1.0.0",
"estraverse": "^4.2.0"
},
"scripts": {
"test": "npm run lint && npm run test-only",
Expand Down