-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Extra newline between attribute and function #611
Comments
Hi @martinbryant, thanks for reporting these issues. I'm sorry to see that you had a bit of a rough start with Fantomas. Regarding this issue, do you mean the blank lines when you say "extra whitespace"? By that logic, the bug I see here is that an extra newline was added after formatting the code. |
Ah @nojaf no problem. Been quite a learning experience to be fair. Yeah I would have thought that the extra whitespace would be removed as it was in v2.9.2. Any formatters I have previously used(Prettier, elm-format) would remove any extra whitespace to provide a consistent experience. Appreciate that the behaviour would change between versions though. Any reason why the preserveEOL flag was removed though? The behaviour was great before and when using the flag, no extra line is added |
preserveEOL introduced a lot of problems and just didn't work in certain settings (f.ex indentSpaceNum = 2). I understand that the current behaviour isn't really what you expect coming from other formatters. Could you maybe create a new issue to discuss the removal of newlines? Maybe we can consider a setting to set a limit to the number of newlines. I would like to use this issue to solve the problem that a new newline is introduced after formatting. |
Issue created from fantomas-ui
Using the CLI and the online tool both have the issue
Actual behaviour
v3.1.0 - Does not remove the extra whitespace in a file
Expected behaviour
v2.9.2 - The extra whitespace is removed
Steps to replicate
Click here
Change version to 2.9.2 and see the whitespace removed
Code
Result
Options
Fantomas 3.1.0
IndentOnTryWith
false
IndentSpaceNum
4
KeepNewlineAfter
false
MaxIfThenElseShortWidth
40
PageWidth
120
ReorderOpenDeclaration
false
SemicolonAtEndOfLine
false
SpaceAfterComma
false
SpaceAfterSemicolon
false
SpaceAroundDelimiter
false
SpaceBeforeArgument
false
SpaceBeforeColon
false
StrictMode
false
The text was updated successfully, but these errors were encountered: