-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
big ignore paths slow down cli #4989
Copy link
Copy link
Open
Labels
area:cliIssues with Prettier's Command Line InterfaceIssues with Prettier's Command Line Interfacearea:ignore.prettierignore file, --ignore-path CLI option, /* prettier-ignore */ comments and so on.prettierignore file, --ignore-path CLI option, /* prettier-ignore */ comments and so ontype:perfIssue with performance of PrettierIssue with performance of Prettier
Metadata
Metadata
Assignees
Labels
area:cliIssues with Prettier's Command Line InterfaceIssues with Prettier's Command Line Interfacearea:ignore.prettierignore file, --ignore-path CLI option, /* prettier-ignore */ comments and so on.prettierignore file, --ignore-path CLI option, /* prettier-ignore */ comments and so ontype:perfIssue with performance of PrettierIssue with performance of Prettier
Environments:
Steps to reproduce:
Expected behavior:
Does not walk down any folder in
a_deeply_nested_structure. Prettier finishes instantly.Actual behavior:
globdoes walk downa_deeply_nested_structure. They get ignored in the end by prettier but this can slow down runtime heavily if we want to ignore big folders. You can check this by inspectingprettier/src/cli/util.js
Lines 444 to 452 in d480858
Is there a reason why the ignore patterns are not passed to
node-glob?If I got this right this behavior was request by #3590 but in my opinion it should be the responsibility of the extension to get knowledge of
.prettierignore. As of right now the cli is very slow when someone has to ignore paths other than node_modules.