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
Add "target_files" option to config file #3764
Comments
Similar to #3460 but in config file. If we're going to add this feature, I'd expect |
How about adding an |
Oh that's a good idea. Ignore certain patterns by setting requirePragma. I'll have to steal that. |
After second thought, I think using prettier "**/*.{js,ts,css}" --write {
"requirePragma": true,
"overrides": [
{
"files": ["glob-you-want-to-format"],
"excludeFiles": ["glob-you-want-to-ignore"],
"options": { "requirePragma": false }
}
]
} Feel free to reopen if it does not address the issue. |
@ikatyang Thanks a lot! This solves most of my issue, although there's still one improvement I'd love to be able to make. At the moment, I have my file glob ( The |
Current behavior:
No option (as far as I can tell) to specify the glob I want to target in the .prettierrc config file.
Expected behavior:
It would be great to have a "target_files" option in the .prettierrc config file, which would allow you to specify which files you want prettier to target. That way, I could configure my editor's prettier linter only to change files that match the glob. Right now, there seems to be a .prettierignore file which my editor's linter can use, but .prettierignore only allows blacklisting files instead of whitelisting files.
I hope this request makes sense! I love prettier - thanks for all your awesome work.
The text was updated successfully, but these errors were encountered: