Skip to content

Start using prettier default arguments#130

Merged
mitermayer merged 1 commit intoprettier:release/1.xfrom
docwhat:pr/defaulted_cli_args
Apr 13, 2018
Merged

Start using prettier default arguments#130
mitermayer merged 1 commit intoprettier:release/1.xfrom
docwhat:pr/defaulted_cli_args

Conversation

@docwhat
Copy link
Copy Markdown
Contributor

@docwhat docwhat commented Apr 13, 2018

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 .prettierrc files) 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_flags and it's b: variant instead?

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.
@docwhat
Copy link
Copy Markdown
Contributor Author

docwhat commented Apr 13, 2018

This isn't complete. I'm not sure what to do about --no-editorconfig and the --prose-wrap flag (which has three settings, all bad defaults).

@docwhat docwhat changed the base branch from master to release/1.x April 13, 2018 04:44
@docwhat
Copy link
Copy Markdown
Contributor Author

docwhat commented Apr 13, 2018

These smaller functions would be ideal with a testing framework. I haven't used Vader or vspec before, though.

@mitermayer
Copy link
Copy Markdown
Member

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

@mitermayer
Copy link
Copy Markdown
Member

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 ?

@mitermayer
Copy link
Copy Markdown
Member

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.

@mitermayer
Copy link
Copy Markdown
Member

Will merge this to branch 1.x as it is and will try to follow up the 'presets' logic on separate pr's

@mitermayer mitermayer merged commit a324f71 into prettier:release/1.x Apr 13, 2018
@docwhat
Copy link
Copy Markdown
Contributor Author

docwhat commented Apr 14, 2018

Also what do you think about creating options 'presets' ? We could have 'prettier' and 'fb' presets configurable.

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 ./.prettierrc or ./package.json settings or your global ~/.prettierrc file.

Can you point at or tell me more about these FB settings? Or are they internal to Facebook?

@docwhat docwhat deleted the pr/defaulted_cli_args branch April 14, 2018 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants