Skip to content

Instantly share code, notes, and snippets.

@Billy-
Last active August 29, 2015 14:27
Show Gist options
  • Save Billy-/4d7d0b8e54106ab29073 to your computer and use it in GitHub Desktop.
Save Billy-/4d7d0b8e54106ab29073 to your computer and use it in GitHub Desktop.
Here are the conventions that we should adhere to as a team in order to create consistency between our work. General guidelines below followed by more specific settings for editors that have been used by the team.

Code Style Guidelines

Here are the conventions that we should adhere to as a team in order to create consistency between our work. General guidelines below followed by more specific settings for editors that have been used by the team.

General guidelines

  • Don't save out files with trailing whitespace
  • Put a newline at the end of the file
  • Use Unix style (LF) line endings

JavaScript

  • Indent with spaces
  • 4 space indents

Sass

  • Indent with spaces
  • 2 space indents

HTML

  • Indent with spaces
  • 2 space indents

Settings for editors

Sublime

General – Preferences.sublime-settings

Under Preferences > Settings – User:

{
	"default_line_ending": "unix",
	"ensure_newline_at_eof_on_save": true
}

JavaScript – JavaScript.sublime-settings

With a JavaScript file open go under Preferences > Settings – More > Syntax Specific – User:

{
	"tab_size": 4,
	"translate_tabs_to_spaces": true,
	"trim_trailing_white_space_on_save": true
}

Sass - Sass.sublime-settings

With a Sass file open go under Preferences > Settings – More > Syntax Specific – User:

{
	"tab_size": 2,
	"translate_tabs_to_spaces": true,
	"trim_trailing_white_space_on_save": true
}

HTML/Handlebars - HTML.sublime-settings

With a Handlebars file open go under Preferences > Settings – More > Syntax Specific – User:

{
	"tab_size": 2,
	"translate_tabs_to_spaces": true,
	"trim_trailing_white_space_on_save": true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment