npm-pkg-lint 4.5.1 → 4.5.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/dist/index.js +6 -2
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11512,14 +11512,18 @@ var disallowed = [
|
|
|
11512
11512
|
"https:",
|
|
11513
11513
|
"link:"
|
|
11514
11514
|
];
|
|
11515
|
+
var allowedInDev = /* @__PURE__ */ new Set(["link:"]);
|
|
11515
11516
|
var depFields = [
|
|
11516
11517
|
"dependencies",
|
|
11517
11518
|
"devDependencies",
|
|
11518
11519
|
"peerDependencies",
|
|
11519
11520
|
"optionalDependencies"
|
|
11520
11521
|
];
|
|
11521
|
-
function getProtocol(version2) {
|
|
11522
|
+
function getProtocol(version2, field) {
|
|
11522
11523
|
for (const protocol of disallowed) {
|
|
11524
|
+
if (field === "devDependencies" && allowedInDev.has(protocol)) {
|
|
11525
|
+
continue;
|
|
11526
|
+
}
|
|
11523
11527
|
if (version2.startsWith(protocol)) {
|
|
11524
11528
|
return protocol;
|
|
11525
11529
|
}
|
|
@@ -11541,7 +11545,7 @@ function* noProtocolDependencies(pkg, pkgAst) {
|
|
|
11541
11545
|
continue;
|
|
11542
11546
|
}
|
|
11543
11547
|
for (const [name, version2] of Object.entries(deps)) {
|
|
11544
|
-
const protocol = getProtocol(version2);
|
|
11548
|
+
const protocol = getProtocol(version2, field);
|
|
11545
11549
|
if (protocol) {
|
|
11546
11550
|
const { line, column } = jsonLocation(pkgAst, "member", field, name);
|
|
11547
11551
|
yield {
|