Giter Site home page Giter Site logo

Comments (7)

mdevils avatar mdevils commented on June 23, 2024

I would accept a proper pull-request on this.

from node-jscs.

timmywil avatar timmywil commented on June 23, 2024

I would like the opposite to be enforced by an option.

from node-jscs.

timmywil avatar timmywil commented on June 23, 2024

But only for statements. For instance, I'd like to differentiate between

var o = {
  key: [{
    a: 0
  },
  // okay
  {
    a: 1
  }]
};

and

// good
if (true) {
}
// bad
if (true)
{
}

By statements, I mean, if, else, for, while, switch, do, return, try, catch, and function. Elsewhere is fine.

Perhaps the exception could be narrowed down to whenever the curly is preceded by comma and optional whitespace.

from node-jscs.

mikesherov avatar mikesherov commented on June 23, 2024

@timmywil you mean all blockStatements and not objectExpressions, right?

This would be similar to *SpaceBeforeBlockStatements and be called *NewlineBeforeBlockStatements. Sound good?

from node-jscs.

timmywil avatar timmywil commented on June 23, 2024

@mikesherov Yes, thank you for putting it concisely. Sounds great.

from node-jscs.

bhardin avatar bhardin commented on June 23, 2024

I agree with @timmywil, I'd like to have a rule to enforce the opposite also. Was NewlineBeforeBlockStatements ever implemented?

from node-jscs.

cowwoc avatar cowwoc commented on June 23, 2024

@bhardin yes, but it has yet to be merged. See #536

from node-jscs.

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.