eslint-plugin-n 18.2.1 → 18.2.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.
@@ -59,6 +59,10 @@ function couldBeError(node) {
59
59
  return true // possibly an error object.
60
60
  case "Literal":
61
61
  return node.value == null
62
+ case "ArrayExpression":
63
+ case "ObjectExpression":
64
+ case "TemplateLiteral":
65
+ return false
62
66
  case "AssignmentExpression":
63
67
  return couldBeError(node.right)
64
68
 
@@ -177,14 +177,14 @@ export class ImportTarget {
177
177
  return "data"
178
178
  }
179
179
 
180
- if (/^(@[\w~-][\w.~-]*\/)?[\w~-][\w.~-]*/.test(this.name)) {
181
- return "npm"
182
- }
183
-
184
180
  if (/^https?:\/\//.test(this.name)) {
185
181
  return "http"
186
182
  }
187
183
 
184
+ if (/^(@[\w~-][\w.~-]*\/)?[\w~-][\w.~-]*/.test(this.name)) {
185
+ return "npm"
186
+ }
187
+
188
188
  return "unknown"
189
189
  }
190
190
 
@@ -306,7 +306,10 @@ export class ImportTarget {
306
306
  * @returns {string | null} The resolved path.
307
307
  */
308
308
  getFilePath() {
309
- if (this.moduleType === "data" && this.moduleStyle === "import") {
309
+ if (
310
+ (this.moduleType === "data" || this.moduleType === "http") &&
311
+ this.moduleStyle === "import"
312
+ ) {
310
313
  return this.name
311
314
  }
312
315
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-n",
3
- "version": "18.2.1",
3
+ "version": "18.2.2",
4
4
  "description": "Additional ESLint's rules for Node.js",
5
5
  "engines": {
6
6
  "node": "^20.19.0 || ^22.13.0 || >=24"