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
2020-08-28 03:14:50 -04:00
committed by GitHub
parent ecd7abecc0
commit 80bd2e18d6
4 changed files with 27 additions and 1 deletions

View File

@@ -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
\ [