foundation / foundation-sites

The most advanced responsive front-end framework in the world. Quickly create prototypes and production code for sites that work on any kind of device.
https://get.foundation
MIT License
29.65k stars 5.48k forks source link

Consider adding an .editorconfig #4720

Closed tmugford closed 10 years ago

tmugford commented 10 years ago

Something like the following, as a starting point at least.

root = true

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

http://editorconfig.org/

vinayraghu commented 10 years ago

:+1:

thedeerchild commented 10 years ago

Could definitely be helpful. Want to reformat this as a PR? :)

tmugford commented 10 years ago

Hey @thedeerchild,

Sure, can do. There are a couple of caveats that I should mention though:

I could also investigate adding some kind of linter, say grunt-lintspaces for example, which would help to mitigate the last point.

Let me know your thoughts.

thedeerchild commented 10 years ago

All or most of the files should already be indented with two spaces, so that part is fine. I'm not too worried about PRs coming in with spaces to trailing whitespace/newlines since those are easy to spot as trivial changes in the diff.

Adding a linter as part of the grunt process could be interesting as well, since that should fix or warn about the indentation issue before people submit their PRs (assuming they test their code, which they should be).

tmugford commented 10 years ago

4764 doesn't include grunt-lintspaces for a few reasons:

I think it's still something that could be implemented in a future PR, but it probably warrants some more careful consideration.