Skip to content

Commit 3127683

Browse files
committed
fix(plugin-eslint): omit empty docsUrl in audit metadata
1 parent 39a7d43 commit 3127683

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/plugin-eslint/src/lib/__snapshots__/eslint-plugin.spec.ts.snap

-2
Original file line numberDiff line numberDiff line change
@@ -424,13 +424,11 @@ Custom options:
424424
]
425425
}
426426
\`\`\`",
427-
"docsUrl": "",
428427
"slug": "nx-enforce-module-boundaries-9dba9763586d15c6",
429428
"title": "Ensure that module boundaries are respected within the monorepo",
430429
},
431430
{
432431
"description": "ESLint rule **dependency-checks**, from _@nx_ plugin.",
433-
"docsUrl": "",
434432
"slug": "nx-dependency-checks",
435433
"title": "Checks dependencies in project's package.json for version mismatches",
436434
},

packages/plugin-eslint/src/lib/meta/transform.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ export function ruleToAudit({ ruleId, meta, options }: RuleData): Audit {
1919
slug: ruleIdToSlug(ruleId, options),
2020
title: meta.docs?.description ?? name,
2121
description: lines.join('\n\n'),
22-
docsUrl: meta.docs?.url,
22+
...(meta.docs?.url && {
23+
docsUrl: meta.docs.url,
24+
}),
2325
};
2426
}

0 commit comments

Comments
 (0)