esformatter icon indicating copy to clipboard operation
esformatter copied to clipboard

Make `standard` preset

Open trajano opened this issue 8 years ago • 2 comments

Can we have a preset that would satisfy standard? I got a few though I am still missing one.

whiteSpace: {
  after: {
    FunctionName: 1,
    FunctionReservedWord: 1,
    MethodDefinitionName: 1
  }
}

The one that is missing would be these (from Meteor created app)

Template.hello.helpers({
  counter() {
    return Template.instance().counter.get()
  }
})

Template.hello.events({
  'click button'(event, instance) {
    // increment the counter when button is clicked
    instance.counter.set(instance.counter.get() + 1)
  }
})

The standard expects it to be

Template.hello.helpers({
  counter () {
    return Template.instance().counter.get()
  }
})

Template.hello.events({
  'click button' (event, instance) {
    // increment the counter when button is clicked
    instance.counter.set(instance.counter.get() + 1)
  }
})

trajano avatar Apr 21 '16 18:04 trajano

standard-format is built on top of esformatter, maybe that's what you're looking for?

PS: in the ideal world, standard-format would be just a esformatter preset - I'm going to improve out plugin/preset structure to make it easier to share configs between teams/projects.

millermedeiros avatar Apr 27 '16 21:04 millermedeiros

I think I had trouble using https://github.com/maxogden/standard-format/ with gulp which is why I opted for your project. Especially since your project seems to handle ES6 quite nicely.

trajano avatar Apr 28 '16 02:04 trajano