11 // See http://eslint.org/docs/rules/ for all rules and explanations of all
14 // === Possible Errors ===
15 'comma-dangle': 'off',
16 'no-cond-assign': 'error',
17 'no-console': 'error',
18 'no-constant-condition': 'error',
19 'no-control-regex': 'error',
20 'no-debugger': 'error',
21 'no-dupe-args': 'error',
22 'no-dupe-keys': 'error',
23 'no-duplicate-case': 'error',
25 'no-empty-character-class': 'error',
26 'no-ex-assign': 'error',
27 'no-extra-boolean-cast': 'error',
28 'no-extra-parens': 'off',
29 'no-extra-semi': 'error',
30 'no-func-assign': 'error',
31 'no-inner-declarations': 'error',
32 'no-invalid-regexp': 'error',
33 'no-irregular-whitespace': 'error',
34 'no-obj-calls': 'error',
35 'no-prototype-builtins': 'off',
36 'no-regex-spaces': 'error',
37 'no-sparse-arrays': 'error',
38 'no-unexpected-multiline': 'error',
39 'no-unreachable': 'warn',
40 'no-unsafe-finally': 'error',
41 'no-unsafe-negation': 'error',
43 'valid-jsdoc': ['warn', { 'requireReturn': false, 'requireParamDescription': false, 'requireReturnDescription': false }],
44 'valid-typeof': 'error',
46 // === Best Practices ===
47 // (these mostly match our jshint config)
48 'array-callback-return': 'warn',
49 'block-scoped-var': 'warn',
51 'consistent-return': 'warn',
53 'dot-notation': 'warn',
56 'no-case-declarations': 'error',
57 'no-div-regex': 'error',
58 'no-empty-pattern': 'error',
59 'no-empty-function': 'warn',
60 'no-eq-null': 'error',
62 'no-extend-native': 'error',
63 'no-extra-bind': 'warn',
64 'no-fallthrough': 'error',
65 'no-floating-decimal': 'warn',
66 'no-global-assign': 'warn',
67 // Enabled by grunt for AMD modules: 'no-implicit-globals': 'error',
68 'no-implied-eval': 'error',
69 'no-invalid-this': 'error',
70 'no-iterator': 'error',
72 'no-loop-func': 'error',
73 'no-multi-spaces': 'warn',
74 'no-multi-str': 'error',
75 'no-new-func': 'error',
76 'no-new-wrappers': 'error',
78 'no-octal-escape': 'error',
80 'no-redeclare': 'warn',
81 'no-return-assign': 'error',
82 'no-script-url': 'error',
83 'no-self-assign': 'error',
84 'no-self-compare': 'error',
85 'no-sequences': 'warn',
86 'no-throw-literal': 'warn',
87 'no-unmodified-loop-condition': 'error',
88 'no-unused-expressions': 'error',
89 'no-unused-labels': 'error',
90 'no-useless-call': 'warn',
91 'no-useless-escape': 'warn',
93 'wrap-iife': ['error', 'any'],
96 'no-delete-var': 'error',
98 'no-undef-init': 'error',
99 'no-unused-vars': ['error', { 'caughtErrors': 'none' }],
101 // === Stylistic Issues ===
102 'array-bracket-spacing': 'warn',
103 'block-spacing': 'warn',
104 'brace-style': ['warn', '1tbs'],
106 'comma-spacing': ['warn', { 'before': false, 'after': true }],
107 'comma-style': ['warn', 'last'],
108 'computed-property-spacing': 'error',
109 'consistent-this': 'off',
111 'func-call-spacing': ['warn', 'never'],
114 // indent currently not doing well with our wrapping style, so disabled.
115 'indent': ['off', 4, { 'SwitchCase': 1 }],
116 'key-spacing': ['warn', { 'beforeColon': false, 'afterColon': true, 'mode': minimum }],
117 'keyword-spacing': 'warn',
118 'linebreak-style': ['error', 'unix'],
119 'lines-around-comment': 'off',
120 'max-len': ['error', 132],
123 'max-nested-callbacks': ['warn', 5],
125 'max-statements': 'off',
126 'max-statements-per-line': ['warn', { max: 2 }],
127 'new-cap': ['warn', { 'properties': false }],
128 'new-parens': 'warn',
129 'newline-after-var': 'off',
130 'newline-before-return': 'off',
131 'newline-per-chained-call': 'off',
132 'no-array-constructor': 'off',
133 'no-bitwise': 'error',
134 'no-continue': 'off',
135 'no-inline-comments': 'off',
136 'no-lonely-if': 'off',
137 'no-mixed-operators': 'off',
138 'no-mixed-spaces-and-tabs': 'error',
139 'no-multiple-empty-lines': 'warn',
140 'no-negated-condition': 'off',
141 'no-nested-ternary': 'warn',
142 'no-new-object': 'off',
143 'no-plusplus': 'off',
146 'no-trailing-spaces': 'error',
147 'no-underscore-dangle': 'off',
148 'no-unneeded-ternary': 'off',
149 'no-whitespace-before-property': 'warn',
150 'object-curly-newline': 'off',
151 'object-curly-spacing': 'warn',
152 'object-property-newline': 'off',
154 'one-var-declaration-per-line': ['warn', 'initializations'],
155 'operator-assignment': 'off',
156 'operator-linebreak': 'off',
157 'padded-blocks': 'off',
158 'quote-props': ['warn', 'as-needed', {'unnecessary': false, 'keywords': true, 'numbers': true}],
160 'require-jsdoc': 'warn',
162 'semi-spacing': ['warn', {'before': false, 'after': true}],
164 'space-before-blocks': 'warn',
165 'space-before-function-paren': ['warn', 'never'],
166 'space-in-parens': 'warn',
167 'space-infix-ops': 'warn',
168 'space-unary-ops': 'warn',
169 'spaced-comment': 'warn',
170 'unicode-bom': 'error',
173 // === Deprecations ===
174 "no-restricted-properties": ['warn', {
177 'message': 'Use AMD module "core/str" or M.util.get_string()'