If you have a project structured such as
src/
foo.lua
bar.lua
tests/
.styluaignore
and you run stylua src (because you don't want to format the tests folder), it doesn't use the .styluaignore present in the current working directory.
e.g. if .styluaignore mentioned to ignore bar.lua, it would be ignored if you run stylua ., but it will still be formatted if you run stylua src. This is because the .styluaignore file isn't actually ever "noticed" by the directory walker, since the cwd wasn't passed as a starting point.
This behaviour is confusing, as you would expect the .styluaignore to be taken into account if it was present in the cwd where stylua was ran.