diff options
| author | Vu Tran <vutran@dropbox.com> | 2017-06-29 17:36:03 -0700 |
|---|---|---|
| committer | Vu Tran <vutran@dropbox.com> | 2017-06-29 17:36:10 -0700 |
| commit | 416f20a4cae4e58313c1f68d876b69e00ce69d91 (patch) | |
| tree | 64aad092bc28e8beb54d8da6c61a27c9a77cb226 | |
| parent | e179f61aad3390af441e2469bb700a9d5ce919bf (diff) | |
| download | vim-prettier-416f20a4cae4e58313c1f68d876b69e00ce69d91.tar.xz | |
add graphql parser + bump for prettier 1.5
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | doc/prettier.txt | 2 | ||||
| -rw-r--r-- | ftplugin/graphql.vim | 10 | ||||
| -rw-r--r-- | package.json | 2 | ||||
| -rw-r--r-- | plugin/prettier.vim | 2 |
5 files changed, 14 insertions, 4 deletions
@@ -122,7 +122,7 @@ g:prettier#config#jsx_bracket_same_line = 'true' " none|es5|all g:prettier#config#trailing_comma = 'all' -" flow|babylon|typescript|postcss|json +" flow|babylon|typescript|postcss|json|graphql g:prettier#config#parser = 'flow' ``` diff --git a/doc/prettier.txt b/doc/prettier.txt index 3b75d8c..3ef8c82 100644 --- a/doc/prettier.txt +++ b/doc/prettier.txt @@ -118,7 +118,7 @@ Overwrite default prettier configuration " none|es5|all g:prettier#config#trailing_comma = 'all' - " flow|babylon|typescript|postcss|json + " flow|babylon|typescript|postcss|json|graphql g:prettier#config#parser = 'flow' < ============================================================================== diff --git a/ftplugin/graphql.vim b/ftplugin/graphql.vim new file mode 100644 index 0000000..bfb7b34 --- /dev/null +++ b/ftplugin/graphql.vim @@ -0,0 +1,10 @@ +let b:prettier_ft_default_args = { + \ 'parser': 'graphql' + \ } + +augroup Prettier + autocmd! + if g:prettier#autoformat + autocmd BufWritePre <buffer> call prettier#Autoformat() + endif +augroup end diff --git a/package.json b/package.json index 9d6eb0a..f091e1e 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,6 @@ "url": "git://github.com/mitermayer/vim-prettier.git" }, "dependencies": { - "prettier": "^1.4.4" + "prettier": "^1.5.2" } } diff --git a/plugin/prettier.vim b/plugin/prettier.vim index fd1e4a8..b89ebb5 100644 --- a/plugin/prettier.vim +++ b/plugin/prettier.vim @@ -51,7 +51,7 @@ let g:prettier#config#jsx_bracket_same_line = get(g:,'prettier#config#jsx_bracke " none|es5|all let g:prettier#config#trailing_comma = get(g:,'prettier#config#trailing_comma', 'all') -" flow|babylon|typescript|postcss|json +" flow|babylon|typescript|postcss|json|graphql let g:prettier#config#parser = get(g:,'prettier#config#parser', 'flow') " synchronous by default |
