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

prettier add extra comma at the last parameter of function #18

Closed
dedoyle opened this issue Jun 23, 2017 · 1 comment
Closed

prettier add extra comma at the last parameter of function #18

dedoyle opened this issue Jun 23, 2017 · 1 comment

Comments

@dedoyle
Copy link

dedoyle commented Jun 23, 2017

vim version:

Vim 8.0 (MS-Windows 64-bit GUI version with OLE support)

vimrc

Plug 'mitermayer/vim-prettier', {
            \ 'do': 'yarn install',
            \ 'for': ['javascript', 'typescript', 'css', 'less', 'scss'] }

" Disable auto formatting of files that have @format tag
let g:prettier#autoformat = 0

" max line lengh that prettier will wrap on
let g:prettier#config#print_width = 80

" number of spaces per indentation level
let g:prettier#config#tab_width = 4

" use tabs over spaces
let g:prettier#config#use_tabs = 'false'

" print semicolons
let g:prettier#config#semi = 'true'

" single quotes over double quotes
let g:prettier#config#single_quote = 'true'

nnoremap <silent><c-f> :Prettier<CR>

Probrem

origin code

function aLongLongLongFunction(barbarbar, foofoofoo, boobooboo, barbarbar, balabalabala) {
    console.log('lalalala');
}

after prettier

function aLongLongLongFunction(
    barbarbar,
    foofoofoo,
    boobooboo,
    barbarbar,
    balabalabala,  // add an extra comma here
) {
    console.log('lalalala');
}
@dedoyle
Copy link
Author

dedoyle commented Jun 23, 2017

After writting the issue, I found a configuration to solve this problem.

" none|es5|all
let g:prettier#config#trailing_comma = 'none'

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

No branches or pull requests

2 participants