npm-pkg-lint 3.10.1 → 3.10.3
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/dist/index.js +12 -7
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6658,6 +6658,9 @@ function parse(text, options) {
|
|
|
6658
6658
|
assertTokenType(tokenType, tt.String);
|
|
6659
6659
|
}
|
|
6660
6660
|
const token = tokenizer.token;
|
|
6661
|
+
if (json5 && tokenType === tt.Number && /[+\-0-9]/.test(text[token.loc.start.offset])) {
|
|
6662
|
+
throw new UnexpectedToken(token);
|
|
6663
|
+
}
|
|
6661
6664
|
let key = tokenType === tt.String ? (
|
|
6662
6665
|
/** @type {StringNode} */
|
|
6663
6666
|
createLiteralNode(tokenType)
|
|
@@ -16371,7 +16374,13 @@ function* outdatedEngines(pkg, pkgAst, ignoreNodeVersion) {
|
|
|
16371
16374
|
// src/rules/verify-engine-constraint.ts
|
|
16372
16375
|
var import_semver3 = __toESM(require_semver2(), 1);
|
|
16373
16376
|
var ruleId5 = "invalid-engine-constraint";
|
|
16374
|
-
async function* getDeepDependencies(pkg, dependency) {
|
|
16377
|
+
async function* getDeepDependencies(pkg, visited, dependency) {
|
|
16378
|
+
if (dependency) {
|
|
16379
|
+
if (visited.has(dependency)) {
|
|
16380
|
+
return;
|
|
16381
|
+
}
|
|
16382
|
+
visited.add(dependency);
|
|
16383
|
+
}
|
|
16375
16384
|
const pkgData = dependency ? await npmInfo(dependency, { ignoreUnpublished: true }) : pkg;
|
|
16376
16385
|
if (!pkgData) {
|
|
16377
16386
|
return;
|
|
@@ -16388,7 +16397,7 @@ async function* getDeepDependencies(pkg, dependency) {
|
|
|
16388
16397
|
const minVersion = import_semver3.default.minVersion(version3);
|
|
16389
16398
|
const deep = `${key}@${minVersion ? minVersion.version : version3}`;
|
|
16390
16399
|
yield deep;
|
|
16391
|
-
yield* getDeepDependencies(pkg, deep);
|
|
16400
|
+
yield* getDeepDependencies(pkg, visited, deep);
|
|
16392
16401
|
}
|
|
16393
16402
|
}
|
|
16394
16403
|
async function verifyDependency(dependency, minDeclared, declaredConstraint) {
|
|
@@ -16424,11 +16433,7 @@ async function verifyEngineConstraint(pkg) {
|
|
|
16424
16433
|
}
|
|
16425
16434
|
const messages = [];
|
|
16426
16435
|
const visited = /* @__PURE__ */ new Set();
|
|
16427
|
-
for await (const dependency of getDeepDependencies(pkg)) {
|
|
16428
|
-
if (visited.has(dependency)) {
|
|
16429
|
-
continue;
|
|
16430
|
-
}
|
|
16431
|
-
visited.add(dependency);
|
|
16436
|
+
for await (const dependency of getDeepDependencies(pkg, visited)) {
|
|
16432
16437
|
try {
|
|
16433
16438
|
const message = await verifyDependency(dependency, minDeclared, declaredConstraint);
|
|
16434
16439
|
if (message) {
|