question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trailing empty line problem

See original GitHub issue

I’m using prettier-eslint-cli for vim and prettier-eslint for Atom right now. Everything works great and they gave me the same results except a tiny problem.

After formatting the code via Vim using this configuration:

autocmd FileType javascript.jsx,javascript setlocal formatprg=prettier-eslint\ --stdin\ --prettier.jsx-bracket-same-line\ --prettier.parser\ babylon\ --prettier.single-quote\ --prettier.trailing-comma\ none

prettier-eslint-cli formatter is adding a new empty line to the EOF.

Missing something on the tool configuration side?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
zenbocommented, May 9, 2017

Don’t print double newlines at EOF to stdout by lydell · Pull Request #437 · prettier/prettier https://github.com/prettier/prettier/pull/437

0reactions
kentcdoddscommented, May 9, 2017

Ah! That makes sense! Anyone want to make a pull request for that?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remove Trailing Blank Lines – Solution | C For Dummies Blog
My first approach was to write a filter to solve the problem. The filter processes one character at a time — or even...
Read more >
Add setting to not treat indented empty lines as trailing ...
The first line unambiguously has trailing whitespace, and I'd like to automatically trim that (with files.trimTrailingWhitespace set to true).
Read more >
Remove any trailing blank lines or lines with whitespaces from ...
Remove any trailing blank lines or lines with whitespaces from end of file · 1. if $last_line doesn't get updated, it will fall...
Read more >
"Remove trailing blank lines" option seemingly has ... - YouTrack
Removes trailing single empty line, no matter what the preference is. May be a problem in conjunction with ESlint/Prettier?
Read more >
Avoid paragraph due to trailing empty line in standalone file
I'm looking now for possibilities to ignore such trailing lines or remove the paragraph they create.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found