diff --git a/pages/style-guide/js.md b/pages/style-guide/js.md index 56c8b135..86381fce 100644 --- a/pages/style-guide/js.md +++ b/pages/style-guide/js.md @@ -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, @@ -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 @@ -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`.