16 // See http://eslint.org/docs/rules/ for all rules and explanations of all
19 // === Possible Errors ===
20 'comma-dangle': 'off',
21 'no-compare-neg-zero': 'error',
22 'no-cond-assign': 'error',
23 'no-console': 'error',
24 'no-constant-condition': 'error',
25 'no-control-regex': 'error',
26 'no-debugger': 'error',
27 'no-dupe-args': 'error',
28 'no-dupe-keys': 'error',
29 'no-duplicate-case': 'error',
31 'no-empty-character-class': 'error',
32 'no-ex-assign': 'error',
33 'no-extra-boolean-cast': 'error',
34 'no-extra-parens': 'off',
35 'no-extra-semi': 'error',
36 'no-func-assign': 'error',
37 'no-inner-declarations': 'error',
38 'no-invalid-regexp': 'error',
39 'no-irregular-whitespace': 'error',
40 'no-obj-calls': 'error',
41 'no-prototype-builtins': 'off',
42 'no-regex-spaces': 'error',
43 'no-sparse-arrays': 'error',
44 'no-unexpected-multiline': 'error',
45 'no-unreachable': 'warn',
46 'no-unsafe-finally': 'error',
47 'no-unsafe-negation': 'error',
49 'valid-jsdoc': ['warn', { 'requireReturn': false, 'requireParamDescription': false, 'requireReturnDescription': false }],
50 'valid-typeof': 'error',
52 // === Best Practices ===
53 // (these mostly match our jshint config)
54 'array-callback-return': 'warn',
55 'block-scoped-var': 'warn',
57 'consistent-return': 'warn',
59 'dot-notation': 'warn',
62 'no-case-declarations': 'error',
63 'no-div-regex': 'error',
64 'no-empty-pattern': 'error',
65 'no-empty-function': 'warn',
66 'no-eq-null': 'error',
68 'no-extend-native': 'error',
69 'no-extra-bind': 'warn',
70 'no-fallthrough': 'error',
71 'no-floating-decimal': 'warn',
72 'no-global-assign': 'warn',
73 'no-implied-eval': 'error',
74 'no-invalid-this': 'error',
75 'no-iterator': 'error',
77 'no-loop-func': 'error',
78 'no-multi-spaces': 'warn',
79 'no-multi-str': 'error',
80 'no-new-func': 'error',
81 'no-new-wrappers': 'error',
83 'no-octal-escape': 'error',
85 'no-redeclare': 'warn',
86 'no-return-assign': 'error',
87 'no-script-url': 'error',
88 'no-self-assign': 'error',
89 'no-self-compare': 'error',
90 'no-sequences': 'warn',
91 'no-throw-literal': 'warn',
92 'no-unmodified-loop-condition': 'error',
93 'no-unused-expressions': 'error',
94 'no-unused-labels': 'error',
95 'no-useless-call': 'warn',
96 'no-useless-escape': 'warn',
98 'wrap-iife': ['error', 'any'],
101 'no-delete-var': 'error',
103 'no-undef-init': 'error',
104 'no-unused-vars': ['error', { 'caughtErrors': 'none' }],
106 // === Stylistic Issues ===
107 'array-bracket-spacing': 'warn',
108 'block-spacing': 'warn',
109 'brace-style': ['warn', '1tbs'],
111 'capitalized-comments': ['warn', 'always', { 'ignoreConsecutiveComments': true }],
112 'comma-spacing': ['warn', { 'before': false, 'after': true }],
113 'comma-style': ['warn', 'last'],
114 'computed-property-spacing': 'error',
115 'consistent-this': 'off',
117 'func-call-spacing': ['warn', 'never'],
120 // indent currently not doing well with our wrapping style, so disabled.
121 'indent': ['off', 4, { 'SwitchCase': 1 }],
122 'key-spacing': ['warn', { 'beforeColon': false, 'afterColon': true, 'mode': minimum }],
123 'keyword-spacing': 'warn',
124 'linebreak-style': ['error', 'unix'],
125 'lines-around-comment': 'off',
126 'max-len': ['error', 132],
129 'max-nested-callbacks': ['warn', 5],
131 'max-statements': 'off',
132 'max-statements-per-line': ['warn', { max: 2 }],
133 'new-cap': ['warn', { 'properties': false }],
134 'new-parens': 'warn',
135 'newline-after-var': 'off',
136 'newline-before-return': 'off',
137 'newline-per-chained-call': 'off',
138 'no-array-constructor': 'off',
139 'no-bitwise': 'error',
140 'no-continue': 'off',
141 'no-inline-comments': 'off',
142 'no-lonely-if': 'off',
143 'no-mixed-operators': 'off',
144 'no-mixed-spaces-and-tabs': 'error',
145 'no-multiple-empty-lines': 'warn',
146 'no-negated-condition': 'off',
147 'no-nested-ternary': 'warn',
148 'no-new-object': 'off',
149 'no-plusplus': 'off',
152 'no-trailing-spaces': 'error',
153 'no-underscore-dangle': 'off',
154 'no-unneeded-ternary': 'off',
155 'no-whitespace-before-property': 'warn',
156 'object-curly-newline': 'off',
157 'object-curly-spacing': 'warn',
158 'object-property-newline': 'off',
160 'one-var-declaration-per-line': ['warn', 'initializations'],
161 'operator-assignment': 'off',
162 'operator-linebreak': 'off',
163 'padded-blocks': 'off',
164 'quote-props': ['warn', 'as-needed', {'unnecessary': false, 'keywords': true, 'numbers': true}],
166 'require-jsdoc': 'warn',
168 'semi-spacing': ['warn', {'before': false, 'after': true}],
170 'space-before-blocks': 'warn',
171 'space-before-function-paren': ['warn', 'never'],
172 'space-in-parens': 'warn',
173 'space-infix-ops': 'warn',
174 'space-unary-ops': 'warn',
175 'spaced-comment': 'warn',
176 'unicode-bom': 'error',
180 'promise/always-return': 'warn',
181 'promise/no-return-wrap': 'warn',
182 'promise/param-names': 'warn',
183 'promise/catch-or-return': ['warn', {terminationMethod: ['catch', 'fail']}],
184 'promise/no-native': 'warn',
185 'promise/no-promise-in-callback': 'warn',
186 'promise/no-callback-in-promise': 'warn',
187 'promise/avoid-new': 'warn',
189 // === Deprecations ===
190 "no-restricted-properties": ['warn', {
193 'message': 'Use AMD module "core/str" or M.util.get_string()'
198 files: ["**/yui/src/**/*.js"],
199 // Disable some rules which we can't safely define for YUI rollups.
202 'no-unused-vars': 'off',
203 'no-unused-expressions': 'off',
206 "jsdoc/check-access": 'off',
207 "jsdoc/check-alignment": 'off',
208 "jsdoc/check-param-names": 'off',
209 "jsdoc/check-property-names": 'off',
210 "jsdoc/empty-tags": 'off',
211 "jsdoc/implements-on-classes": 'off',
212 "jsdoc/multiline-blocks": 'off',
213 "jsdoc/require-jsdoc": 'off',
214 "jsdoc/require-param": 'off',
215 "jsdoc/require-param-name": 'off',
216 "jsdoc/require-param-type": 'off',
217 "jsdoc/require-property": 'off',
218 "jsdoc/require-property-name": 'off',
219 "jsdoc/require-property-type": 'off',
223 files: ["**/amd/src/*.js", "**/amd/src/**/*.js", "Gruntfile.js", ".grunt/*.js", ".grunt/tasks/*.js", "jsdoc.conf.js"],
224 // We support es6 now. Woot!
228 // We're using babel transpiling so use their parser
230 parser: '@babel/eslint-parser',
231 // Check AMD with some slightly stricter rules.
233 'no-unused-vars': 'error',
234 'no-implicit-globals': 'error',
235 // Disable all of the rules that have babel versions.
237 // Not using this rule for the time being because it isn't
238 // compatible with jQuery and ES6.
239 'no-invalid-this': 'off',
240 'object-curly-spacing': 'off',
243 'no-unused-expressions': 'off',
244 // Enable all of the babel version of these rules.
245 'babel/new-cap': ['warn', { 'properties': false }],
246 // Not using this rule for the time being because it isn't
247 // compatible with jQuery and ES6.
248 'babel/no-invalid-this': 'off',
249 'babel/object-curly-spacing': 'warn',
250 // This is off in the original style int.
251 'babel/quotes': 'off',
252 'babel/semi': 'error',
253 'babel/no-unused-expressions': 'error',
255 // We have Promise now that we're using ES6.
256 'promise/no-native': 'off',
257 'promise/avoid-new': 'off',
260 "jsdoc/check-access": [
263 "jsdoc/check-alignment": 1, // Recommended.
264 "jsdoc/check-param-names": [
267 "jsdoc/check-property-names": [
270 "jsdoc/empty-tags": [
273 "jsdoc/implements-on-classes": [
276 "jsdoc/multiline-blocks": [
279 "jsdoc/require-jsdoc": [
282 "jsdoc/require-param": [
285 "jsdoc/require-param-name": [
288 "jsdoc/require-param-type": [
291 "jsdoc/require-property": [
294 "jsdoc/require-property-name": [
297 "jsdoc/require-property-type": [
303 'sourceType': 'module',
304 'requireConfigFile': false,