UNPKG

4.54 kBJavaScriptView Raw
1module.exports = {
2 'rules': {
3 // Enforces getter/setter pairs in objects
4 'accessor-pairs': 0,
5 // treat var statements as if they were block scoped
6 'block-scoped-var': 2,
7 // specify the maximum cyclomatic complexity allowed in a program
8 'complexity': [0, 11],
9 // require return statements to either always or never specify values
10 'consistent-return': 2,
11 // specify curly brace conventions for all control statements
12 'curly': [2, 'multi-line'],
13 // require default case in switch statements
14 'default-case': 2,
15 // encourages use of dot notation whenever possible
16 'dot-notation': [2, { 'allowKeywords': true}],
17 // enforces consistent newlines before or after dots
18 'dot-location': 0,
19 // require the use of === and !==
20 'eqeqeq': 2,
21 // make sure for-in loops have an if statement
22 'guard-for-in': 2,
23 // disallow the use of alert, confirm, and prompt
24 'no-alert': 1,
25 // disallow use of arguments.caller or arguments.callee
26 'no-caller': 2,
27 // disallow division operators explicitly at beginning of regular expression
28 'no-div-regex': 0,
29 // disallow else after a return in an if
30 'no-else-return': 2,
31 // disallow use of labels for anything other then loops and switches
32 'no-empty-label': 2,
33 // disallow comparisons to null without a type-checking operator
34 'no-eq-null': 0,
35 // disallow use of eval()
36 'no-eval': 2,
37 // disallow adding to native types
38 'no-extend-native': 2,
39 // disallow unnecessary function binding
40 'no-extra-bind': 2,
41 // disallow fallthrough of case statements
42 'no-fallthrough': 2,
43 // disallow the use of leading or trailing decimal points in numeric literals
44 'no-floating-decimal': 2,
45 // disallow the type conversions with shorter notations
46 'no-implicit-coercion': 0,
47 // disallow use of eval()-like methods
48 'no-implied-eval': 2,
49 // disallow this keywords outside of classes or class-like objects
50 'no-invalid-this': 0,
51 // disallow usage of __iterator__ property
52 'no-iterator': 2,
53 // disallow use of labeled statements
54 'no-labels': 2,
55 // disallow unnecessary nested blocks
56 'no-lone-blocks': 2,
57 // disallow creation of functions within loops
58 'no-loop-func': 2,
59 // disallow use of multiple spaces
60 'no-multi-spaces': 2,
61 // disallow use of multiline strings
62 'no-multi-str': 2,
63 // disallow reassignments of native objects
64 'no-native-reassign': 2,
65 // disallow use of new operator when not part of the assignment or comparison
66 'no-new': 2,
67 // disallow use of new operator for Function object
68 'no-new-func': 2,
69 // disallows creating new instances of String,Number, and Boolean
70 'no-new-wrappers': 2,
71 // disallow use of (old style) octal literals
72 'no-octal': 2,
73 // disallow use of octal escape sequences in string literals, such as
74 // var foo = 'Copyright \251';
75 'no-octal-escape': 2,
76 // disallow reassignment of function parameters
77 // disallow parameter object manipulation
78 // rule: http://eslint.org/docs/rules/no-param-reassign.html
79 'no-param-reassign': [2, { 'props': true }],
80 // disallow use of process.env
81 'no-process-env': 0,
82 // disallow usage of __proto__ property
83 'no-proto': 2,
84 // disallow declaring the same variable more then once
85 'no-redeclare': 2,
86 // disallow use of assignment in return statement
87 'no-return-assign': 2,
88 // disallow use of `javascript:` urls.
89 'no-script-url': 2,
90 // disallow comparisons where both sides are exactly the same
91 'no-self-compare': 2,
92 // disallow use of comma operator
93 'no-sequences': 2,
94 // restrict what can be thrown as an exception
95 'no-throw-literal': 2,
96 // disallow usage of expressions in statement position
97 'no-unused-expressions': 2,
98 // disallow unnecessary .call() and .apply()
99 'no-useless-call': 0,
100 // disallow use of void operator
101 'no-void': 0,
102 // disallow usage of configurable warning terms in comments: e.g. todo
103 'no-warning-comments': [0, { 'terms': ['todo', 'fixme', 'xxx'], 'location': 'start' }],
104 // disallow use of the with statement
105 'no-with': 2,
106 // require use of the second argument for parseInt()
107 'radix': 2,
108 // requires to declare all vars on top of their containing scope
109 'vars-on-top': 2,
110 // require immediate function invocation to be wrapped in parentheses
111 'wrap-iife': [2, 'any'],
112 // require or disallow Yoda conditions
113 'yoda': 2
114 }
115};