I'm trying to use prettier with editorconfig but prettier doesn't respect
See original GitHub issueI have this .editorconfig
file and it works fine:
# http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
If I enable prettier it doesn’t respect the editorconfig
and keeps adding final new line ven for the .md
files.
How to fix this?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Prettier does not consistently respect .prettierrc, .eslintrc nor ...
I have a .prettierrc file, a .eslintrc file and even vscode settings with the same 80 print-width settings, but the extension just doesn't...
Read more >Prettier vscode extension ignoring config files - Stack Overflow
In VS Code press Ctrl + shift + p to open command palette then chose. Preferences: Open Settings(JSON) and add the line among...
Read more >How to configure Prettier and VSCode - Gleb Bahmutov
This blog post shows how to configure Prettier to work from command line, from VSCode and from Git hooks.
Read more >Options - Prettier
Prettier's printWidth option does not work the same way. It is not the hard upper allowed line length limit. It is a way...
Read more >Set up ESlint, Prettier & EditorConfig without conflicts | Theodo
Configure ESLint, Prettier and EditorConfig together without conflicts on projects using Vue, React, TypeScript or any other Framework with ...
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 FreeTop 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
Top GitHub Comments
Hi!
Prettier ends all files with a single newline, and there’s no way to disable that.
Prettier can look at your .editorconfig file to set some Prettier options. But as there’s no option to disable the final newline, Prettier can’t do anything for
trim_final_newline = false
. According to the docs, Prettier supports the following EditorConfig properties:So my
.editorconfig
should look like this:To imply the end of line and charset of the files, right?