eslint-import-resolver-kjlnode
Advanced tools
Comparing version 0.0.3 to 0.0.4
16
index.js
@@ -21,4 +21,5 @@ const resolve = require('resolve') | ||
if (startsWith(source, '@') && config.root && isObject(config.alias)) { | ||
const path = handleAlias(source, config) | ||
const path = handleAlias(source, opts(file, config)) | ||
if (path) { | ||
console.log(path) | ||
return { found: true, path } | ||
@@ -51,3 +52,3 @@ } | ||
const ext = extensions[j] | ||
const p = `${tmpPath}${ext}` | ||
let p = path.join(tmpPath, `index${ext}`) | ||
if (fs.existsSync(p)) { | ||
@@ -57,2 +58,7 @@ log(`get alias path: ${p}`) | ||
} | ||
p = `${tmpPath}${ext}` | ||
if (fs.existsSync(p)) { | ||
log(`get alias path: ${p}`) | ||
return p | ||
} | ||
} | ||
@@ -64,3 +70,5 @@ } | ||
function opts(file, config) { | ||
return Object.assign({ | ||
let cache = null | ||
if (!cache) { | ||
cache = Object.assign({ | ||
// more closely matches Node (#333) | ||
@@ -75,2 +83,4 @@ extensions: ['.js', '.json'], | ||
}) | ||
} | ||
return cache | ||
} | ||
@@ -77,0 +87,0 @@ |
{ | ||
"name": "eslint-import-resolver-kjlnode", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "a fork of eslint-import-resolver-node", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
2913
80
0