Environments:
- Prettier Version: 2.5.1
- Running Prettier via: CLI
- Runtime: Node.js v16.13.0
- Operating System: Linux
- Prettier plugins (if any): none
Steps to reproduce:
First create the test dirs.
mkdir -p ./x1 ./y1
ln -sf .. ./x1/x2
ln -sf .. ./y1/y2
It should look like:
$ tree
.
├── x1
│ └── x2 -> ..
└── y1
└── y2 -> ..
4 directories, 0 files
Then run prettier cli
Try adding these dirs to .prettierignore and run again:
$ cat .prettierignore
x1
y1
Expected behavior:
No error.
Or these problematic dirs can be excluded by .prettierignore file.
Actual behavior:
The command will run for a long time, and then produce an error.
[error] Unable to expand directory: .
[error] ELOOP: too many symbolic links encountered, scandir '/tmp/t/prettier-bug/x1/x2/x1/x2/x1/x2/x1/x2/x1/x2/y1/y2/y1/y2/x1/x2/y1/y2/x1/x2/y1/y2/y1/y2/x1/x2/x1/x2/y1/y2/y1/y2/x1/x2/y1/y2/x1/x2/x1/x2/x1/x2'
Environments:
Steps to reproduce:
First create the test dirs.
It should look like:
Then run prettier cli
Try adding these dirs to
.prettierignoreand run again:Expected behavior:
No error.
Or these problematic dirs can be excluded by
.prettierignorefile.Actual behavior:
The command will run for a long time, and then produce an error.