eslint-import-resolver-node 0.2.2 → 0.3.2

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 CHANGED
@@ -3,6 +3,30 @@ 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
+ ## v0.3.2 - 2018-01-05
9
+ ### Added
10
+ - `.mjs` extension detected by default to support `experimental-modules` (#939)
11
+
12
+ ### Deps
13
+ - update `debug`, `resolve`
14
+
15
+ ## v0.3.1 - 2017-06-23
16
+ ### Changed
17
+ - bumped `debug` dep to match other packages
18
+
19
+ ## v0.3.0 - 2016-12-15
20
+ ### Changed
21
+ - bumped `resolve` to fix issues with Node builtins (thanks [@SkeLLLa] and [@ljharb])
22
+
23
+ ### Fixed
24
+ - use `files` in `package.json` to ship only `index.js` ([#531], thanks for noticing [@lukeapage])
25
+
26
+ ## v0.2.3 - 2016-08-20
27
+ ### Added
28
+ - debug logging (use `DEBUG=eslint-plugin-import:resolver:node eslint [...]`)
29
+
6
30
  ## v0.2.2 - 2016-07-14
7
31
  ### Fixed
8
32
  - Node resolver no longer declares the import plugin as a `peerDependency`. See [#437]
@@ -18,6 +42,11 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
18
42
 
19
43
  [#438]: https://github.com/benmosher/eslint-plugin-import/pull/438
20
44
 
45
+ [#939]: https://github.com/benmosher/eslint-plugin-import/issues/939
46
+ [#531]: https://github.com/benmosher/eslint-plugin-import/issues/531
21
47
  [#437]: https://github.com/benmosher/eslint-plugin-import/issues/437
22
48
 
23
49
  [@jasonkarns]: https://github.com/jasonkarns
50
+ [@lukeapage]: https://github.com/lukeapage
51
+ [@SkeLLLa]: https://github.com/SkeLLLa
52
+ [@ljharb]: https://github.com/ljharb
package/index.js CHANGED
@@ -1,22 +1,34 @@
1
1
  var resolve = require('resolve')
2
2
  , path = require('path')
3
- , assign = require('object-assign')
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
- if (resolve.isCore(source)) return { found: true, path: null }
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
- return { found: true, path: resolve.sync(source, opts(file, config)) }
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
- extensions: ['.js', '.json'],
30
+ // plus 'mjs' for native modules! (#939)
31
+ extensions: ['.mjs', '.js', '.json'],
20
32
  },
21
33
  config,
22
34
  {
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "eslint-import-resolver-node",
3
- "version": "0.2.2",
3
+ "version": "0.3.2",
4
4
  "description": "Node default behavior import resolution plugin for eslint-plugin-import.",
5
5
  "main": "index.js",
6
+ "files": [
7
+ "index.js"
8
+ ],
6
9
  "scripts": {
7
- "test": "mocha"
10
+ "test": "nyc mocha"
8
11
  },
9
12
  "repository": {
10
13
  "type": "git",
@@ -24,11 +27,12 @@
24
27
  },
25
28
  "homepage": "https://github.com/benmosher/eslint-plugin-import",
26
29
  "dependencies": {
27
- "object-assign": "^4.0.1",
28
- "resolve": "^1.1.6"
30
+ "debug": "^2.6.9",
31
+ "resolve": "^1.5.0"
29
32
  },
30
33
  "devDependencies": {
31
- "chai": "^3.4.1",
32
- "mocha": "^2.3.4"
34
+ "chai": "^3.5.0",
35
+ "mocha": "^3.5.3",
36
+ "nyc": "^10.3.2"
33
37
  }
34
38
  }
package/.npmignore DELETED
@@ -1 +0,0 @@
1
- test/