diff --git a/autoload/ale/fixers/prettier_standard.vim b/autoload/ale/fixers/prettier_standard.vim index b6e0a6f9..9d982ff6 100644 --- a/autoload/ale/fixers/prettier_standard.vim +++ b/autoload/ale/fixers/prettier_standard.vim @@ -17,8 +17,8 @@ function! ale#fixers#prettier_standard#Fix(buffer) abort return { \ 'command': ale#Escape(ale#fixers#prettier_standard#GetExecutable(a:buffer)) - \ . ' %t' + \ . ' --stdin' + \ . ' --stdin-filepath=%s' \ . ' ' . l:options, - \ 'read_temporary_file': 1, \} endfunction diff --git a/test/fixers/test_prettier_standard_callback.vader b/test/fixers/test_prettier_standard_callback.vader new file mode 100644 index 00000000..ab33fe20 --- /dev/null +++ b/test/fixers/test_prettier_standard_callback.vader @@ -0,0 +1,19 @@ +Before: + call ale#assert#SetUpFixerTest('javascript', 'prettier_standard') + + silent cd .. + silent cd command_callback + let g:dir = getcwd() + +After: + call ale#assert#TearDownFixerTest() + +Execute(The prettier callback should return the correct default values): + call ale#test#SetFilename('../prettier-test-files/testfile.js') + + AssertFixer + \ { + \ 'command': ale#Escape(g:ale_javascript_prettier_standard_executable) + \ . ' --stdin' + \ . ' --stdin-filepath=%s ', + \ }