Start using prettier default arguments#130
Start using prettier default arguments#130mitermayer merged 1 commit intoprettier:release/1.xfrom docwhat:pr/defaulted_cli_args
Conversation
This is one approach for handling default prettier arguments. It is a little verbose, but I think ejecting the flags that don't have to be set by the editor (in favor of .prettierrc files) is a win.
|
This isn't complete. I'm not sure what to do about |
|
These smaller functions would be ideal with a testing framework. I haven't used Vader or vspec before, though. |
|
Hi @docwhat, I like your above ideas, I have been wanting to setup the 'ci' for this for a while now. I think 'vader' would be great for writting vim tests. Other cool idea we could do for automated testing would be using jest (we already have package.json so we could leverage) and using snapshot assertions. Basicly we would just need to have a wrapper that would call vim and make vim execute some commands and save to a file where we could use to create a snapshot. Open for any other ideas around it |
|
Also what do you think about creating options 'presets' ? We could have 'prettier' and 'fb' presets configurable. The user could then be able to select one of them and still overwrite specific settings of it ? |
|
I like the direction this is going, I think we should still have the "FB" options somewhere as some users are already using it and thats how we use internally at FB. I am happy to make prettier default settings the default. |
|
Will merge this to branch 1.x as it is and will try to follow up the 'presets' logic on separate pr's |
Since you've mentioned the FB settings so much in the issues I was thinking about how to do presets and haven't decided on a good strategy (if any). It could be argued that maybe the settings should be controlled either via a Can you point at or tell me more about these FB settings? Or are they internal to Facebook? |
This is one approach for handling default prettier arguments.
I think ejecting the flags that the editor can't know the answers to (in favor of
.prettierrcfiles) will help overall.Especially since the flags for certain variations of prettier will be different. It's better to keep it simple.
Maybe we can add a generic
g:prettier#config#addition_cli_flagsand it'sb:variant instead?