This repository has been archived by the owner. It is now read-only.

Style Guide

Kohei Yoshino edited this page May 13, 2016 · 7 revisions

General

  • Indents: 2 spaces
  • Line breaks: 120 characters

Markup

CSS

  • Use single quotations.

ECMAScript

  • Use const for namespaces.
  • Use let per variable for a better readability and diffability. Don't use const for variables because it's confusing.
  • Never use camel case for variables.
  • Use single quotations for strings. Use backticks for template strings. Use double quotations for selectors.
  • Object property names are not quoted so shorthand property names can be easily combined.
// Bad
let obj = { 'foo': 1, 'bar': 2 'baz': baz },
    arr = [],
    str = 'a',
    num = 1,
    a, b;
// Good
let obj = { foo: 1, bar: 2, baz };
let arr = [];
let str = 'a';
let num = 1;
let a;
let b;
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.