diff --git a/README.md b/README.md index 75c818cbd6..4690b764c6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -# Airbnb JavaScript Style Guide() { - -*A mostly reasonable approach to JavaScript* +# My personal JavaScript Style Guide() { +Based on [Airbnb JavaScript Style Guide() {](https://github.com/airbnb/javascript) +The main difference is "Use soft tabs set to 2 4 spaces", which, in my view, exposes bad coders (serial indenters) ## Table of Contents @@ -727,12 +727,12 @@ ## Whitespace - - Use soft tabs set to 2 spaces + - Use soft tabs set to 4 spaces ```javascript // bad function() { - ∙∙∙∙var name; + ∙∙var name; } // bad @@ -742,7 +742,7 @@ // good function() { - ∙∙var name; + ∙∙∙∙var name; } ``` - Place 1 space before the leading brace. diff --git a/linters/SublimeLinter/SublimeLinter.sublime-settings b/linters/SublimeLinter/SublimeLinter.sublime-settings index 5c4e5dd382..9020c9ca88 100644 --- a/linters/SublimeLinter/SublimeLinter.sublime-settings +++ b/linters/SublimeLinter/SublimeLinter.sublime-settings @@ -32,11 +32,15 @@ * ENFORCING OPTIONS * ================= */ - + + "boss": true, + // Force all variable names to use either camelCase style or UPPER_CASE // with underscores. "camelcase": true, - + + curly: true, + // Prohibit use of == and != in favor of === and !==. "eqeqeq": true, @@ -44,16 +48,22 @@ "eqnull": true, // Enforce tab width of 2 spaces. - "indent": 2, - + "indent": 4, + + "immed": true, + // Prohibit use of a variable before it is defined. - "latedef": true, + "latedef": "nofunc", // Require capitalized names for constructor functions. "newcap": true, + + "noarg": true, // Enforce use of single quotation marks for strings. "quotmark": "single", + + "sub": true, // Prohibit trailing whitespace. "trailing": true, @@ -62,7 +72,7 @@ "undef": true, // Warn when variables are defined but never used. - "unused": true, + "unused": "vars", // Enforce line length to 80 characters "maxlen": 80