eslint-module-utils
Advanced tools
Comparing version 2.5.1 to 2.5.2
@@ -8,3 +8,11 @@ # Change Log | ||
## v2.5.2 - 2020-01-12 | ||
### Fixed | ||
- Makes the loader resolution more tolerant ([#1606], thanks [@arcanis]) | ||
- Use `createRequire` instead of `createRequireFromPath` if available ([#1602], thanks [@iamnapo]) | ||
## v2.5.1 - 2020-01-11 | ||
### Fixed | ||
- Uses createRequireFromPath to resolve loaders ([#1591], thanks [@arcanis]) | ||
@@ -66,3 +74,4 @@ - report the error stack on a resolution error ([#599], thanks [@sompylasar]) | ||
[#1606]: https://github.com/benmosher/eslint-plugin-import/pull/1606 | ||
[#1602]: https://github.com/benmosher/eslint-plugin-import/pull/1602 | ||
[#1591]: https://github.com/benmosher/eslint-plugin-import/pull/1591 | ||
@@ -89,1 +98,2 @@ [#1551]: https://github.com/benmosher/eslint-plugin-import/pull/1551 | ||
[@sompylasar]: https://github.com/sompylasar | ||
[@iamnapo]: https://github.com/iamnapo |
{ | ||
"name": "eslint-module-utils", | ||
"version": "2.5.1", | ||
"version": "2.5.2", | ||
"description": "Core utilities to support eslint-plugin-import and other module-related plugins.", | ||
@@ -5,0 +5,0 @@ "engines": { |
@@ -21,3 +21,4 @@ 'use strict' | ||
// Polyfill Node's `Module.createRequireFromPath` if not present (added in Node v10.12.0) | ||
const createRequireFromPath = Module.createRequireFromPath || function (filename) { | ||
// Use `Module.createRequire` if available (added in Node v12.2.0) | ||
const createRequire = Module.createRequire || Module.createRequireFromPath || function (filename) { | ||
const mod = new Module(filename, null) | ||
@@ -37,3 +38,7 @@ mod.filename = filename | ||
if (sourceFile != null) { | ||
resolved = createRequireFromPath(sourceFile).resolve(target) | ||
try { | ||
resolved = createRequire(path.resolve(sourceFile)).resolve(target) | ||
} catch (e) { | ||
resolved = require.resolve(target) | ||
} | ||
} else { | ||
@@ -40,0 +45,0 @@ resolved = require.resolve(target) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24598
577
8