Set prettier working directory to where .prettierignore is (#3101)

Prettier does not use `.prettierignore` unless the current directory is the root where the `.prettierignore` file resides.

* Update Prettier tests
* Look for prettierignore to determine project root
This commit is contained in:
Sorin Iclanzan authored and GitHub committed 2020-08-28 08:14:50 +01:00
1 parent ecd7abecc0
commit 80bd2e18d6
4 files changed
+27 -1

No files matched your search

@@ -297,6 +297,17 @@ Execute(Should set --parser for experimental language, Handlebars):
\ . ' --stdin-filepath %s --stdin',
\ }
Execute(Changes to directory where .prettierignore is found):
call ale#test#SetFilename('../prettier-test-files/with_prettierignore/src/testfile.js')
GivenCommandOutput ['1.6.0']
AssertFixer
\ {
\ 'command': ale#path#CdString(expand('%:p:h:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --stdin-filepath %s --stdin',
\ }
Execute(The prettier_d post-processor should permit regular JavaScript content):
AssertEqual
\ [
Whitespace-only changes.
Whitespace-only changes.