GithubHelp home page GithubHelp logo

Breaking of import lines about scalafmt HOT 7 CLOSED

scalameta avatar scalameta commented on July 17, 2024
Breaking of import lines

from scalafmt.

Comments (7)

olafurpg avatar olafurpg commented on July 17, 2024 1

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.

olafurpg avatar olafurpg commented on July 17, 2024

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.

sjrd avatar sjrd commented on July 17, 2024

Fine by me.

from scalafmt.

regadas avatar regadas commented on July 17, 2024

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.

pascoej avatar pascoej commented on July 17, 2024

@regadas 's syntax is the holy grail.

from scalafmt.

olafurpg avatar olafurpg commented on July 17, 2024

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.

regadas avatar regadas commented on July 17, 2024

@olafurpg nice! 👍

from scalafmt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.