Is there a way to tell specify the files to format (not the ones to ignore!)
See original GitHub issueI know of prettier.ignorePath, prettier.disableLanguages and the .prettierignore file. But they all exclude some files.
I want to be able to tell the Prettier extension to only format .ts and .json files. Is this possible?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Ignoring Code - Prettier
Use .prettierignore to ignore (i.e. not reformat) certain files and folders completely. Use “prettier-ignore” comments to ignore parts of files.
Read more >.gitignore file - ignoring files in Git | Atlassian Git Tutorial
There is no explicit git ignore command: instead the .gitignore file must be edited and committed by hand when you have new files...
Read more >gitignore Documentation - Git
DESCRIPTION. A gitignore file specifies intentionally untracked files that Git should ignore. Files already tracked by Git are not affected; see the NOTES ......
Read more >Turning off eslint rule for a specific file - Stack Overflow
There are 3 ways you can do this: You can go with 1.2 and add /* eslint-disable */ on top of the files,...
Read more >How to Use a .gitignore File - Pluralsight
When you make commits in a git repository, you choose which files to stage ... It lets Git know that it should ignore...
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

["javascript","javascriptreact","typescript","typescriptreact","json","jsonc","css","postcss","less","scss","graphql","markdown","vue"]these are all supported languages.You will have to add every languages you don’t want in
prettier.disableLanguagesIn @electrotype 's example:
prettier.disableLanguages: ["javascript","javascriptreact","typescriptreact","css","postcss","less","scss","graphql","markdown","vue"]ie everything but the ones you want :"typescript","json","jsonc"It’s not possible to add a language. HTML is not supported by prettier yet
You can also do this in workspace
settings.json: