Prettier does not ignore a folder that have root permissions

Viewed 495

In my project we have a docker folder that we use to run the container. The issue is that when we run prettier i got this error:

[error] Unable to expand directory: .
[error] EACCES: permission denied, scandir '/home/nanez/my-project/docker/data/postgres'

This folder need root permissions to access and delete it (using sudo ofc). I already added the whole docker folder to .prettierignore and also the specific postgres folder and i still throwing the error. Here my .prettierignore:

## Deps
node_modules
cache

generated
docker
./docker
/docker/**/*
/docker/*
/docker/data/postgres

As you can see, I added the docker folder with all the posibilities that I thought.

If I run prettier with the negative pattern work good, for ex: npx prettier . '!./docker' --check. This run all without problem, but I'm wonder why I can't ignore directly with npx prettier . --check if already I have the docker folder in the .prettierignore.

I'm using WSL2 with Ubuntu 20.04LTS.

Thanks :)

0 Answers
Related