mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-08-19 12:06:25 +00:00
fix(vim-prettier): run when 'filetype' is javascript, remove outdated
config
This commit is contained in:
@@ -3,8 +3,15 @@
|
||||
" from webinstall.dev/vim-prettier "
|
||||
""""""""""""""""""""""""""""""""""""
|
||||
|
||||
" format as-you-type is quite annoying, so we turn it off
|
||||
let g:prettier#autoformat = 0
|
||||
" Change Log
|
||||
"
|
||||
" 2023-03-06:
|
||||
" - run when filetype matches javascript
|
||||
" (e.g. shebang is #!/usr/bin/env node)
|
||||
" - remove explicit file extension detection
|
||||
" (this now works as expected by default)
|
||||
|
||||
" list all of the extensions for which prettier should run
|
||||
autocmd BufWritePre .babelrc,.eslintrc,.jshintrc,*.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql,*.md,*.vue,*.yaml,*.html PrettierAsync
|
||||
augroup RunPrettierByFiletype
|
||||
" run Prettier not just by file extension, but also if the filetype is detected as javascript or typescript
|
||||
autocmd FileType javascript,typescript autocmd BufWritePre <buffer> PrettierAsync
|
||||
augroup END
|
||||
|
||||
Reference in New Issue
Block a user