slushjs / slush-angular

A slush generator for AngularJS using the Google Angular App Structure Recommendations
129 stars 32 forks source link

Allow output to be formatted #11

Open bebraw opened 10 years ago

bebraw commented 10 years ago

I'm one of those peeps that likes to use four spaces instead of two. Maybe it would make sense to provide some sort of hook that would make it possible to reformat the code easily after generation? That would save up some time.

joakimbeng commented 10 years ago

@bebraw interesting. That could quite easily be realized as a separate gulp plugin, if it doesn't exist already :)

bebraw commented 10 years ago

Looks like there are two primary options for JS: gulp-esformatter and gulp-jsbeautifier.

Maybe we can pick one of those and integrate it to the narrative? It should ask "Do you want to use a JS beautifier?" in case CoffeeScript path wasn't chosen. In addition if the user answers yes, it should ask at least for indentation. Other options can be tweaked by hand if needed.

How does that sound?

joakimbeng commented 10 years ago

Sounds like a good idea I think!

bebraw commented 10 years ago

Here's a little something you can try, https://github.com/bebraw/slush-angular/tree/formatting .

Note that we should perform formatting only on JS/CSS/HTML. It just concats the data for other formats for some reason. Any idea what's a nice way to achieve this sort of thing?