eslint-import-resolver-node 0.2.1 → 0.3.1
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.
- package/CHANGELOG.md +37 -0
- package/index.js +15 -4
- package/package.json +7 -8
- package/.npmignore +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,43 @@ 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
|
+
## Unreleased
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## v0.3.1 - 2017-06-23
|
|
10
|
+
### Changed
|
|
11
|
+
- bumped `debug` dep to match other packages
|
|
12
|
+
|
|
13
|
+
## v0.3.0 - 2016-12-15
|
|
14
|
+
### Changed
|
|
15
|
+
- bumped `resolve` to fix issues with Node builtins (thanks [@SkeLLLa] and [@ljharb])
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
- use `files` in `package.json` to ship only `index.js` ([#531], thanks for noticing [@lukeapage])
|
|
19
|
+
|
|
20
|
+
## v0.2.3 - 2016-08-20
|
|
21
|
+
### Added
|
|
22
|
+
- debug logging (use `DEBUG=eslint-plugin-import:resolver:node eslint [...]`)
|
|
23
|
+
|
|
24
|
+
## v0.2.2 - 2016-07-14
|
|
25
|
+
### Fixed
|
|
26
|
+
- Node resolver no longer declares the import plugin as a `peerDependency`. See [#437]
|
|
27
|
+
for a well-articulated and thoughtful expression of why this doesn't make sense.
|
|
28
|
+
Thanks [@jasonkarns] for the issue and the PR to fix it ([#438]).
|
|
29
|
+
|
|
30
|
+
Also, apologies to the others who expressed this before, but I never understood
|
|
31
|
+
what the problem was.😅
|
|
32
|
+
|
|
6
33
|
## v0.2.1
|
|
7
34
|
### Fixed
|
|
8
35
|
- find files with `.json` extensions (#333, thanks for noticing @jfmengels)
|
|
36
|
+
|
|
37
|
+
[#438]: https://github.com/benmosher/eslint-plugin-import/pull/438
|
|
38
|
+
|
|
39
|
+
[#531]: https://github.com/benmosher/eslint-plugin-import/issues/531
|
|
40
|
+
[#437]: https://github.com/benmosher/eslint-plugin-import/issues/437
|
|
41
|
+
|
|
42
|
+
[@jasonkarns]: https://github.com/jasonkarns
|
|
43
|
+
[@lukeapage]: https://github.com/lukeapage
|
|
44
|
+
[@SkeLLLa]: https://github.com/SkeLLLa
|
|
45
|
+
[@ljharb]: https://github.com/ljharb
|
package/index.js
CHANGED
|
@@ -1,20 +1,31 @@
|
|
|
1
1
|
var resolve = require('resolve')
|
|
2
2
|
, path = require('path')
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
var log = require('debug')('eslint-plugin-import:resolver:node')
|
|
4
5
|
|
|
5
6
|
exports.interfaceVersion = 2
|
|
6
7
|
|
|
7
8
|
exports.resolve = function (source, file, config) {
|
|
8
|
-
|
|
9
|
+
log('Resolving:', source, 'from:', file)
|
|
10
|
+
var resolvedPath
|
|
11
|
+
|
|
12
|
+
if (resolve.isCore(source)) {
|
|
13
|
+
log('resolved to core')
|
|
14
|
+
return { found: true, path: null }
|
|
15
|
+
}
|
|
16
|
+
|
|
9
17
|
try {
|
|
10
|
-
|
|
18
|
+
resolvedPath = resolve.sync(source, opts(file, config))
|
|
19
|
+
log('Resolved to:', resolvedPath)
|
|
20
|
+
return { found: true, path: resolvedPath }
|
|
11
21
|
} catch (err) {
|
|
22
|
+
log('resolve threw error:', err)
|
|
12
23
|
return { found: false }
|
|
13
24
|
}
|
|
14
25
|
}
|
|
15
26
|
|
|
16
27
|
function opts(file, config) {
|
|
17
|
-
return assign({
|
|
28
|
+
return Object.assign({
|
|
18
29
|
// more closely matches Node (#333)
|
|
19
30
|
extensions: ['.js', '.json'],
|
|
20
31
|
},
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-import-resolver-node",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Node default behavior import resolution plugin for eslint-plugin-import.",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"files": ["index.js"],
|
|
6
7
|
"scripts": {
|
|
7
|
-
"test": "mocha"
|
|
8
|
+
"test": "nyc mocha"
|
|
8
9
|
},
|
|
9
10
|
"repository": {
|
|
10
11
|
"type": "git",
|
|
@@ -24,14 +25,12 @@
|
|
|
24
25
|
},
|
|
25
26
|
"homepage": "https://github.com/benmosher/eslint-plugin-import",
|
|
26
27
|
"dependencies": {
|
|
27
|
-
"
|
|
28
|
-
"resolve": "^1.
|
|
29
|
-
},
|
|
30
|
-
"peerDependencies": {
|
|
31
|
-
"eslint-plugin-import": ">=1.4.0"
|
|
28
|
+
"debug": "^2.6.8",
|
|
29
|
+
"resolve": "^1.2.0"
|
|
32
30
|
},
|
|
33
31
|
"devDependencies": {
|
|
34
32
|
"chai": "^3.4.1",
|
|
35
|
-
"mocha": "^2.3.4"
|
|
33
|
+
"mocha": "^2.3.4",
|
|
34
|
+
"nyc": "^7.0.0"
|
|
36
35
|
}
|
|
37
36
|
}
|
package/.npmignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
test/
|