esformatter
esformatter copied to clipboard
Make `standard` preset
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)
}
})
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.
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.