Comments (7)
I agree that is a nice fallback layout if the imports don't fit on one line. Adding this should not be a big hassle. I'll reopen this issue, although I can't promise when I'll have time to get to it.
from scalafmt.
I have a temporary fix that will keep each import statement on a single line. Produces this:
import org.scalajs.dom.experimental.serviceworkers.{ServiceWorkerGlobalScope, ServiceWorkerRegistration}
Am I free to close this issue? IMO, if your import statement is this long you should not wrap them in {}. I'm sure some people will disagree, and if they're motivated they can open an issue.
from scalafmt.
Fine by me.
from scalafmt.
what about the following? sometimes imports can be pretty long.
import scala.language.implicitConversions
import org.scalajs.dom.experimental.serviceworkers.{
ServiceWorkerGlobalScope,
ServiceWorkerRegistration
}
import scala.scalajs.js
from scalafmt.
@regadas 's syntax is the holy grail.
from scalafmt.
Closed by 5a40e14 and enabled in the default style. The Scala.js style keeps the old behavior where the import stays on a single line.
from scalafmt.
@olafurpg nice! 👍
from scalafmt.
Related Issues (20)
- Properly formatted code using zio method `*>` is formatted so the code is no longer valid
- Wrong formatting of code blocks with partial functions returning tuples HOT 2
- apply more stringent scalafmt formatting
- `org.scalafmt.cli.FaliedToFormat` regression with `scala-xml` code on `RedundantBraces` rewrite rule HOT 4
- With `newlines.source = keep` linebreaks are not preserved in lists with non-numeric entries HOT 2
- With `newlines.source = keep` linebreaks are not preserved in function parameter lists HOT 3
- Preserve newlines more strictly HOT 12
- RedundantParens removes too much parens HOT 2
- `PositionExceptionImpl` complaining about expected `)` when encountering valid `<-` in for comprehension HOT 2
- Annotation argument is not a constant
- Feature request: code style for `match` dot-notation HOT 5
- Error with `RedundantBraces` and XML attribute in v3.8.1 HOT 1
- `if` + `then` rejected with significant indentation off HOT 13
- Clean-up config-style and binpacking code
- Feature Request: Support Automatic Conversion of snake_case to camelCase HOT 1
- Error: bad unary op for floating-point
- SIP-42 - Support for binary integer literals HOT 1
- Idempotence issue when trailingCommas is "always" and omitting braces
- Help wanted: Formatting inconsistency in 3.8.2 that's not in 3.8.1 HOT 3
- Wrong indentation with scala213source3 when short-circuiting boolean operators start a line in final position of a block HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scalafmt.