Configuration file support
See original GitHub issueI think it would be valuable to support for some type of file that contains prettier’s config so that projects can check it in source control.
I can see 2 cases where this would be useful.
- Allow tools to know that the project is using prettier. I’d like to enable thing like format on save but I don’t want to reformat everyfile I touch on a project that doesn’t use prettier.
- Allow per project config to avoid the need to change options when changing projects or to have to create custom formating scripts.
Could be it’s own file (something like .editorconfig
) or maybe part of package.json
.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:69
- Comments:26 (6 by maintainers)
Top Results From Across the Web
The 3 Best Config File Formats - Jonathan Hall
There are countless configuration file formats. Some are custom-designed for a ... Go's Viper package supports 6 distinct file formats.
Read more >What is a configuration file? - Red Hat
A configuration (config) file is code on your computer that allows the selection of various features and settings. It can determine parameters, ...
Read more >What is configuration file? | Definition from TechTarget
A configuration file, often shortened to config file, defines the parameters, options, settings and preferences applied to operating systems (OSes), ...
Read more >Configuration file - Wikipedia
In computing, configuration files are files used to configure the parameters and initial settings for some computer programs.
Read more >What is a config file? - Opensource.com
They allow you to customize how you interact with an application or how an application interacts with the rest of your system. It's...
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
We aim to be zero-config. For now at least, I am against this. The few existing config options only exist to help applying to existing projects, and should only be used if you really need to. We will see what happens over time, but for now I’ll point you to https://github.com/jlongster/prettier/issues/40
The problem is that not everyone will adopt a tool like this all at once, thus the “generic format” for text needs to match the project’s existing conventions. Disallowing config will mean that adopting prettier is an all-or-nothing approach, unless the project just happens to already comply with the convention prettier chooses, which - for the exact reasons you mention that the ecosystem could benefit from this tool - will prevent adoption of it, on any larger scale.