Shift3 / standards-and-practices

Standards and Practices for Bitwise Industries
https://shift3.github.io/standards-and-practices/
63 stars 41 forks source link

Add docs for EditorConfig #307

Closed dmpayton closed 2 years ago

dmpayton commented 2 years ago

I'm a big fan of consistent code styling, and an even bigger fan of automating that process as much as possible.

EditorConfig helps maintain consistent coding styles for multiple developers working on the same project across various editors and IDEs. Many editors and IDEs support it natively, and many others support it via plugins.

Here's the .editorconfig file we used at Ordrslip, which can be easily expanded to include all of the common languages used at BWTC and can be easily dropped into new and existing projects:

# http://editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

[*.{js,jsx}]
indent_size = 2

Since this affects all code – front-end, back-end, and everything in between and beyond – the best place I can see for this to live would be the root of the best-practices directory.

The easy part is creating the .md file that explains what EditorConfig does and provides a sample. The hard part is coming up with the standards that should be included in that sample. ;)

dmpayton commented 2 years ago

On further reading, this might fit best under the "Project Setup" section of the S&P README, which (I think) would put it in the standards directory.

Open to suggestions!

michaelachrisco commented 2 years ago

I vote for standards with a README. We have over 155 examples of it being used within the org as it turns out. It would be nice to have a standard example.

Thanks for bringing this up!

michaelachrisco commented 2 years ago

Actually a better spot might be https://github.com/Shift3/standards-and-practices/tree/main/best-practices/development-tools as we have a collection of development tools and how to use them.