diff --git a/src/package-json.spec.ts b/src/package-json.spec.ts index 729be90c..aa0a3d0b 100644 --- a/src/package-json.spec.ts +++ b/src/package-json.spec.ts @@ -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:eslint@1.2.3" diff --git a/src/package-json.ts b/src/package-json.ts index 31d66d67..e3dbe120 100644 --- a/src/package-json.ts +++ b/src/package-json.ts @@ -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, });