Skip to content

Commit

Permalink
fix: remove extra quotes from aliased disallowed dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
ext committed Nov 29, 2024
1 parent 1bfe367 commit 553711c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/package-json.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ it("should return error if aliased dependency is disallowed", async () => {
const { content, ast } = generateAst(pkg);
const results = await verifyPackageJson(pkg, ast, "package.json");
expect(codeframe(content, results)).toMatchInlineSnapshot(`
"ERROR: ""aliased" ("npm:eslint")" should be a devDependency (disallowed-dependency) at package.json
"ERROR: "aliased" ("npm:eslint") should be a devDependency (disallowed-dependency) at package.json
18 | },
19 | "dependencies": {
> 20 | "aliased": "npm:[email protected]"
Expand Down
4 changes: 2 additions & 2 deletions src/package-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ function verifyDependencies(

if (isDisallowedDependency(pkg, dependency)) {
const { line, column } = jsonLocation(pkgAst, "member", "dependencies", key);
const name = key === dependency ? dependency : `"${key}" ("npm:${dependency}")`;
const name = key === dependency ? `"${dependency}"` : `"${key}" ("npm:${dependency}")`;
messages.push({
ruleId: "disallowed-dependency",
severity: 2,
message: `"${name}" should be a devDependency`,
message: `${name} should be a devDependency`,
line,
column,
});
Expand Down

0 comments on commit 553711c

Please sign in to comment.