fix(vim-prettier): add back explicit file extension detection

This commit is contained in:
AJ ONeal
2023-03-07 00:58:30 +00:00
parent 89c46b728b
commit 6025fb3b8e

View File

@@ -6,12 +6,18 @@
" Change Log
"
" 2023-03-06:
" - add back explicit file extension detection
" (json and markdown at least are not working by default)
" 2023-03-05:
" - 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)
augroup RunPrettierByFiletype
" run Prettier not just by file extension, but also if the filetype is detected as javascript or typescript
autocmd BufWritePre .babelrc,.eslintrc,.jshintrc,*.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql,*.md,*.vue,*.yaml,*.html PrettierAsync
autocmd FileType javascript,typescript autocmd BufWritePre <buffer> PrettierAsync
augroup END