Skip to content

Commit 6274dba

Browse files
committed
docs: note that deno task ** recurses into node_modules
1 parent e669494 commit 6274dba

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

runtime/reference/cli/task.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,23 @@ echo data[0-9].csv
580580

581581
The supported glob characters are `*`, `?`, and `[`/`]`.
582582

583+
:::caution
584+
585+
Because `globstar` is enabled by default (see [Shell options](#shell-options)),
586+
`**` recurses into **all** descendant directories, including `node_modules`.
587+
This differs from some interactive shells where `**` is not recursive unless
588+
explicitly enabled, so a task like `deno check **/*.ts` can expand to far more
589+
files than the same command typed in your terminal, sweeping in dependency
590+
files. That can lead to errors such as `Argument list too long` or type-checking
591+
files you didn't intend to.
592+
593+
For `deno check` and `deno fmt`, prefer running them without glob arguments and
594+
using the [`exclude`](/runtime/fundamentals/configuration/) option in your
595+
`deno.json` (`node_modules` is excluded by default), or disable recursion for
596+
the task with `shopt -u globstar`.
597+
598+
:::
599+
583600
### Shell options
584601

585602
`deno task` supports shell options in Deno 2.6.6 and above to control glob

0 commit comments

Comments
 (0)