npm-pkg-lint 5.1.8 → 5.1.9
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 +17 -12
- package/dist/index.js.map +2 -2
- package/package.json +1 -7
package/dist/index.js
CHANGED
|
@@ -8743,7 +8743,7 @@ var bn = (s3, t) => {
|
|
|
8743
8743
|
t = t.slice((e + " ").length);
|
|
8744
8744
|
let i = t.split("="), r = i.shift();
|
|
8745
8745
|
if (!r) return s3;
|
|
8746
|
-
let n = r.replace(/^SCHILY\.(dev|ino|nlink)/, "$1"), o = i.join("=");
|
|
8746
|
+
let n = r.replace(/^SCHILY\.(dev|ino|nlink)/, "$1"), o = i.join("=").replace(/\0.*/, "");
|
|
8747
8747
|
return s3[n] = /^([A-Z]+\.)?([mac]|birth|creation)time$/.test(n) ? new Date(Number(o) * 1e3) : /^[0-9]+$/.test(o) ? +o : o, s3;
|
|
8748
8748
|
};
|
|
8749
8749
|
var _n = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
|
|
@@ -11480,17 +11480,21 @@ function* validateOrder2(pkgAst, value, path8) {
|
|
|
11480
11480
|
const keys = Object.keys(value);
|
|
11481
11481
|
if (keys.includes("require")) {
|
|
11482
11482
|
for (const esm of ["import", "module"]) {
|
|
11483
|
-
if (keys.includes(esm)
|
|
11484
|
-
|
|
11485
|
-
|
|
11486
|
-
|
|
11487
|
-
|
|
11488
|
-
severity: severity3,
|
|
11489
|
-
message: `"${esm}" must come before "require" in "exports${property}"`,
|
|
11490
|
-
line,
|
|
11491
|
-
column
|
|
11492
|
-
};
|
|
11483
|
+
if (!keys.includes(esm)) {
|
|
11484
|
+
continue;
|
|
11485
|
+
}
|
|
11486
|
+
if (keys.indexOf(esm) <= keys.indexOf("require")) {
|
|
11487
|
+
continue;
|
|
11493
11488
|
}
|
|
11489
|
+
const { line, column } = jsonLocation(pkgAst, "member", "exports", ...path8, esm);
|
|
11490
|
+
const property = path8.map((it2) => `["${it2}"]`).join("");
|
|
11491
|
+
yield {
|
|
11492
|
+
ruleId: ruleId5,
|
|
11493
|
+
severity: severity3,
|
|
11494
|
+
message: `"${esm}" must come before "require" in "exports${property}"`,
|
|
11495
|
+
line,
|
|
11496
|
+
column
|
|
11497
|
+
};
|
|
11494
11498
|
}
|
|
11495
11499
|
}
|
|
11496
11500
|
for (const key of keys) {
|
|
@@ -11886,7 +11890,8 @@ async function* getDeepDependencies(pkg, visited, dependency) {
|
|
|
11886
11890
|
if (!pkgData) {
|
|
11887
11891
|
return;
|
|
11888
11892
|
}
|
|
11889
|
-
|
|
11893
|
+
const { dependencies = {} } = pkgData;
|
|
11894
|
+
for (let [key, version2] of Object.entries(dependencies)) {
|
|
11890
11895
|
if (version2.startsWith("npm:")) {
|
|
11891
11896
|
const [newKey, newVersion] = version2.slice("npm:".length).split("@", 2);
|
|
11892
11897
|
key = newKey;
|