DEV Community

Discussion on: Files every open-source project should have

Collapse
abhinav1217 profile image
Abhinav Kulshreshtha • Edited on

For your .editorconfig, Do include following lines if you want to make sure your markdown files doesn't get messed up.

[*.{md,mdx,markdown,txt}]
        trim_trailing_whitespace = false
Enter fullscreen mode Exit fullscreen mode

Also if project can expect newbies or beginner level contributors, I also prefer to set default charset to UTF-8 because sometimes on some editors on windows, its not set as default.

Another point I recently started adopting, it to set indent_size to a designated value specially if you are using spaces, because I actually prefer size 4 at least but many editors including vscode have size 2 as default which for me is too low. I also met some old school c programmers which set tab size to 8 for them.

I don't want to get into holy war tab vs spaces but recently for a new project I started setting default indent to tabs instead of spaces ( mostly because of aforementioned old school c programmers with 8 tab width having conflict with new python programmer with 2 tab width. ) with a reason given to me as "count the indentations, size of indents doesn't matter" . This dev article inspired me to do that. But in the end, it is personal preferences.

Collapse
msaaddev profile image
Saad Irfan Author

Hey! You are absolutely right about all this. The sample I gave is an example of contents you have in .editorconfig. Because if you look up any of my OS projects, you will find I have all these set in my .editorconfig file. But I didn't know about the markdown thingy. Thanks for that!

P.S. I also prefer tab size of 4. I have configured my VSCode to use tab size 4. :D

Collapse
aohorodnyk profile image
Anton Ohorodnyk

Thanks for .editorconfig file, I did not know about it, but it’s must to use!