@@ -267,6 +267,8 @@ export const defaultRulesTSChecked = {
267
267
/** @type {NonNullable<Config['rules']> } */
268
268
export const defaultRulesES3 = {
269
269
...defaultRules ,
270
+ // required in ES3
271
+ // ================
270
272
"no-var" : "off" ,
271
273
"object-shorthand" : [ "error" , "never" ] ,
272
274
"prefer-arrow-callback" : "off" ,
@@ -277,13 +279,6 @@ export const defaultRulesES3 = {
277
279
"prefer-spread" : "off" ,
278
280
"radix" : "off" ,
279
281
"@stylistic/comma-dangle" : "error" ,
280
- // treat var as let
281
- // unfortunately incompatible with reusing i
282
- // "block-scoped-var": "error",
283
- "no-caller" : "error" ,
284
- "no-invalid-this" : "error" ,
285
- "no-new-wrappers" : "error" ,
286
- "no-restricted-globals" : [ "error" , "Proxy" , "Reflect" , "Symbol" , "WeakSet" , "WeakMap" ] ,
287
282
"no-unused-vars" : [ "warn" , {
288
283
args : "all" ,
289
284
argsIgnorePattern : "." ,
@@ -292,6 +287,17 @@ export const defaultRulesES3 = {
292
287
destructuredArrayIgnorePattern : "." ,
293
288
ignoreRestSiblings : true ,
294
289
} ] ,
290
+
291
+ // with no block scoping, coming up with original variable names is too hard
292
+ "no-redeclare" : "off" ,
293
+
294
+ // treat var as let
295
+ // unfortunately doesn't actually let me redeclare
296
+ // "block-scoped-var": "error",
297
+ "no-caller" : "error" ,
298
+ "no-invalid-this" : "error" ,
299
+ "no-new-wrappers" : "error" ,
300
+ "no-restricted-globals" : [ "error" , "Proxy" , "Reflect" , "Symbol" , "WeakSet" , "WeakMap" ] ,
295
301
"unicode-bom" : "error" ,
296
302
} ;
297
303
@@ -388,7 +394,6 @@ export default tseslint.config([
388
394
"@stylistic/max-len" : "off" ,
389
395
// we use these for the big IIFEs that wrap entire files
390
396
"@stylistic/padded-blocks" : "off" ,
391
- "no-redeclare" : "off" ,
392
397
// TODO: actually fix useless escapes
393
398
"no-useless-escape" : "off" ,
394
399
"no-shadow-restricted-names" : "error" ,
@@ -398,7 +403,7 @@ export default tseslint.config([
398
403
{
399
404
name : "JavaScript for Node" ,
400
405
files : [
401
- '*.mjs' ,
406
+ '*.mjs' , // look mom I'm linting myself!
402
407
'build-tools/*.js' ,
403
408
'build-tools/update' ,
404
409
'build-tools/build-*' ,
0 commit comments