vgno-coding-standards
Advanced tools
Comparing version 4.0.0 to 5.0.0
@@ -6,3 +6,3 @@ { | ||
}, | ||
"version": "4.0.0", | ||
"version": "5.0.0", | ||
"description": "VG.no coding standards", | ||
@@ -9,0 +9,0 @@ "main": "index.js", |
@@ -140,2 +140,4 @@ JavaScript CodeStyle | ||
* Each `var` statement should have only one variable declared in it. | ||
**Good:** | ||
@@ -147,5 +149,5 @@ | ||
var object = {}, key; | ||
var object = {}; | ||
while (items.length) { | ||
key = keys.pop(); | ||
var key = keys.pop(); | ||
object[key] = values.pop(); | ||
@@ -158,4 +160,6 @@ } | ||
```javascript | ||
var keys = ['foo', 'bar'], values = [23, 42]; | ||
var object = {}; | ||
var keys = ['foo', 'bar'], | ||
values = [23, 42], | ||
object = {}, | ||
key; | ||
@@ -466,3 +470,3 @@ while (items.length) { | ||
##undefined | ||
Checking for `undefined` values should be done using the strict equality operator. | ||
Checking for `undefined` values can be done using either the strict equality operator or using `typeof`. | ||
@@ -474,6 +478,9 @@ **Good:** | ||
**Bad:** | ||
**Accepted:** | ||
```javascript | ||
typeof x === 'undefined' | ||
``` | ||
**Bad:** | ||
```javascript | ||
x === void 0 | ||
@@ -715,2 +722,15 @@ ``` | ||
We encourage and suggest our developers to use [ESLint](http://eslint.org/) as the primary linting tool, since it supports the largest number of rule checks and does both linting and style checks. | ||
###ESLint | ||
Please use [ESLint](http://eslint.org/) with the `eslint-config-vgno`-package from NPM: | ||
``` | ||
npm install --save eslint-config-vgno | ||
echo '{ "extends": "vgno" }' > .eslintrc | ||
``` | ||
Alternatively, the `.eslintrc` config found in this repository can be used. | ||
###JSHint | ||
@@ -724,5 +744,1 @@ | ||
Please use [JSCS](http://jscs.info/) with the `.jscsrc` config found in this repository. | ||
###ESLint | ||
Please use [ESLint](http://eslint.org/) with the `.eslintrc` config found in this repository. |
Sorry, the diff of this file is not supported yet
27744
738