diff --git a/README.md b/README.md index 02ecc75ee6..32ce06075d 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,6 @@ -[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/airbnb/javascript?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) - -# Airbnb JavaScript Style Guide() { - -*A mostly reasonable approach to JavaScript* +# Conde Nast JavaScript Style Guide() { +*A mostly reasonable approach to JavaScript—forked from Conde Nast, originally written by [Airbnb](https://github.com/Airbnb/javascript).* ## Table of Contents @@ -27,6 +24,7 @@ 1. [Constructors](#constructors) 1. [Events](#events) 1. [Modules](#modules) + 1. [React](#react) 1. [jQuery](#jquery) 1. [ECMAScript 5 Compatibility](#ecmascript-5-compatibility) 1. [Testing](#testing) @@ -35,7 +33,7 @@ 1. [In the Wild](#in-the-wild) 1. [Translation](#translation) 1. [The JavaScript Style Guide Guide](#the-javascript-style-guide-guide) - 1. [Chat With Us About Javascript](#chat-with-us-about-javascript) + 1. [Chat With Airbnb About Javascript](#chat-with-airbnb-about-javascript) 1. [Contributors](#contributors) 1. [License](#license) @@ -279,7 +277,7 @@ // immediately-invoked function expression (IIFE) (function() { console.log('Welcome to the Internet. Please follow me.'); - })(); + }()); ``` - Never declare a function in a non-function block (if, while, etc). Assign the function to a variable instead. Browsers will allow you to do it, but they all interpret it differently, which is bad news bears. @@ -619,14 +617,14 @@ ## Blocks - - Use braces with all multi-line blocks. + - Use braces with all blocks. ```javascript // bad if (test) return false; - // good + // bad if (test) return false; // good @@ -733,26 +731,20 @@ } ``` - - Prefixing your comments with `FIXME` or `TODO` helps other developers quickly understand if you're pointing out a problem that needs to be revisited, or if you're suggesting a solution to the problem that needs to be implemented. These are different than regular comments because they are actionable. The actions are `FIXME -- need to figure this out` or `TODO -- need to implement`. - - - Use `// FIXME:` to annotate problems. + - Prefixing your comments with `@TODO` helps other developers quickly understand if you're pointing out a problem that needs to be revisited, or if you're suggesting a solution to the problem that needs to be implemented. These are different than regular comments because they are actionable. The actions are `@TODO -- need to figure this out` or `@TODO -- need to implement`. Note the leading `@`— this is a [JSDoc](http://usejsdoc.org/) comment. Make sure you initial and date your comment; future developers (including future you) will thank you. ```javascript function Calculator() { - // FIXME: shouldn't use a global here + // @TODO shouldn't use a global here (pg 28 Apr 2015) total = 0; return this; } - ``` - - - Use `// TODO:` to annotate solutions to problems. - ```javascript function Calculator() { - // TODO: total should be configurable by an options param + // @TODO total should be configurable by an options param (eqw 28 Apr 2015) this.total = 0; return this; @@ -846,25 +838,25 @@ - End files with a single newline character. ```javascript - // bad + // good (function(global) { // ...stuff... - })(this); + }(this));↵ ``` ```javascript // bad (function(global) { // ...stuff... - })(this);↵ - ↵ + }(this)); ``` ```javascript - // good + // bad (function(global) { // ...stuff... - })(this);↵ + }(this));↵ + ↵ ``` - Use indentation when making long method chains. Use a leading dot, which @@ -944,6 +936,7 @@ return obj; ``` + - Trailing whitespace is an error. **Please set your editor or IDE to strip trailing whitespace on save**, or at least set it to make trailing whitespace visible so you can remove it yourself. **[⬆ back to top](#table-of-contents)** @@ -1023,19 +1016,19 @@ (function() { var name = 'Skywalker' return name - })() + }()) // good (function() { var name = 'Skywalker'; return name; - })(); + }()); // good (guards against the function becoming an argument when two files with IIFEs are concatenated) ;(function() { var name = 'Skywalker'; return name; - })(); + }()); ``` [Read more](http://stackoverflow.com/a/7365214/1712802). @@ -1456,6 +1449,51 @@ **[⬆ back to top](#table-of-contents)** +## React +Our React style is mostly influenced by [David Chang's style guide](https://reactjsnews.com/react-style-guide-patterns-i-like/). Exceptions are enumerated below. + + - Since `displayName` is automatically set by React after calling `React.createClass()` and transpiling from JSX to JavaScript, there's no need to explicitly include one: + + ```javascript + // Preferred + React.createClass({ + propTypes: {}, + mixins: [], + getInitialState: function () {}, + componentWillMount: function () {}, + componentWillUnmount: function () {}, + render: function() {} + }); + + // Not preferred + React.createClass({ + displayName: '', + propTypes: {}, + mixins: [], + getInitialState: function () {}, + componentWillMount: function () {}, + componentWillUnmount: function () {}, + render: function () {} + }); + ``` + + - When it comes to conditionals, we tend to prefer `&&` to ternaries and will often use `&&` rather than breaking logic out into separate methods: + + ```javascript + renderContent: function () { + var content = +
+ {this.props.foo &&
} + {this.props.isTruthy && } + {this.props.isTruthy && this.renderMyComponent()} +
; + + return this.buildContent(content); + }, + ``` + +**[⬆ back to top](#table-of-contents)** + ## jQuery - Prefix jQuery object variables with a `$`. @@ -1547,7 +1585,6 @@ - [jQuery Find vs Context, Selector](http://jsperf.com/jquery-find-vs-context-sel/13) - [innerHTML vs textContent for script text](http://jsperf.com/innerhtml-vs-textcontent-for-script-text) - [Long String Concatenation](http://jsperf.com/ya-string-concat) - - Loading... **[⬆ back to top](#table-of-contents)** @@ -1629,7 +1666,7 @@ ## In the Wild - This is a list of organizations that are using this style guide. Send us a pull request or open an issue and we'll add you to the list. + This is a list of organizations that are using this style guide. - **Aan Zee**: [AanZee/javascript](https://github.com/AanZee/javascript) - **Adult Swim**: [adult-swim/javascript](https://github.com/adult-swim/javascript) @@ -1703,9 +1740,9 @@ - [Reference](https://github.com/airbnb/javascript/wiki/The-JavaScript-Style-Guide-Guide) -## Chat With Us About JavaScript +## Chat With Airbnb About JavaScript - - Find us on [gitter](https://gitter.im/airbnb/javascript). + - Find Airbnb on [gitter](https://gitter.im/airbnb/javascript). ## Contributors diff --git a/linters.md b/linters.md new file mode 100644 index 0000000000..a51423615c --- /dev/null +++ b/linters.md @@ -0,0 +1,46 @@ +Using ESLint with Your Editor +============================= + +Linting works best when automated; below are instructions for integrating ESLint with your editor/IDE of choice. If yours isn't listed, please make a PR to add it! You can also check out ESLint's guide to editor integration [here](http://eslint.org/docs/user-guide/integrations.html). + +## Contents +* [Atom](#atom) +* [Emacs](#emacs) +* [Sublime](#sublime) +* [Vim](#vim) + +## Atom +[linter-eslint](https://atom.io/packages/linter-eslint) can be installed via `$ npm install linter-eslint`. + +[⬆ back to top](#contents) + +## Emacs +[Flycheck](https://github.com/flycheck/flycheck) is probably your best bet. [This tutorial](http://codewinds.com/blog/2015-04-02-emacs-flycheck-eslint-jsx.html) walks you through installation and configuration for ESLint, including great information on Babel.io and React/JSX integration. + +[⬆ back to top](#contents) + +## SublimeText +[SublimeLinter-eslint](https://github.com/roadhump/SublimeLinter-eslint) is maintained and seems to work well (requires [SublimeLinter 3](http://sublimelinter.readthedocs.org/en/latest/)). + +[⬆ back to top](#contents) + +## Vim +[Syntastic](https://github.com/scrooloose/syntastic) is your best bet. Install it via [Pathogen](https://github.com/tpope/vim-pathogen) and ensure the following are in your `.vimrc`: + +```vimscript +" Use Pathogen +execute pathogen#infect() + +" Settings for Syntastic (https://github.com/scrooloose/syntastic) +set statusline+=%#warningmsg# +set statusline+=%{SyntasticStatuslineFlag()} +set statusline+=%* + +let g:syntastic_always_populate_loc_list = 1 +let g:syntastic_auto_loc_list = 1 +let g:syntastic_check_on_open = 1 +let g:syntastic_check_on_wq = 0 +let g:syntastic_javascript_checkers = ['eslint'] +``` + +[⬆ back to top](#contents) diff --git a/linters/.eslintrc b/linters/.eslintrc index 357f9d9b75..9fb434c536 100644 --- a/linters/.eslintrc +++ b/linters/.eslintrc @@ -1,169 +1,79 @@ { - "parser": "babel-eslint", - "env": { - "browser": true, - "node": true - }, + // ECMAScript 6 features to enable. "ecmaFeatures": { - "arrowFunctions": true, - "blockBindings": true, - "classes": true, - "defaultParams": true, - "destructuring": true, - "forOf": true, - "generators": false, - "modules": true, - "objectLiteralComputedProperties": true, - "objectLiteralDuplicateProperties": false, - "objectLiteralShorthandMethods": true, - "objectLiteralShorthandProperties": true, - "spread": true, - "superInFunctions": true, - "templateStrings": true, "jsx": true }, - "rules": { -/** - * Strict mode - */ - // babel inserts "use strict"; for us - // http://eslint.org/docs/rules/strict - "strict": [2, "never"], - -/** - * ES6 - */ - "no-var": 2, // http://eslint.org/docs/rules/no-var - -/** - * Variables - */ - "no-shadow": 2, // http://eslint.org/docs/rules/no-shadow - "no-shadow-restricted-names": 2, // http://eslint.org/docs/rules/no-shadow-restricted-names - "no-unused-vars": [2, { // http://eslint.org/docs/rules/no-unused-vars - "vars": "local", - "args": "after-used" - }], - "no-use-before-define": 2, // http://eslint.org/docs/rules/no-use-before-define -/** - * Possible errors - */ - "comma-dangle": [2, "never"], // http://eslint.org/docs/rules/comma-dangle - "no-cond-assign": [2, "always"], // http://eslint.org/docs/rules/no-cond-assign - "no-console": 1, // http://eslint.org/docs/rules/no-console - "no-debugger": 1, // http://eslint.org/docs/rules/no-debugger - "no-alert": 1, // http://eslint.org/docs/rules/no-alert - "no-constant-condition": 1, // http://eslint.org/docs/rules/no-constant-condition - "no-dupe-keys": 2, // http://eslint.org/docs/rules/no-dupe-keys - "no-duplicate-case": 2, // http://eslint.org/docs/rules/no-duplicate-case - "no-empty": 2, // http://eslint.org/docs/rules/no-empty - "no-ex-assign": 2, // http://eslint.org/docs/rules/no-ex-assign - "no-extra-boolean-cast": 0, // http://eslint.org/docs/rules/no-extra-boolean-cast - "no-extra-semi": 2, // http://eslint.org/docs/rules/no-extra-semi - "no-func-assign": 2, // http://eslint.org/docs/rules/no-func-assign - "no-inner-declarations": 2, // http://eslint.org/docs/rules/no-inner-declarations - "no-invalid-regexp": 2, // http://eslint.org/docs/rules/no-invalid-regexp - "no-irregular-whitespace": 2, // http://eslint.org/docs/rules/no-irregular-whitespace - "no-obj-calls": 2, // http://eslint.org/docs/rules/no-obj-calls - "no-reserved-keys": 2, // http://eslint.org/docs/rules/no-reserved-keys - "no-sparse-arrays": 2, // http://eslint.org/docs/rules/no-sparse-arrays - "no-unreachable": 2, // http://eslint.org/docs/rules/no-unreachable - "use-isnan": 2, // http://eslint.org/docs/rules/use-isnan - "block-scoped-var": 2, // http://eslint.org/docs/rules/block-scoped-var + // Global variables to recognize. + "env": { + "browser": true, + "jasmine": true, + "node": true + }, -/** - * Best practices - */ - "consistent-return": 2, // http://eslint.org/docs/rules/consistent-return - "curly": [2, "multi-line"], // http://eslint.org/docs/rules/curly - "default-case": 2, // http://eslint.org/docs/rules/default-case - "dot-notation": [2, { // http://eslint.org/docs/rules/dot-notation - "allowKeywords": false - }], - "eqeqeq": 2, // http://eslint.org/docs/rules/eqeqeq - "guard-for-in": 2, // http://eslint.org/docs/rules/guard-for-in - "no-caller": 2, // http://eslint.org/docs/rules/no-caller - "no-else-return": 2, // http://eslint.org/docs/rules/no-else-return - "no-eq-null": 2, // http://eslint.org/docs/rules/no-eq-null - "no-eval": 2, // http://eslint.org/docs/rules/no-eval - "no-extend-native": 2, // http://eslint.org/docs/rules/no-extend-native - "no-extra-bind": 2, // http://eslint.org/docs/rules/no-extra-bind - "no-fallthrough": 2, // http://eslint.org/docs/rules/no-fallthrough - "no-floating-decimal": 2, // http://eslint.org/docs/rules/no-floating-decimal - "no-implied-eval": 2, // http://eslint.org/docs/rules/no-implied-eval - "no-lone-blocks": 2, // http://eslint.org/docs/rules/no-lone-blocks - "no-loop-func": 2, // http://eslint.org/docs/rules/no-loop-func - "no-multi-str": 2, // http://eslint.org/docs/rules/no-multi-str - "no-native-reassign": 2, // http://eslint.org/docs/rules/no-native-reassign - "no-new": 2, // http://eslint.org/docs/rules/no-new - "no-new-func": 2, // http://eslint.org/docs/rules/no-new-func - "no-new-wrappers": 2, // http://eslint.org/docs/rules/no-new-wrappers - "no-octal": 2, // http://eslint.org/docs/rules/no-octal - "no-octal-escape": 2, // http://eslint.org/docs/rules/no-octal-escape - "no-param-reassign": 2, // http://eslint.org/docs/rules/no-param-reassign - "no-proto": 2, // http://eslint.org/docs/rules/no-proto - "no-redeclare": 2, // http://eslint.org/docs/rules/no-redeclare - "no-return-assign": 2, // http://eslint.org/docs/rules/no-return-assign - "no-script-url": 2, // http://eslint.org/docs/rules/no-script-url - "no-self-compare": 2, // http://eslint.org/docs/rules/no-self-compare - "no-sequences": 2, // http://eslint.org/docs/rules/no-sequences - "no-throw-literal": 2, // http://eslint.org/docs/rules/no-throw-literal - "no-with": 2, // http://eslint.org/docs/rules/no-with - "radix": 2, // http://eslint.org/docs/rules/radix - "vars-on-top": 2, // http://eslint.org/docs/rules/vars-on-top - "wrap-iife": [2, "any"], // http://eslint.org/docs/rules/wrap-iife - "yoda": 2, // http://eslint.org/docs/rules/yoda + // Style and correctness rules to enforce. + "rules": { + "brace-style": 2, // Enforce the One True Brace style (http://eslint.org/docs/rules/brace-style) (error). + "camelcase": 2, // Requires camelCase for variable names (error). + "comma-dangle": [2, "never"], // No dangling commas (error). + "comma-spacing": [2, { "before": false, "after": true }], // Enforce comma spacing (e.g. { foo: 1, bar: 2 }) (error). + "comma-style": [2, "last"], // Disallows leading comma (error). + "complexity": [1, 4], // Cyclomatic complexity cannot exceed 4 (warning). + "consistent-this": [2, "_this"], // Requires that aliases to `this` be named `_this` (and not, e.g., `that` or `self) (error). + "curly": 2, // Curly braces required for all blocks (error). + "default-case": 2, // All case statements must have a `default` (error). + "dot-notation": 2, // Dot notation (`object.foo`) should be used wherever possible (error). + "eol-last": 2, // Requires one newline at EOF (to make GitHub happy) (error). + "eqeqeq": 2, // Strict (`===`) equality unless checking for `null` and `undefined` (error). + "guard-for-in": 1, // Requires an `if` statement within a `for...in` (warning). + "indent": [2, 2], // Two spaces per indentation level (error). + "key-spacing": [2, { "beforeColon": false, + "afterColon": true }], // Enforces key spacing (e.g. { foo: 1, bar: 2 }) (error). + "new-cap": 2, // Requires variables following `new` to be capitalized (error). + "new-parens": 2, // Disallows omitting parentheses when invoking constructors with no arguments (error). + "no-caller": 2, // Disallows use of `arguments.caller` and `arguments.callee` (error). + "no-debugger": 1, // Disallows use of `debugger;` (warning). + "no-dupe-args": 2, // Disallows duplicate argument names (error). + "no-dupe-keys": 2, // Disallows duplicate object keys (error). + "no-duplicate-case": 2, // Disallows duplicate case labels (error). + "no-eq-null": 0, // Explicitly permits `==` to check for `undefined || null`. + "no-eval": 2, // Disallows use of `eval()` (error). + "no-implied-eval": 2, // Disallow functions that call `eval()` (error). + "no-invalid-regexp": 2, // Disallow invalid regular expressions (error). + "no-mixed-spaces-and-tabs": 2, // Disallow mixed spaces and tabs (error). + "no-redeclare": 2, // Disallow redeclaration of variables (error). + "no-reserved-keys": 2, // Disallow use of reserved words as object keys (can cause minification to blow up) (error). + "no-self-compare": 1, // Disallow comparison to oneself (usually a typo) (warning). + "no-shadow-restricted-names": 2, // Disallow shadowing of restricted names like `arguments` (error). + "no-trailing-spaces": 2, // Disallows trailing whitespace (error). + "no-undef": 2, // Disallow undeclared variables unless they've already been explicitly listed as global (error). + "no-undef-init": 2, // Disallow initializing a variable to `undefined` (error). + "no-underscore-dangle": 0, + "no-unreachable": 2, // Disallow unreachable code (error). + "no-unused-vars": 1, // Disallow declaration of variables that are never used (warning). + "no-use-before-define": 2, // Disallow use of variables before they are defined (error). + "no-with": 2, // Disallow use of `with` (error). + "one-var": [2, "never"], // Enforces separate `var` for each declaration (http://eslint.org/docs/rules/one-var) (error). + "operator-assignment": [2, "always"], // Enforces operator assignment where possible (e.g. `foo *= 2` instead of `foo = foo * 2`) (error). + "quotes": [2, "single"], // Always requires single quotes for strings (error). + "radix": 2, // Requires use of radix parameter in `parseInt()` (error). + "semi": [2, "always"], // Always requires semicolons (instead of depending on ASI) (error). + "semi-spacing": [2, { "before": false, "after": true }], // Enforces no spaces before semicolons and spacing after (http://eslint.org/docs/rules/semi-spacing) (error). + "sort-vars": [1, { "ignoreCase": true }], // Requires var declarations be sorted alphabetically, case-insensitive (warning). + "space-after-keywords": [2, "always"], // Requires spaces after `if`, `while`, &c (error). + "space-before-function-paren": [2, { "anonymous": "always", + "named": "never" }], // Requires a space between `function` and the following `()` (error). + "space-in-parens": [2, "never"], // No spaces inside () (e.g. function (a, b)) (error). + "space-infix-ops": 2, // Requires space around infix operators (e.g. `1 + 2` instead of `1+2`) (error). + "space-unary-ops": [2, { "words": true, "nonwords": false }], // Requires space "outside" unary ops and disallows it "inside" (http://eslint.org/docs/rules/space-unary-ops) (error). + "strict": [2, "global"], // Requires global strict mode (error). + "use-isnan": 2, // Requires `isNaN()` instead of comparison to `NaN` (error). + "valid-jsdoc": 1, // Requires valid JSDoc comments (warning). + "yoda": [2, "never", { "exceptRange": false }] // Disallow Yoda conditionals (http://en.wikipedia.org/wiki/Yoda_conditions) (error). + }, -/** - * Style - */ - "indent": [2, 2], // http://eslint.org/docs/rules/ - "brace-style": [2, // http://eslint.org/docs/rules/brace-style - "1tbs", { - "allowSingleLine": true - }], - "quotes": [ - 2, "single", "avoid-escape" // http://eslint.org/docs/rules/quotes - ], - "camelcase": [2, { // http://eslint.org/docs/rules/camelcase - "properties": "never" - }], - "comma-spacing": [2, { // http://eslint.org/docs/rules/comma-spacing - "before": false, - "after": true - }], - "comma-style": [2, "last"], // http://eslint.org/docs/rules/comma-style - "eol-last": 2, // http://eslint.org/docs/rules/eol-last - "func-names": 1, // http://eslint.org/docs/rules/func-names - "key-spacing": [2, { // http://eslint.org/docs/rules/key-spacing - "beforeColon": false, - "afterColon": true - }], - "new-cap": [2, { // http://eslint.org/docs/rules/new-cap - "newIsCap": true - }], - "no-multiple-empty-lines": [2, { // http://eslint.org/docs/rules/no-multiple-empty-lines - "max": 2 - }], - "no-nested-ternary": 2, // http://eslint.org/docs/rules/no-nested-ternary - "no-new-object": 2, // http://eslint.org/docs/rules/no-new-object - "no-spaced-func": 2, // http://eslint.org/docs/rules/no-spaced-func - "no-trailing-spaces": 2, // http://eslint.org/docs/rules/no-trailing-spaces - "no-wrap-func": 2, // http://eslint.org/docs/rules/no-wrap-func - "no-underscore-dangle": 0, // http://eslint.org/docs/rules/no-underscore-dangle - "one-var": [2, "never"], // http://eslint.org/docs/rules/one-var - "padded-blocks": [2, "never"], // http://eslint.org/docs/rules/padded-blocks - "semi": [2, "always"], // http://eslint.org/docs/rules/semi - "semi-spacing": [2, { // http://eslint.org/docs/rules/semi-spacing - "before": false, - "after": true - }], - "space-after-keywords": 2, // http://eslint.org/docs/rules/space-after-keywords - "space-before-blocks": 2, // http://eslint.org/docs/rules/space-before-blocks - "space-before-function-paren": [2, "never"], // http://eslint.org/docs/rules/space-before-function-paren - "space-infix-ops": 2, // http://eslint.org/docs/rules/space-infix-ops - "space-return-throw-case": 2, // http://eslint.org/docs/rules/space-return-throw-case - "spaced-line-comment": 2 // http://eslint.org/docs/rules/spaced-line-comment - } + // Plugins to include. + "plugins": [ + "react" + ] } diff --git a/linters/SublimeLinter/SublimeLinter.sublime-settings b/linters/SublimeLinter/SublimeLinter.sublime-settings deleted file mode 100644 index 12360f3f1c..0000000000 --- a/linters/SublimeLinter/SublimeLinter.sublime-settings +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Airbnb JSHint settings for use with SublimeLinter and Sublime Text 2. - * - * 1. Install SublimeLinter at https://github.com/SublimeLinter/SublimeLinter - * 2. Open user preferences for the SublimeLinter package in Sublime Text 2 - * * For Mac OS X go to _Sublime Text 2_ > _Preferences_ > _Package Settings_ > _SublimeLinter_ > _Settings - User_ - * 3. Paste the contents of this file into your settings file - * 4. Save the settings file - * - * @version 0.3.0 - * @see https://github.com/SublimeLinter/SublimeLinter - * @see http://www.jshint.com/docs/ - */ -{ - "jshint_options": - { - /* - * ENVIRONMENTS - * ================= - */ - - // Define globals exposed by modern browsers. - "browser": true, - - // Define globals exposed by jQuery. - "jquery": true, - - // Define globals exposed by Node.js. - "node": true, - - /* - * ENFORCING OPTIONS - * ================= - */ - - // Force all variable names to use either camelCase style or UPPER_CASE - // with underscores. - "camelcase": true, - - // Prohibit use of == and != in favor of === and !==. - "eqeqeq": true, - - // Suppress warnings about == null comparisons. - "eqnull": true, - - // Enforce tab width of 2 spaces. - "indent": 2, - - // Prohibit use of a variable before it is defined. - "latedef": true, - - // Require capitalized names for constructor functions. - "newcap": true, - - // Enforce use of single quotation marks for strings. - "quotmark": "single", - - // Prohibit trailing whitespace. - "trailing": true, - - // Prohibit use of explicitly undeclared variables. - "undef": true, - - // Warn when variables are defined but never used. - "unused": true, - - // Enforce line length to 80 characters - "maxlen": 80, - - // Enforce placing 'use strict' at the top function scope - "strict": true - } -} diff --git a/linters/jshintrc b/linters/jshintrc deleted file mode 100644 index cc6e398b40..0000000000 --- a/linters/jshintrc +++ /dev/null @@ -1,59 +0,0 @@ -{ - /* - * ENVIRONMENTS - * ================= - */ - - // Define globals exposed by modern browsers. - "browser": true, - - // Define globals exposed by jQuery. - "jquery": true, - - // Define globals exposed by Node.js. - "node": true, - - /* - * ENFORCING OPTIONS - * ================= - */ - - // Force all variable names to use either camelCase style or UPPER_CASE - // with underscores. - "camelcase": true, - - // Prohibit use of == and != in favor of === and !==. - "eqeqeq": true, - - // Enforce tab width of 2 spaces. - "indent": 2, - - // Prohibit use of a variable before it is defined. - "latedef": true, - - // Enforce line length to 80 characters - "maxlen": 80, - - // Require capitalized names for constructor functions. - "newcap": true, - - // Enforce use of single quotation marks for strings. - "quotmark": "single", - - // Enforce placing 'use strict' at the top function scope - "strict": true, - - // Prohibit use of explicitly undeclared variables. - "undef": true, - - // Warn when variables are defined but never used. - "unused": true, - - /* - * RELAXING OPTIONS - * ================= - */ - - // Suppress warnings about == null comparisons. - "eqnull": true -}