Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure ignore files, from the prettier config file #13088

Closed
sean-au opened this issue Jul 10, 2022 · 7 comments
Closed

Configure ignore files, from the prettier config file #13088

sean-au opened this issue Jul 10, 2022 · 7 comments
Labels
type:duplicate Issues that are a duplicate of a previous issue

Comments

@sean-au
Copy link

sean-au commented Jul 10, 2022

Environments:

  • Prettier Version: 2.7.1
  • Running Prettier via: node.js
  • Runtime:
  • Operating System: node.js
  • Prettier plugins (if any):

Steps to reproduce:

Expected behavior:

.prettierrc.json

{
"ignoreFiles" : [ "/build/**"}
}

Actual behavior:

Its not possible add an ignore config to prettiers config file (based on the docs).
The only ways seems to be to have to use a .prettierignore file.
While this is easy, its one more config file to deal with. EsLint and Sylelint both allow setting ignores in the config file.

@sosukesuzuki
Copy link
Member

Do you have a use case you would like to write in .prettierrc instead of .prettierignore? At least for me, .prettierignore is enough.

@sosukesuzuki sosukesuzuki added type:enhancement A potential new feature to be added, or an improvement to how we print something status:awaiting response Issues that require answers to questions from maintainers before action can be taken labels Jul 10, 2022
@sean-au
Copy link
Author

sean-au commented Jul 10, 2022 via email

@mtqperson
Copy link

mtqperson commented Jul 11, 2022

I was also looking for this after discovering ESLint's ignorePatterns in the config file instead of .eslintignore. It could reduce the number of configuration files, and potentially make it easier to reuse ignore patterns between ESLint and Prettier.

@sean-au
Copy link
Author

sean-au commented Aug 21, 2022

I believe this is required to bring prettier's configuration behavior in line with ESLint and StyleLint.

@kachkaev
Copy link
Member

kachkaev commented Oct 19, 2022

I like this suggestion by @ivodolenc: #12672 (comment) (ignorePatterns in prettier.config.js like in ESLint)

@kevinwolfcr
Copy link

This would be super easy for sharing configuration and ignored files. @fisker any plans to implement this? It's not a breaking change and an opt-in feature.

@kachkaev
Copy link
Member

kachkaev commented Nov 2, 2022

@kevinwolfcr there exists a work-in-progress PR that aims to do something similar: #12672. #3460 is the main discussion thread for this feature request. That other issue is named a bit differently, but comments suggest to use the same approach as here (search for ignorePatterns). Let's close this one as duplicate to keep the discussion in one place.

@kachkaev kachkaev closed this as not planned Won't fix, can't repro, duplicate, stale Nov 2, 2022
@kachkaev kachkaev added type:duplicate Issues that are a duplicate of a previous issue and removed type:enhancement A potential new feature to be added, or an improvement to how we print something status:awaiting response Issues that require answers to questions from maintainers before action can be taken labels Nov 2, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type:duplicate Issues that are a duplicate of a previous issue
Projects
None yet
Development

No branches or pull requests

5 participants