Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 0 additions & 47 deletions pages/style-guide/js.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ The following common options must be used in all projects:
"expr": true,
"immed": true,
"noarg": true,
"onevar": true,
"quotmark": "double",
"smarttabs": true,
"trailing": true,
Expand Down Expand Up @@ -68,12 +67,10 @@ In general, the jQuery style guide encourages liberal spacing for improved human
### Bad Examples

```js

// Bad
if(condition) doSomething();
while(!condition) iterating++;
for(var i=0;i<100;i++) object[array[i]] = someFn(i);

```

### Good Examples
Expand Down Expand Up @@ -292,50 +289,6 @@ For UMD, the factory is indented to visually differentiate it from the body.
}));
```

## Assignments

Assignments in a declaration must be on their own line. Declarations that don't have an assignment must be listed together at the start of the declaration. Each line after the initial line must be indented once. For example:

```js
// Bad
var foo = true;
var bar = false;
var a;
var b;
var c;

// Good
var a, b, c,
foo = true,
bar = false,
obj = {
a: b,
c: d,
},
arr = [
a,
b,
c
],
fn = function() {
body();
};
```

Exception: When a declaration has a single multiline assignment, the subsequent lines are not indented.

```js
// Good
var fn = function() {
body();
};

// Bad
var fn = function() {
body();
};
```

## Equality

Strict equality checks (`===`) must be used in favor of abstract equality checks (`==`). The _only_ exception is when checking for `undefined` and `null` by way of `null`.
Expand Down