eslint-plugin-n 17.13.0 → 17.13.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/lib/index.js +1 -5
- package/lib/util/import-target.js +11 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -270,6 +270,13 @@ module.exports = class ImportTarget {
|
|
|
270
270
|
this.resolveError = error.message
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
+
/**
|
|
274
|
+
* @returns {void}
|
|
275
|
+
*/
|
|
276
|
+
resetResolutionError() {
|
|
277
|
+
this.resolveError = null
|
|
278
|
+
}
|
|
279
|
+
|
|
273
280
|
/**
|
|
274
281
|
* Resolve the given id to file paths.
|
|
275
282
|
* @returns {string | null} The resolved path.
|
|
@@ -324,7 +331,10 @@ module.exports = class ImportTarget {
|
|
|
324
331
|
|
|
325
332
|
try {
|
|
326
333
|
const resolved = requireResolve(baseDir, this.name)
|
|
327
|
-
if (typeof resolved === "string")
|
|
334
|
+
if (typeof resolved === "string") {
|
|
335
|
+
this.resetResolutionError()
|
|
336
|
+
return resolved
|
|
337
|
+
}
|
|
328
338
|
} catch (error) {
|
|
329
339
|
this.handleResolutionError(error)
|
|
330
340
|
}
|