1 | ecmaFeatures:
|
2 | jsx: true
|
3 |
|
4 | env:
|
5 | browser: false
|
6 | node: true
|
7 | amd: false
|
8 | mocha: false
|
9 | jasmine: false
|
10 |
|
11 | globals:
|
12 | require: true
|
13 | module: true
|
14 |
|
15 | rules:
|
16 |
|
17 | ###########################################################################
|
18 | # #
|
19 | # POSSIBLE ERRORS: these rules point out areas where you might have #
|
20 | # made mistakes. #
|
21 | # #
|
22 | ###########################################################################
|
23 |
|
24 | no-comma-dangle: 1 # disallow trailing commas in object literals
|
25 | no-cond-assign: 2 # disallow assignment in conditional expressions
|
26 | no-console: 2 # disallow use of console
|
27 | no-constant-condition: 2 # disallow use of constant expressions in conditions
|
28 | no-control-regex: 2 # disallow control characters in regular expressions
|
29 | no-debugger: 2 # disallow use of debugger
|
30 | no-dupe-keys: 2 # disallow duplicate keys when creating object literals
|
31 | no-empty: 2 # disallow empty statements
|
32 | no-empty-class: 2 # disallow the use of empty character classes in regular expressions
|
33 | no-ex-assign: 2 # disallow assigning to the exception in a catch block
|
34 | no-extra-boolean-cast: 2 # disallow double-negation boolean casts in a boolean context
|
35 | no-extra-parens: 0 # disallow unnecessary parentheses
|
36 | # NOTE: Allow for `return (/* JSX STUFF*/);` situations
|
37 | no-extra-semi: 2 # disallow unnecessary semicolons
|
38 | no-func-assign: 2 # disallow overwriting functions written as function declarations
|
39 | no-inner-declarations: 1 # disallow function or variable declarations in nested blocks
|
40 | no-invalid-regexp: 2 # disallow invalid regular expression strings in the RegExp
|
41 | # constructor
|
42 | no-irregular-whitespace: 2 # disallow irregular whitespace outside of strings and comments
|
43 | no-negated-in-lhs: 2 # disallow negation of the left operand of an in expression
|
44 | no-obj-calls: 2 # disallow the use of object properties of the global object (Math
|
45 | # and JSON) as functions
|
46 | no-regex-spaces: 1 # disallow multiple spaces in a regular expression literal
|
47 | no-reserved-keys: 1 # disallow reserved words being used as object literal keys
|
48 | no-sparse-arrays: 2 # disallow sparse arrays
|
49 | no-unreachable: 2 # disallow unreachable statements after a return, throw, continue,
|
50 | # or break statement
|
51 | use-isnan: 2 # disallow comparisons with the value NaN
|
52 | valid-typeof: 2 # ensure that the results of typeof are compared against a
|
53 | # valid string
|
54 |
|
55 | valid-jsdoc: # ensure JSDoc comments are valid
|
56 | [1, { "prefer": { "return": "returns" }, "requireReturn": false }]
|
57 |
|
58 | ###########################################################################
|
59 | # #
|
60 | # BEST PRACTICES: these rules are designed to prevent you from making #
|
61 | # mistakes. They either prescribe a better way of doing something or #
|
62 | # help you avoid pitfalls. #
|
63 | # #
|
64 | ###########################################################################
|
65 |
|
66 | block-scoped-var: 1 # treat var statements as if they were block scoped
|
67 | complexity: [1, 250] # specify the maximum cyclomatic complexity allowed in a program
|
68 | consistent-return: 0 # require return statements to either always or never specify values
|
69 | curly: 2 # specify curly brace conventions for all control statements
|
70 | default-case: 2 # require default case in switch statements
|
71 | dot-notation: 1 # encourages use of dot notation whenever possible
|
72 | eqeqeq: 2 # require the use of === and !==
|
73 | guard-for-in: 1 # make sure for-in loops have an if statement
|
74 | no-alert: 2 # disallow the use of alert, confirm, and prompt
|
75 | no-caller: 2 # disallow use of arguments.caller or arguments.callee
|
76 | no-div-regex: 1 # disallow division operators explicitly at beginning of regular
|
77 | # expression
|
78 | no-else-return: 1 # disallow else after a return in an if
|
79 | no-empty-label: 2 # disallow use of labels for anything other then loops and switches
|
80 | no-eq-null: 2 # disallow comparisons to null without a type-checking operator
|
81 | no-eval: 2 # disallow use of eval()
|
82 | no-extend-native: 2 # disallow adding to native types
|
83 | no-extra-bind: 2 # disallow unnecessary function binding
|
84 | no-fallthrough: 2 # disallow fallthrough of case statements
|
85 | no-floating-decimal: 2 # disallow the use of leading or trailing decimal points in numeric
|
86 | # literals
|
87 | no-implied-eval: 2 # disallow use of eval()-like methods
|
88 | no-iterator: 2 # disallow usage of __iterator__ property
|
89 | no-labels: 2 # disallow use of labeled statements
|
90 | no-lone-blocks: 2 # disallow unnecessary nested blocks
|
91 | no-loop-func: 0 # disallow creation of functions within loops
|
92 | no-multi-spaces: 0 # disallow use of multiple spaces
|
93 | no-multi-str: 2 # disallow use of multiline strings
|
94 | no-native-reassign: 2 # disallow reassignments of native objects
|
95 | no-new: 2 # disallow use of new operator when not part of the assignment or
|
96 | # comparison
|
97 | no-new-func: 2 # disallow use of new operator for Function object
|
98 | no-new-wrappers: 2 # disallows creating new instances of String,Number, and Boolean
|
99 | no-octal: 2 # disallow use of octal literals
|
100 | no-octal-escape: 2 # disallow use of octal escape sequences in string literals, such as
|
101 | # `var foo = "Copyright \251"`
|
102 | no-process-env: 0 # disallow use of process.env
|
103 | no-proto: 2 # disallow usage of __proto__ property
|
104 | no-redeclare: 1 # disallow declaring the same variable more then once
|
105 | no-return-assign: 0 # disallow use of assignment in return statement
|
106 | no-script-url: 2 # disallow use of javascript urls.
|
107 | no-self-compare: 2 # disallow comparisons where both sides are exactly the same
|
108 | no-sequences: 2 # disallow use of comma operator
|
109 | no-unused-expressions: 0 # disallow usage of expressions in statement position
|
110 | no-void: 2 # disallow use of void operator
|
111 | no-warning-comments: 0 # disallow usage of configurable warning terms in comments - e.g.
|
112 | # TODO or FIXME
|
113 | no-with: 2 # disallow use of the with statement
|
114 | radix: 2 # require use of the second argument for parseInt()
|
115 | vars-on-top: 0 # requires to declare all vars on top of their containing scope
|
116 | wrap-iife: [2, "inside"] # require immediate function invocation to be wrapped in parentheses
|
117 | yoda: "never" # require or disallow Yoda conditions
|
118 |
|
119 | ###########################################################################
|
120 | # #
|
121 | # STRICT MODE: these rules relate to using strict mode. #
|
122 | # #
|
123 | ###########################################################################
|
124 |
|
125 | global-strict: [2, "never"] # require or disallow the "use strict" pragma in the global scope
|
126 | no-extra-strict: 2 # disallow use of "use strict" when already in strict mode
|
127 | strict: 0 # require that all functions are run in strict mode
|
128 |
|
129 | ###########################################################################
|
130 | # #
|
131 | # VARIABLES: these rules have to do with variable declarations. #
|
132 | # #
|
133 | ###########################################################################
|
134 |
|
135 | no-catch-shadow: 2 # disallow the catch clause parameter name being the same as a
|
136 | # variable in the outer scope
|
137 | no-delete-var: 2 # disallow deletion of variables
|
138 | no-label-var: 2 # disallow labels that share a name with a variable
|
139 | no-shadow: 1 # disallow declaration of variables already declared in the
|
140 | # outer scope
|
141 | no-shadow-restricted-names: 2 # disallow shadowing of names such as arguments
|
142 | no-undef: 2 # disallow use of undeclared variables unless mentioned in a
|
143 | # /*global */ block
|
144 | no-undef-init: 2 # disallow use of undefined when initializing variables
|
145 | no-undefined: 2 # disallow use of undefined variable
|
146 | no-unused-vars: 2 # disallow declaration of variables that are not used in
|
147 | # the code
|
148 | no-use-before-define: 2 # disallow use of variables before they are defined
|
149 |
|
150 | ###########################################################################
|
151 | # #
|
152 | # NODE: these rules relate to functionality provided in Node.js. #
|
153 | # #
|
154 | ###########################################################################
|
155 |
|
156 | handle-callback-err: 0 # enforces error handling in callbacks
|
157 | no-mixed-requires: [1, true] # disallow mixing regular variable and require declarations
|
158 | no-new-require: 2 # disallow use of new operator with the require function
|
159 | no-path-concat: 2 # disallow string concatenation with __dirname and __filename
|
160 | no-process-exit: 0 # disallow process.exit()
|
161 | no-restricted-modules: 0 # restrict usage of specified node modules
|
162 | no-sync: 0 # disallow use of synchronous methods
|
163 |
|
164 | ###########################################################################
|
165 | # #
|
166 | # STYLISTIC ISSUES: these rules are purely matters of style and, #
|
167 | # while valueable to enforce consistently across a project, are #
|
168 | # quite subjective. #
|
169 | # #
|
170 | ###########################################################################
|
171 |
|
172 | brace-style: # enforce one true brace style
|
173 | [2, "1tbs", { "allowSingleLine": true }]
|
174 | camelcase: 2 # require camel case names
|
175 | comma-spacing: 2 # enforce spacing before and after comma
|
176 | comma-style: 2 # enforce one true comma style
|
177 | consistent-this: [2, "self"] # enforces consistent naming when capturing the current execution context
|
178 | eol-last: 2 # enforce newline at the end of file, with no multiple empty lines
|
179 | func-names: 0 # require function expressions to have a name
|
180 | func-style: 0 # enforces use of function declarations or expressions
|
181 | key-spacing: 2 # enforces spacing between keys and values in object literal properties
|
182 | max-nested-callbacks: [2, 4] # specify the maximum depth callbacks can be nested
|
183 | new-cap: 2 # require a capital letter for constructors
|
184 | new-parens: 2 # disallow the omission of parentheses when invoking a constructor with no arguments
|
185 | no-array-constructor: 2 # disallow use of the Array constructor
|
186 | no-lonely-if: 0 # disallow if as the only statement in an else block
|
187 | no-mixed-spaces-and-tabs: 2 # disallow mixed spaces and tabs for indentation
|
188 | no-nested-ternary: 2 # disallow nested ternary expressions
|
189 | no-new-object: 1 # disallow use of the Object constructor
|
190 | no-space-before-semi: 2 # disallow space before semicolon
|
191 | no-spaced-func: 2 # disallow space between function identifier and application
|
192 | no-ternary: 0 # disallow the use of ternary operators
|
193 |
|
194 | no-trailing-spaces: 2 # disallow trailing whitespace at the end of lines
|
195 | no-multiple-empty-lines: 2 # disallow multiple empty lines
|
196 | no-underscore-dangle: 0 # disallow dangling underscores in identifiers
|
197 | no-wrap-func: 2 # disallow wrapping of non-IIFE statements in parens
|
198 | one-var: 0 # allow just one var statement per function
|
199 | padded-blocks: 0 # enforce padding within blocks
|
200 | quotes: # specify whether double or single quotes should be used
|
201 | [1, "double", "avoid-escape"]
|
202 | quote-props: 0 # require quotes around object literal property names
|
203 | semi: [2, "always"] # require or disallow use of semicolons instead of ASI
|
204 | sort-vars: 0 # sort variables within the same declaration block
|
205 | space-after-keywords: "always" # require a space after certain keywords
|
206 | space-before-blocks: 2 # require or disallow space before blocks
|
207 | space-in-brackets: 0 # require or disallow spaces inside brackets
|
208 | space-in-parens: 0 # require or disallow spaces inside parentheses
|
209 | space-infix-ops: 2 # require spaces around operators
|
210 | space-return-throw-case: 2 # require a space after return, throw, and case
|
211 | spaced-line-comment: 2 # require or disallow a space immediately following
|
212 | # the // in a line comment
|
213 | wrap-regex: 0 # require regex literals to be wrapped in parentheses
|
214 |
|
215 | ###########################################################################
|
216 | # #
|
217 | # LEGACY: these rules are included for compatibility with JSHint and #
|
218 | # JSLint. While the names of the rules may not match up with their #
|
219 | # JSHint/JSLint counterpart, the functionality is the same. #
|
220 | # #
|
221 | ###########################################################################
|
222 |
|
223 | max-depth: 0 # specify the maximum depth that blocks can be nested
|
224 | max-len: [2, 100, 4] # specify the maximum length of a line in your program
|
225 | max-params: [1, 3] # limits the number of parameters that can be used in the function
|
226 | # declaration
|
227 | max-statements: 0 # specify the maximum number of statement allowed in a function
|
228 | no-bitwise: 0 # disallow use of bitwise operators
|
229 | no-plusplus: 0 # disallow use of unary operators, ++ and -- |
\ | No newline at end of file |