Commit | Line | Data |
---|---|---|
3adb62b7 DP |
1 | { |
2 | 'env': { | |
3 | 'browser': true, | |
4 | 'amd': true | |
5 | }, | |
6 | 'globals': { | |
7 | 'M': true, | |
8 | 'Y': true | |
9 | }, | |
10 | 'rules': { | |
11 | // See http://eslint.org/docs/rules/ for all rules and explanations of all | |
037de719 DP |
12 | // rules. |
13 | ||
3adb62b7 | 14 | // === Possible Errors === |
037de719 | 15 | 'comma-dangle': 'off', |
3adb62b7 DP |
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', | |
037de719 | 24 | 'no-empty': 'warn', |
3adb62b7 DP |
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-negated-in-lhs': 'error', | |
35 | 'no-obj-calls': 'error', | |
36 | 'no-prototype-builtins': 'off', | |
37 | 'no-regex-spaces': 'error', | |
38 | 'no-sparse-arrays': 'error', | |
39 | 'no-unexpected-multiline': 'error', | |
40 | 'no-unreachable': 'warn', | |
41 | 'no-unsafe-finally': 'error', | |
42 | 'use-isnan': 'error', | |
0d06a200 | 43 | 'valid-jsdoc': ['warn', { 'requireReturn': false, 'requireParamDescription': false, 'requireReturnDescription': false }], |
3adb62b7 DP |
44 | 'valid-typeof': 'error', |
45 | ||
46 | // === Best Practices === | |
47 | // (these mostly match our jshint config) | |
037de719 DP |
48 | 'array-callback-return': 'warn', |
49 | 'block-scoped-var': 'warn', | |
50 | 'complexity': 'warn', | |
51 | 'consistent-return': 'warn', | |
3adb62b7 DP |
52 | 'curly': 'error', |
53 | 'dot-notation': 'warn', | |
54 | 'no-alert': 'warn', | |
55 | 'no-caller': 'error', | |
56 | 'no-case-declarations': 'error', | |
037de719 | 57 | 'no-div-regex': 'error', |
3adb62b7 DP |
58 | 'no-empty-pattern': 'error', |
59 | 'no-empty-function': 'warn', | |
037de719 | 60 | 'no-eq-null': 'error', |
3adb62b7 | 61 | 'no-eval': 'error', |
037de719 DP |
62 | 'no-extend-native': 'error', |
63 | 'no-extra-bind': 'warn', | |
3adb62b7 | 64 | 'no-fallthrough': 'error', |
037de719 | 65 | 'no-floating-decimal': 'warn', |
ad3f8cd1 | 66 | // Enabled by grunt for AMD modules: 'no-implicit-globals': 'error', |
3adb62b7 DP |
67 | 'no-implied-eval': 'error', |
68 | 'no-invalid-this': 'error', | |
69 | 'no-iterator': 'error', | |
70 | 'no-labels': 'error', | |
71 | 'no-loop-func': 'error', | |
72 | 'no-multi-spaces': 'warn', | |
73 | 'no-multi-str': 'error', | |
74 | 'no-native-reassign': 'warn', | |
75 | 'no-new-func': 'error', | |
76 | 'no-new-wrappers': 'error', | |
037de719 DP |
77 | 'no-octal': 'error', |
78 | 'no-octal-escape': 'error', | |
3adb62b7 DP |
79 | 'no-proto': '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', | |
037de719 DP |
85 | 'no-sequences': 'warn', |
86 | 'no-throw-literal': 'warn', | |
3adb62b7 | 87 | 'no-unmodified-loop-condition': 'error', |
ad3f8cd1 | 88 | 'no-unused-expressions': 'error', |
3adb62b7 | 89 | 'no-unused-labels': 'error', |
037de719 | 90 | 'no-useless-call': 'warn', |
3adb62b7 | 91 | 'no-useless-escape': 'warn', |
037de719 | 92 | 'no-with': 'error', |
3adb62b7 DP |
93 | 'wrap-iife': ['error', 'any'], |
94 | ||
95 | // === Variables === | |
96 | 'no-delete-var': 'error', | |
ad3f8cd1 | 97 | 'no-undef': 'error', |
037de719 | 98 | 'no-undef-init': 'error', |
ad3f8cd1 | 99 | 'no-unused-vars': ['error', { 'caughtErrors': 'none', 'argsIgnorePattern': "(e|event)" }], |
3adb62b7 DP |
100 | |
101 | // === Stylistic Issues === | |
102 | 'array-bracket-spacing': 'warn', | |
103 | 'block-spacing': 'warn', | |
104 | 'brace-style': ['warn', '1tbs'], | |
105 | 'camelcase': 'warn', | |
106 | 'comma-spacing': ['warn', { 'before': false, 'after': true }], | |
107 | 'comma-style': ['warn', 'last'], | |
108 | 'computed-property-spacing': 'error', | |
109 | 'consistent-this': 'off', | |
110 | 'eol-last': 'off', | |
111 | 'func-names': 'off', | |
112 | 'func-style': 'off', | |
113 | // indent currently not doing well with our wrapping style, so disabled. | |
114 | 'indent': ['off', 4, { 'SwitchCase': 1 }], | |
115 | 'key-spacing': ['warn', { 'beforeColon': false, 'afterColon': true, 'mode': minimum }], | |
116 | 'keyword-spacing': 'warn', | |
117 | 'linebreak-style': ['error', 'unix'], | |
118 | 'lines-around-comment': 'off', | |
119 | 'max-len': ['error', 132], | |
120 | 'max-lines': 'off', | |
037de719 DP |
121 | 'max-depth': 'warn', |
122 | 'max-nested-callbacks': ['warn', 5], | |
3adb62b7 DP |
123 | 'max-params': 'off', |
124 | 'max-statements': 'off', | |
037de719 | 125 | 'max-statements-per-line': ['warn', { max: 2 }], |
0d06a200 | 126 | 'new-cap': ['warn', { 'properties': false }], |
3adb62b7 DP |
127 | 'new-parens': 'warn', |
128 | 'newline-after-var': 'off', | |
129 | 'newline-before-return': 'off', | |
037de719 | 130 | 'newline-per-chained-call': 'off', |
3adb62b7 DP |
131 | 'no-array-constructor': 'off', |
132 | 'no-bitwise': 'error', | |
133 | 'no-continue': 'off', | |
134 | 'no-inline-comments': 'off', | |
135 | 'no-lonely-if': 'off', | |
136 | 'no-mixed-operators': 'off', | |
137 | 'no-mixed-spaces-and-tabs': 'error', | |
138 | 'no-multiple-empty-lines': 'warn', | |
139 | 'no-negated-condition': 'off', | |
140 | 'no-nested-ternary': 'warn', | |
141 | 'no-new-object': 'off', | |
142 | 'no-plusplus': 'off', | |
143 | 'no-spaced-func': 'warn', | |
144 | 'no-ternary': 'off', | |
145 | 'no-trailing-spaces': 'error', | |
146 | 'no-underscore-dangle': 'off', | |
037de719 | 147 | 'no-unneeded-ternary': 'off', |
3adb62b7 | 148 | 'no-whitespace-before-property': 'warn', |
037de719 DP |
149 | 'object-curly-newline': 'off', |
150 | 'object-curly-spacing': 'warn', | |
151 | 'object-property-newline': 'off', | |
3adb62b7 | 152 | 'one-var': 'off', |
037de719 | 153 | 'one-var-declaration-per-line': ['warn', 'initializations'], |
3adb62b7 DP |
154 | 'operator-assignment': 'off', |
155 | 'operator-linebreak': 'off', | |
156 | 'padded-blocks': 'off', | |
037de719 | 157 | 'quote-props': ['warn', 'as-needed', {'unnecessary': false, 'keywords': true, 'numbers': true}], |
3adb62b7 DP |
158 | 'quotes': 'off', |
159 | 'require-jsdoc': 'warn', | |
160 | 'semi': 'error', | |
161 | 'semi-spacing': ['warn', {'before': false, 'after': true}], | |
162 | 'sort-vars': 'off', | |
163 | 'space-before-blocks': 'warn', | |
164 | 'space-before-function-paren': ['warn', 'never'], | |
165 | 'space-in-parens': 'warn', | |
166 | 'space-infix-ops': 'warn', | |
167 | 'space-unary-ops': 'warn', | |
168 | 'spaced-comment': 'warn', | |
169 | 'unicode-bom': 'error', | |
170 | 'wrap-regex': 'off', | |
171 | } | |
172 | } |