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
Add ability to override esformatter options #7
Conversation
Hey, thanks for taking the time to look into this! Just thinking out loud but how do you feel about an rc kind of config (e.g. An advantage of that package may be that it supports I think the benefit of something like an rc config is that you don't need to specify it each time you run the command. |
That is the first thing I looked for when I wanted to configure it. I think that is a great idea! |
I'm wrapping this library in a grunt task, so having as many options exposed as possible is nice! Also it seems like only Maybe something like |
@james2doyle yeah, that would be good. Filed here: #8 EDIT: I'll add the rc on Monday if nobody gets to it before me. I can start exposing more options over the next week. |
@jimfleming I replaced what I had with |
Just had another idea, you could probably piggy back off I just don't know about adding yet another dotfile to projects. Or at least supporting the existing ones might be nice. |
@james2doyle I added support for picking up indent level from
What would the order of precedence be for this configuration files? Right now I have: But where would |
I would say that jsfmtrc should be swapped with jshintrc. Since it was I don't know how many people use it (editorconfig) but the whole idea of it On Sunday, May 11, 2014, Brett Langdon notifications@github.com wrote:
James Doyle t: @james2doyle https://twitter.com/james2doylew: ohdoylerules.com |
Oh, I think I may have diagrammed it not the best, .jsfmtrc values are I have it load the default, then try to override with .jshintrc and then Does this still sound correct to you? I think that's a good idea. I hadn't heard of editorconfig myself until
|
I agree with @james2doyle about waiting to see if there's a large demand for editorconfig (or others) support. It makes sense, I think, but from skimming the comments it also requires another dependency which I think we should avoid this early in development (unless there's more request for support). I'm a little worried about where it should stop: Sublime, Vim, Emacs et al support formatting configuration. Documenting the diagram of what overrides what could confuse users and supporting conversions between them (as in the jshint indent conversion) could become unwieldy. |
Most likely if someone is using .editorconfig, they are using .jshintrc as well, it says something about their personality haha |
So I just noticed esformatter supports its own rc file. Should we import that since its a direct dependency anyway? Otherwise I think this PR is good to go. |
From an initial glance at the source it looks like esformatter only
|
Ah, good catch, nevermind! I'll merge this in. EDIT: Tested it, seems to work well. |
Thanks!
|
Add ability to override esformatter options
No, thank you! |
I'd love to see editorconfig support! |
hi, +1 for editorconfig support, but also |
Mostly I was looking for a way to format to 4 spaces and not 2. Originally I added a cli option to set the number of spaces to indent, but I think this might be a better option?
Also I wasn't sure how I should document an example (if you feel one is necessary).