eslint-import-resolver-node
Advanced tools
Comparing version 0.1.1 to 0.2.0
16
index.js
@@ -5,13 +5,19 @@ var resolve = require('resolve') | ||
exports.resolveImport = function resolveImport(source, file, config) { | ||
if (resolve.isCore(source)) return null | ||
exports.interfaceVersion = 2 | ||
return resolve.sync(source, opts(path.dirname(file), config)) | ||
exports.resolve = function (source, file, config) { | ||
if (resolve.isCore(source)) return { found: true, path: null } | ||
try { | ||
return { found: true, path: resolve.sync(source, opts(file, config)) } | ||
} catch (err) { | ||
return { found: false } | ||
} | ||
} | ||
function opts(basedir, config) { | ||
function opts(file, config) { | ||
return assign({}, | ||
config, | ||
{ | ||
basedir: basedir, | ||
// path.resolve will handle paths relative to CWD | ||
basedir: path.dirname(path.resolve(file)), | ||
packageFilter: packageFilter, | ||
@@ -18,0 +24,0 @@ |
{ | ||
"name": "eslint-import-resolver-node", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "Node default behavior import resolution plugin for eslint-plugin-import.", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "mocha" | ||
}, | ||
@@ -29,3 +29,10 @@ "repository": { | ||
"resolve": "^1.1.6" | ||
}, | ||
"peerDependencies": { | ||
"eslint-plugin-import": ">=1.4.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "^3.4.1", | ||
"mocha": "^2.3.4" | ||
} | ||
} |
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
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
2936
4
27
1
3
2