diff --git a/README.md b/README.md index a4f1d51d69..7847e54bf3 100644 --- a/README.md +++ b/README.md @@ -637,6 +637,25 @@ } ``` + - Use "cuddled else" (aka [1TBS](http://en.wikipedia.org/wiki/Indent_style#Variant:_1TBS)) braces for if-else blocks. + + ```javascript + // bad + if (test) { + return false; + } + else { + return true; + } + + // good + if (test) { + return false; + } else { + return true; + } + ``` + **[⬆ back to top](#table-of-contents)** @@ -735,12 +754,12 @@ ## Whitespace - - Use soft tabs set to 2 spaces + - Use soft tabs set to 4 spaces ```javascript // bad function() { - ∙∙∙∙var name; + ∙∙var name; } // bad @@ -750,7 +769,7 @@ // good function() { - ∙∙var name; + ∙∙∙∙var name; } ``` diff --git a/linters/jshintrc b/linters/jshintrc index cc6e398b40..784a2637ce 100644 --- a/linters/jshintrc +++ b/linters/jshintrc @@ -25,14 +25,14 @@ // Prohibit use of == and != in favor of === and !==. "eqeqeq": true, - // Enforce tab width of 2 spaces. - "indent": 2, + // Enforce tab width of 4 spaces. + "indent": 4, // Prohibit use of a variable before it is defined. "latedef": true, // Enforce line length to 80 characters - "maxlen": 80, + // "maxlen": 80, // Require capitalized names for constructor functions. "newcap": true, @@ -41,7 +41,11 @@ "quotmark": "single", // Enforce placing 'use strict' at the top function scope - "strict": true, + // "strict": true, + + // do not complain for lack of 'use strict'; + "globalstrict": false, + "strict": false, // Prohibit use of explicitly undeclared variables. "undef": true, @@ -49,6 +53,9 @@ // Warn when variables are defined but never used. "unused": true, + // Use JS ES5 + "es5": true + /* * RELAXING OPTIONS * =================