ai / size-limit

Calculate the real cost to run your JS app or lib to keep good performance. Show error in pull request if the cost exceeds the limit.
MIT License
6.48k stars 1.82k forks source link

Extra blank lines when using --silent #363

Open isuvorov opened 2 months ago

isuvorov commented 2 months ago

Extra blank lines appear when using the --silent option.

I propose add a check if (isSilentMode) in the appropriate parts of the code to fix this issue.

function createHumanReporter(process, isSilentMode = false) {
  function print(...lines) {
    if (!isSilentMode) {
      process.stdout.write('  ' + lines.join('\n  ') + '\n')
    }
  }

https://github.com/ai/size-limit/blob/d0d681d7d0c686773650ba1af03d892f0081e761/packages/size-limit/create-reporter.js#L48

Need advice on the correctness of this approach.

I could make PR by myself.

This gap is too БЕСИТ 😬

image image image
ai commented 2 months ago

Yes, let’s remove spaces for silent mode. Create PR.