Ignore commonly generated folders
See original GitHub issueAt the moment, Prettier ignores node_modules/. In my experience, folders coverage and dist are commonly used to contain generated artifacts and could be ignored accordingly, as a sensible default.
If someone really needs to include those, adding !coverage/ and/or !dist/ in .prettierignore should re-include them.
Thoughts? š
Issue Analytics
- State:
- Created 5 years ago
- Reactions:14
- Comments:13 (4 by maintainers)
Top Results From Across the Web
.gitignore File ā How to Ignore Files and Folders in Git
A . gitignore file is a plain text file that contains a list of all the specified files and folders from the project...
Read more >Ignoring Files and Directories in Git (.gitignore) - Linuxize
Ignored files are usually platform-specific files or automatically created files from the build systems. Some common examples include:.
Read more >gitignore - ignore generated files in a folder, but not the folder
I have a gulp task that pipes assets into a directory. I would like to include the directory in my project, but exclude...
Read more >Ignoring files, folders, or code - Semgrep
Exclude specific files, folders or parts of code from results of Semgrep scans in your repository or working directory. Semgrep does not generate...
Read more >.gitignore file - ignoring files in Git | Atlassian Git Tutorial
Git sees every file in your working copy as one of three things: ... Ignored files are usually build artifacts and machine generated...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think all entries in
.gitignoreshould be ignored by Prettier without the need to specify--ignore-path .gitignore. The.gitignoreshould be a constant with the option to additionally use a.prettierignore. I think this is sensible because I cannot think of a reason as to why a file that is not version controlled would need to be formatted. With this, many projects may not even need to add a.prettierignore. A.prettierignoreis particularly useful for ignoring files that are version controlled because that cannot be done with a.gitignore.I think itās safe to say that eventually Prettier will face the same requests from the community as ESLint did. So I suggest following ESLintās ignore features: https://eslint.org/docs/user-guide/configuring#ignoring-files-and-directories
Specifically:
--ignore-path.npx prettier --ignore-pattern ...would be really nice.ignorePatternsproperty in Prettier configurations./* prettier-disable */block comment at the top of the file (Disabling Rules with Inline Comments)An alternative would be to always include
.prettierignoreand let--ignore-pathmerge on top of that. Or support several--ignore-pathcommands. But that would be confusing IMO.