-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Feature: handle .prettierignore location like .gitignore and .npmignore #4081
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 onstatus:needs discussionIssues needing discussion and a decision to be made before action can be takenIssues needing discussion and a decision to be made before action can be taken
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 onstatus:needs discussionIssues needing discussion and a decision to be made before action can be takenIssues needing discussion and a decision to be made before action can be taken
Suggested feature: handle .prettierignore files like .gitignore and .npmignore files, allowing them at any level of the project, not only root.
Use-case:
Using prettier in sub-projects and their "container" projects, where they are editable both from within a sub-projects repository, as well as the container repository.
Examples: git submodules, git subtree, git subrepo, and mechanisms to sync mono- and sub-repos such as splitsh
In this case, we may need a .prettierignore file that is specific to a sub-project and is located at the sub-tree root rather than the project root. Otherwise, we need duplicate .prettierignore declarations with different paths in the sub-project repo and in the container repo.
From git docs:
From npm docs: