Skip to content

style(svelte-check): make human output more concise and readable #2748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

YimingIsCOLD
Copy link
Contributor

This PR makes the human output of svelte-check more concise and readable.

TLDR:

  • Remove ==================================== separator from the output
  • Remove unnecessary leading newlines at the start of the output
  • Trimmed trailing newlines at the end of code blocks when using the --output=human-verbose flag

--output=human

No Errors or Warnings

Before

====================================
svelte-check found 0 errors and 0 warnings

After

svelte-check found 0 errors and 0 warnings

Single Error/Warning

Before

/Users/yiming/workspace/somekit/src/routes/+layout.svelte:10:3
Warn: Unused CSS selector ".container"
https://svelte.dev/e/css_unused_selector (svelte)

====================================
svelte-check found 0 errors and 1 warning in 1 file

After

/Users/yiming/workspace/somekit/src/routes/+layout.svelte:10:3
Warn: Unused CSS selector ".container"
https://svelte.dev/e/css_unused_selector (svelte)

svelte-check found 0 errors and 1 warning in 1 file

Multiple Errors/Warnings

Before

/Users/yiming/workspace/somekit/src/routes/+layout.svelte:10:3
Warn: Unused CSS selector ".container"
https://svelte.dev/e/css_unused_selector (svelte)

/Users/yiming/workspace/somekit/src/routes/+page.svelte:4:3
Warn: Unused CSS selector ".container"
https://svelte.dev/e/css_unused_selector (svelte)

====================================
svelte-check found 0 errors and 2 warnings in 2 files

After

/Users/yiming/workspace/somekit/src/routes/+layout.svelte:10:3
Warn: Unused CSS selector ".container"
https://svelte.dev/e/css_unused_selector (svelte)

/Users/yiming/workspace/somekit/src/routes/+page.svelte:4:3
Warn: Unused CSS selector ".container"
https://svelte.dev/e/css_unused_selector (svelte)

svelte-check found 0 errors and 2 warnings in 2 files

--output=human-verbose

No Errors or Warnings

Before

 
====================================
Loading svelte-check in workspace: /Users/yiming/workspace/somekit
Getting Svelte diagnostics...

====================================
svelte-check found 0 errors and 0 warnings

After

Loading svelte-check in workspace: /Users/yiming/workspace/somekit
Getting Svelte diagnostics...

svelte-check found 0 errors and 0 warnings

Single Error/Warning

Before

 
====================================
Loading svelte-check in workspace: /Users/yiming/workspace/somekit
Getting Svelte diagnostics...

/Users/yiming/workspace/somekit/src/routes/+layout.svelte:10:3
Warn: Unused CSS selector ".container"
https://svelte.dev/e/css_unused_selector (svelte)
<style>
  .container {
    background-color: red;


====================================
svelte-check found 0 errors and 1 warning in 1 file

After

Loading svelte-check in workspace: /Users/yiming/workspace/somekit
Getting Svelte diagnostics...

/Users/yiming/workspace/somekit/src/routes/+layout.svelte:10:3
Warn: Unused CSS selector ".container"
https://svelte.dev/e/css_unused_selector (svelte)
<style>
  .container {
    background-color: red;

svelte-check found 0 errors and 1 warning in 1 file

Multiple Errors/Warnings

Before

 
====================================
Loading svelte-check in workspace: /Users/yiming/workspace/somekit
Getting Svelte diagnostics...

/Users/yiming/workspace/somekit/src/routes/+layout.svelte:10:3
Warn: Unused CSS selector ".container"
https://svelte.dev/e/css_unused_selector (svelte)
<style>
  .container {
    background-color: red;


/Users/yiming/workspace/somekit/src/routes/+page.svelte:4:3
Warn: Unused CSS selector ".container"
https://svelte.dev/e/css_unused_selector (svelte)
<style>
  .container {
    background-color: red;


====================================
svelte-check found 0 errors and 2 warnings in 2 files

After

Loading svelte-check in workspace: /Users/yiming/workspace/somekit
Getting Svelte diagnostics...

/Users/yiming/workspace/somekit/src/routes/+layout.svelte:10:3
Warn: Unused CSS selector ".container"
https://svelte.dev/e/css_unused_selector (svelte)
<style>
  .container {
    background-color: red;

/Users/yiming/workspace/somekit/src/routes/+page.svelte:4:3
Warn: Unused CSS selector ".container"
https://svelte.dev/e/css_unused_selector (svelte)
<style>
  .container {
    background-color: red;

svelte-check found 0 errors and 2 warnings in 2 files

@YimingIsCOLD
Copy link
Contributor Author

Any maintainers can help to review this?

@YimingIsCOLD YimingIsCOLD force-pushed the style/svelte-check-tidy-output branch from f535771 to a66d87b Compare May 16, 2025 00:46
@dummdidumm
Copy link
Member

The ==== at the end helps me visually to separate the concrete errors from the summary. I would be ok with removing it in case there's no errors/warnings. The ==== at the start was for watch mode I believe, to separate the runs from each other.

@jasonlyu123 how do you feel about these tweaks?

@jasonlyu123
Copy link
Member

I also feel similar. The ==== does make it easier to spot the separation. Removing the ==== in case there's no errors/warnings sounds good. Removing the multiple empty lines does make it more concise, so I think I'm okay with that.

@YimingIsCOLD YimingIsCOLD force-pushed the style/svelte-check-tidy-output branch from a66d87b to e4b3e84 Compare June 23, 2025 01:30
Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@dummdidumm dummdidumm merged commit 14dc584 into sveltejs:master Jul 15, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants