dwyl / style-guide

:newspaper: dwyl's visual and coding style guide
GNU General Public License v2.0
24 stars 13 forks source link

Single quotes or double quotes? #5

Closed tsop14 closed 9 years ago

tsop14 commented 9 years ago

Double quotes "" for html Single quotes '' for everything else

???

screen shot 2015-08-12 at 11 16 50

nelsonic commented 9 years ago

I prefer single quotes all-the-things ... However they are not valid JSON:

json-lint-single-quotes

nelsonic commented 9 years ago

Rule of thumb:

use single-quotes everywhere. except when constructing a string which includes styles or properties which are themselves denoted by single-quotes: e.g: var str = "<a class='big' href='/mylink'>click me</a>"; And when manually creating a JSON object/file

tsop14 commented 9 years ago

@dwyl/summer