eslint-import-resolver-node 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"/Users/ben/git/eslint-plugin-import/resolvers/node/index.js":{"path":"/Users/ben/git/eslint-plugin-import/resolvers/node/index.js","statementMap":{"1":{"start":{"line":1,"column":14},"end":{"line":1,"column":32}},"2":{"start":{"line":2,"column":11},"end":{"line":2,"column":26}},"3":{"start":{"line":3,"column":13},"end":{"line":3,"column":37}},"4":{"start":{"line":5,"column":10},"end":{"line":5,"column":64}},"5":{"start":{"line":7,"column":0},"end":{"line":7,"column":28}},"6":{"start":{"line":9,"column":0},"end":{"line":26,"column":1}},"7":{"start":{"line":10,"column":2},"end":{"line":10,"column":42}},"8":{"start":{"line":13,"column":2},"end":{"line":16,"column":3}},"9":{"start":{"line":14,"column":4},"end":{"line":14,"column":27}},"10":{"start":{"line":15,"column":4},"end":{"line":15,"column":38}},"11":{"start":{"line":18,"column":2},"end":{"line":25,"column":3}},"12":{"start":{"line":19,"column":4},"end":{"line":19,"column":59}},"13":{"start":{"line":20,"column":4},"end":{"line":20,"column":37}},"14":{"start":{"line":21,"column":4},"end":{"line":21,"column":46}},"15":{"start":{"line":23,"column":4},"end":{"line":23,"column":36}},"16":{"start":{"line":24,"column":4},"end":{"line":24,"column":27}},"17":{"start":{"line":29,"column":2},"end":{"line":39,"column":6}},"18":{"start":{"line":43,"column":2},"end":{"line":45,"column":3}},"19":{"start":{"line":44,"column":4},"end":{"line":44,"column":36}},"20":{"start":{"line":46,"column":2},"end":{"line":46,"column":12}}},"fnMap":{"1":{"name":"(anonymous_1)","decl":{"start":{"line":9,"column":18},"end":{"line":9,"column":19}},"loc":{"start":{"line":9,"column":50},"end":{"line":26,"column":1}}},"2":{"name":"opts","decl":{"start":{"line":28,"column":9},"end":{"line":28,"column":13}},"loc":{"start":{"line":28,"column":28},"end":{"line":40,"column":1}}},"3":{"name":"packageFilter","decl":{"start":{"line":42,"column":9},"end":{"line":42,"column":22}},"loc":{"start":{"line":42,"column":28},"end":{"line":47,"column":1}}}},"branchMap":{"1":{"loc":{"start":{"line":13,"column":2},"end":{"line":16,"column":3}},"type":"if","locations":[{"start":{"line":13,"column":30},"end":{"line":16,"column":3}},{"start":{"line":1,"column":0},"end":{"line":1,"column":0}}]},"2":{"loc":{"start":{"line":43,"column":2},"end":{"line":45,"column":3}},"type":"if","locations":[{"start":{"line":43,"column":26},"end":{"line":45,"column":3}},{"start":{"line":1,"column":0},"end":{"line":1,"column":0}}]}},"s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":3,"8":3,"9":0,"10":0,"11":3,"12":3,"13":2,"14":2,"15":1,"16":1,"17":3,"18":1,"19":0,"20":1},"f":{"1":3,"2":3,"3":1},"b":{"1":[0,3],"2":[0,1]},"hash":"6c784176dfab6e499c1d7cb9d7b3007733fcd8ca"}}
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@ All notable changes to this resolver will be documented in this file.
|
|
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
|
4
4
|
This change log adheres to standards from [Keep a CHANGELOG](http://keepachangelog.com).
|
|
5
5
|
|
|
6
|
+
## v0.2.3 - 2016-08-20
|
|
7
|
+
### Added
|
|
8
|
+
- debug logging (use `DEBUG=eslint-plugin-import:resolver:node eslint [...]`)
|
|
9
|
+
|
|
6
10
|
## v0.2.2 - 2016-07-14
|
|
7
11
|
### Fixed
|
|
8
12
|
- Node resolver no longer declares the import plugin as a `peerDependency`. See [#437]
|
package/index.js
CHANGED
|
@@ -2,13 +2,25 @@ var resolve = require('resolve')
|
|
|
2
2
|
, path = require('path')
|
|
3
3
|
, assign = require('object-assign')
|
|
4
4
|
|
|
5
|
+
var log = require('debug')('eslint-plugin-import:resolver:node')
|
|
6
|
+
|
|
5
7
|
exports.interfaceVersion = 2
|
|
6
8
|
|
|
7
9
|
exports.resolve = function (source, file, config) {
|
|
8
|
-
|
|
10
|
+
log('Resolving:', source, 'from:', file)
|
|
11
|
+
var resolvedPath
|
|
12
|
+
|
|
13
|
+
if (resolve.isCore(source)) {
|
|
14
|
+
log('resolved to core')
|
|
15
|
+
return { found: true, path: null }
|
|
16
|
+
}
|
|
17
|
+
|
|
9
18
|
try {
|
|
10
|
-
|
|
19
|
+
resolvedPath = resolve.sync(source, opts(file, config))
|
|
20
|
+
log('Resolved to:', resolvedPath)
|
|
21
|
+
return { found: true, path: resolvedPath }
|
|
11
22
|
} catch (err) {
|
|
23
|
+
log('resolve threw error:', err)
|
|
12
24
|
return { found: false }
|
|
13
25
|
}
|
|
14
26
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-import-resolver-node",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Node default behavior import resolution plugin for eslint-plugin-import.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"test": "mocha"
|
|
7
|
+
"test": "nyc mocha"
|
|
8
8
|
},
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -24,11 +24,13 @@
|
|
|
24
24
|
},
|
|
25
25
|
"homepage": "https://github.com/benmosher/eslint-plugin-import",
|
|
26
26
|
"dependencies": {
|
|
27
|
+
"debug": "^2.2.0",
|
|
27
28
|
"object-assign": "^4.0.1",
|
|
28
29
|
"resolve": "^1.1.6"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
32
|
"chai": "^3.4.1",
|
|
32
|
-
"mocha": "^2.3.4"
|
|
33
|
+
"mocha": "^2.3.4",
|
|
34
|
+
"nyc": "^7.0.0"
|
|
33
35
|
}
|
|
34
36
|
}
|