This repository was archived by the owner on Aug 18, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +31
-6
lines changed Expand file tree Collapse file tree 4 files changed +31
-6
lines changed Original file line number Diff line number Diff line change 1
1
"use strict" ;
2
2
3
3
const t = require ( "@babel/types" ) ;
4
- const escope = require ( "eslint-scope" ) ;
5
- const Definition = require ( "eslint-scope/lib/definition" ) . Definition ;
6
- const OriginalPatternVisitor = require ( "eslint-scope/lib/pattern-visitor" ) ;
7
- const OriginalReferencer = require ( "eslint-scope/lib/referencer" ) ;
4
+ const requireFromESLint = require ( "./require-from-eslint" ) ;
5
+
6
+ const escope = requireFromESLint ( "eslint-scope" ) ;
7
+ const Definition = requireFromESLint ( "eslint-scope/lib/definition" ) . Definition ;
8
+ const OriginalPatternVisitor = requireFromESLint (
9
+ "eslint-scope/lib/pattern-visitor"
10
+ ) ;
11
+ const OriginalReferencer = requireFromESLint ( "eslint-scope/lib/referencer" ) ;
8
12
const fallback = require ( "eslint-visitor-keys" ) . getKeys ;
9
13
const childVisitorKeys = require ( "./visitor-keys" ) ;
10
14
Original file line number Diff line number Diff line change
1
+ "use strict" ;
2
+
3
+ const resolve = require ( "resolve" ) ;
4
+ const eslintBase = require . resolve ( "eslint" ) ;
5
+
6
+ module . exports = function requireFromESLint ( id ) {
7
+ const path = resolve . sync ( id , { basedir : eslintBase } ) ;
8
+ return require ( path ) ;
9
+ } ;
Original file line number Diff line number Diff line change 15
15
"@babel/parser" : " ^7.0.0" ,
16
16
"@babel/traverse" : " ^7.0.0" ,
17
17
"@babel/types" : " ^7.0.0" ,
18
- "eslint-scope " : " 3.7.1 " ,
19
- "eslint-visitor-keys " : " ^1.0 .0"
18
+ "eslint-visitor-keys " : " ^1.0.0 " ,
19
+ "resolve " : " ^1.12 .0"
20
20
},
21
21
"scripts" : {
22
22
"test" : " npm run lint && npm run test-only" ,
Original file line number Diff line number Diff line change @@ -1754,6 +1754,11 @@ path-parse@^1.0.5:
1754
1754
version "1.0.5"
1755
1755
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1"
1756
1756
1757
+ path-parse@^1.0.6 :
1758
+ version "1.0.6"
1759
+ resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"
1760
+ integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==
1761
+
1757
1762
path-type@^2.0.0 :
1758
1763
version "2.0.0"
1759
1764
resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73"
@@ -1894,6 +1899,13 @@ resolve-url@^0.2.1:
1894
1899
version "0.2.1"
1895
1900
resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
1896
1901
1902
+ resolve@^1.12.0 :
1903
+ version "1.12.0"
1904
+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.12.0.tgz#3fc644a35c84a48554609ff26ec52b66fa577df6"
1905
+ integrity sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==
1906
+ dependencies :
1907
+ path-parse "^1.0.6"
1908
+
1897
1909
resolve@^1.5.0 :
1898
1910
version "1.5.0"
1899
1911
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36"
You can’t perform that action at this time.
0 commit comments