Category: Remove "todo" comment about moving code from CategoryPage
[lhc/web/wiklou.git] / .eslintrc.json
1 {
2 "extends": "wikimedia",
3 "env": {
4 "browser": true
5 },
6 "globals": {
7 "require": false,
8 "module": false,
9 "mw": false,
10 "$": false,
11 "OO": false
12 },
13 "rules": {
14 "no-restricted-properties": [
15 2,
16 {
17 "object": "$",
18 "property": "map",
19 "message": "Please use Array.prototype.map instead"
20 },
21 {
22 "object": "$",
23 "property": "inArray",
24 "message": "Please use Array.prototype.indexOf instead"
25 },
26 {
27 "object": "$",
28 "property": "each",
29 "message": "Please consider different approaches to $.each, especially when using Array's. You can override this warning if necessary with eslint-disable-next-line."
30 },
31 {
32 "object": "$",
33 "property": "isArray",
34 "message": "Please use Array.isArray instead"
35 },
36 {
37 "object": "$",
38 "property": "isFunction",
39 "message": "Please use typeof (e.g. typeof e === 'function') instead"
40 },
41 {
42 "object": "$",
43 "property": "grep",
44 "message": "Please use Array.prototype.filter instead"
45 },
46 {
47 "object": "$",
48 "property": "trim",
49 "message": "Please use String.prototype.trim instead"
50 },
51 {
52 "object": "$",
53 "property": "proxy",
54 "message": "Please use Function.prototype.bind instead"
55 },
56
57 {
58 "property": "codePointAt",
59 "message": "Unsupported method String.prototype.codePointAt requires ES6."
60 },
61 {
62 "property": "endsWith",
63 "message": "Unsupported method String.prototype.endsWith requires ES6."
64 },
65 {
66 "property": "normalize",
67 "message": "Unsupported method String.prototype.normalize requires ES6."
68 },
69 {
70 "property": "padEnd",
71 "message": "Unsupported method String.prototype.padEnd requires ES2017."
72 },
73 {
74 "property": "padStart",
75 "message": "Unsupported method String.prototype.padStart requires ES2017."
76 },
77 {
78 "property": "repeat",
79 "message": "Unsupported method String.prototype.repeat requires ES6."
80 },
81 {
82 "property": "startsWith",
83 "message": "Unsupported method String.prototype.startsWith requires ES6."
84 },
85 {
86 "property": "trimEnd",
87 "message": "Unsupported method String.prototype.trimEnd is still experimental."
88 },
89 {
90 "property": "trimLeft",
91 "message": "Unsupported method String.prototype.trimLeft is still experimental."
92 },
93 {
94 "property": "trimRight",
95 "message": "Unsupported method String.prototype.trimRight is still experimental."
96 },
97 {
98 "property": "trimStart",
99 "message": "Unsupported method String.prototype.trimStart is still experimental."
100 },
101 {
102 "property": "copyWithin",
103 "message": "Unsupported method Array.prototype.copyWithin requires ES6."
104 },
105 {
106 "property": "entries",
107 "message": "Unsupported method Array.prototype.entries requires ES6."
108 },
109 {
110 "property": "fill",
111 "message": "Unsupported method Array.prototype.fill requires ES6."
112 },
113 {
114 "property": "findIndex",
115 "message": "Unsupported method Array.prototype.findIndex requires ES6."
116 },
117 {
118 "property": "flat",
119 "message": "Unsupported method Array.prototype.flat is still experimental."
120 },
121 {
122 "property": "flatMap",
123 "message": "Unsupported method Array.prototype.flatMap is still experimental."
124 },
125 {
126 "object": "String",
127 "property": "fromCodePoint",
128 "message": "Unsupported method String.fromCodePoint requires ES6."
129 },
130 {
131 "object": "String",
132 "property": "raw",
133 "message": "Unsupported method String.raw requires ES6."
134 },
135 {
136 "object": "Array",
137 "property": "from",
138 "message": "Unsupported method Array.from requires ES6."
139 },
140 {
141 "object": "Array",
142 "property": "of",
143 "message": "Unsupported method Array.of requires ES6."
144 },
145 {
146 "object": "Object",
147 "property": "assign",
148 "message": "Unsupported method Object.assign requires ES6."
149 },
150 {
151 "object": "Object",
152 "property": "entries",
153 "message": "Unsupported method Object.entries requires ES2017."
154 },
155 {
156 "object": "Object",
157 "property": "getOwnPropertyDescriptors",
158 "message": "Unsupported method Object.getOwnPropertyDescriptors requires ES2017."
159 },
160 {
161 "object": "Object",
162 "property": "getOwnPropertySymbols",
163 "message": "Unsupported method Object.getOwnPropertySymbols requires ES6."
164 },
165 {
166 "object": "Object",
167 "property": "is",
168 "message": "Unsupported method Object.is requires ES6."
169 },
170 {
171 "object": "Object",
172 "property": "values",
173 "message": "Unsupported method Object.values requires ES2017."
174 }
175 ],
176 "no-restricted-syntax": [
177 2,
178 {
179 // Match expressions like .includes( … ) (false positives when used as a property name)
180 "selector": "CallExpression[callee.type='MemberExpression'][callee.property.type='Identifier'][callee.property.name='includes']",
181 "message": "Unsupported methods String.prototype.includes and Array.prototype.includes require ES6 and ES2016 respectively."
182 },
183 {
184 // Match expressions like .find( function ( … ) { … } ) (avoid $( … ).find( … ))
185 "selector": "CallExpression[callee.type='MemberExpression'][callee.property.type='Identifier'][callee.property.name='find'][arguments.length=1][arguments.0.type='FunctionExpression']",
186 "message": "Unsupported method Array.prototype.find requires ES6."
187 },
188 {
189 // Match expressions like .keys( … ), except Object.keys( … ) (which is valid)
190 "selector": "CallExpression[callee.type='MemberExpression'][callee.property.type='Identifier'][callee.property.name='keys'][callee.object.name!='Object']",
191 "message": "Unsupported method Array.prototype.keys requires ES6."
192 },
193 {
194 // Match expressions like .values( … ), except Object.values( … ) (disallowed separately)
195 "selector": "CallExpression[callee.type='MemberExpression'][callee.property.type='Identifier'][callee.property.name='values'][callee.object.name!='Object']",
196 "message": "Unsupported method Array.prototype.values requires ES6."
197 }
198 ],
199 "dot-notation": 0,
200 "max-len": 0
201 }
202 }