Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto-style as much as possible with jsbeautifier #7

Closed
mvayngrib opened this issue Jan 27, 2015 · 12 comments

Comments

@mvayngrib
Copy link

commented Jan 27, 2015

to make it as easy as possible to adhere to this style for the devs

@yoshuawuyts

This comment has been minimized.

Copy link
Contributor

commented Feb 1, 2015

Alternatively there's also esformatter which is used in the rdio/jsfmt project.

@yoshuawuyts

This comment has been minimized.

Copy link
Contributor

commented Feb 3, 2015

maxogden/standard-format now exists. PR's are welcome.

@bcomnes

This comment has been minimized.

Copy link
Member

commented Feb 16, 2015

Was able to get a compatible auto format with jsfmt.

@Flet

This comment has been minimized.

Copy link
Member

commented Feb 17, 2015

@bcomnes do you have a .jsfmtrc file handy with everything defined?

@bcomnes

This comment has been minimized.

Copy link
Member

commented Feb 17, 2015

https://gist.github.com/bcomnes/8cba8a9253e47fdb2958

I use it from within sublime, bit it could be adapted to a .jsfmtrc pretty quickly.

Its not perfect but provides an okay auto format that doesn't collide with standard.

feross added a commit that referenced this issue Feb 17, 2015

Add --format option
For #7. Perhaps this should live in `standard-formatter` and `standard
--format` can just invoke it.
@feross

This comment has been minimized.

Copy link
Member

commented Feb 17, 2015

First pass at a standard --format command is on the formatter branch: 11187a6

Please try it and give feedback / improve it.

@Flet

This comment has been minimized.

Copy link
Member

commented Feb 17, 2015

I'll find some time to play with this tomorrow :)

@feross

This comment has been minimized.

Copy link
Member

commented Feb 17, 2015

awesome!

@feross

This comment has been minimized.

Copy link
Member

commented Feb 19, 2015

standard-format is shaping up quite nicely! They've adopted the esformatter-based strategy that I prototyped on the formatter branch.

Just npm install standard-format -g for a pretty helpful (not perfect yet!) formatter.

@feross feross closed this Feb 19, 2015

@bcomnes

This comment has been minimized.

Copy link
Member

commented Feb 19, 2015

Cool!

@Flet Do you know how to turn this into a sublime plugin?

@Flet

This comment has been minimized.

Copy link
Member

commented Feb 19, 2015

Yeah they have some excellent docs on how to do it here:
http://www.sublimelinter.com/en/latest/creating_a_linter.html

Its really geared for outputting errors from pure linters, but it certainly could be used to trigger a formatter too...

I'd love for there to eventually be a --format option built into standard with an exposed option in the standard Sublime plugin... maybe when standard-format is closer to awesome... IMO @feross should just add it as an experimental flag :)

@feross

This comment has been minimized.

Copy link
Member

commented Feb 20, 2015

@Flet No time right now, but I'd accept a PR that added a --format option that just called into standard-format.

@lock lock bot locked as resolved and limited conversation to collaborators May 11, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
5 participants
You can’t perform that action at this time.