Skip to content

Commit

Permalink
Add newline to disclosure reporter output
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Nov 1, 2024
1 parent 7baeab9 commit a74d27b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions packages/docs/src/content/docs/features/reporters.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ in a closed state initially. The reporter renders this:
````text
$ knip --reporter disclosure
<details><summary>Unused files (2)</summary>
<details>
<summary>Unused files (2)</summary>
```
unused.ts
Expand All @@ -121,7 +122,8 @@ dangling.js
</details>
<details><summary>Unused dependencies (2)</summary>
<details>
<summary>Unused dependencies (2)</summary>
```
unused-dep package.json
Expand All @@ -134,7 +136,8 @@ my-package package.json
The above can be copy-pasted where HTML and Markdown is supported, such as a
GitHub issue or pull request, and renders like so:

<details><summary>Unused files (2)</summary>
<details>
<summary>Unused files (2)</summary>

```
unused.ts
Expand All @@ -143,7 +146,8 @@ dangling.js

</details>

<details><summary>Unused dependencies (2)</summary>
<details>
<summary>Unused dependencies (2)</summary>

```
unused-dep package.json
Expand Down
2 changes: 1 addition & 1 deletion packages/knip/src/reporters/disclosure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { relative, toRelative } from '../util/path.js';
import { getTitle } from './util.js';

const printHeader = (size: number, title?: string) =>
console.log(`<details>${title ? `<summary>${title} (${size})</summary>` : ''}\n\n\`\`\``);
console.log(`<details>\n${title ? `<summary>${title} (${size})</summary>\n` : ''}\n\`\`\``);

const printFooter = () => console.log('```\n\n</details>\n');

Expand Down

0 comments on commit a74d27b

Please sign in to comment.