JavaScript Standard Style: Rules — Part 1

Use 2 spaces for indentation.

function hello (name) {
console.log('hi', name)
}

Use single quotes for strings except to avoid escaping.

console.log('hello there')
$("<div class='box'>")

No unused variables.

function myFunction () {
var result = something() // ✗ avoid
}

Add a space after keywords.

if (condition) { ... }   // ✓ ok
if(condition) { ... } // ✗ avoid