eslint-plugin-lube 0.4.3 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/index.js +126 -125
  2. package/package.json +39 -31
  3. package/rules/pretty-imports.js +15 -15
  4. package/rules/pretty-jsdoc-casting.js +37 -29
  5. package/rules/pretty-sequence.js +61 -52
  6. package/rules/svelte-naming-convention.js +19 -19
  7. package/test/pretty-imports/ExportNamedDeclaration.js +32 -24
  8. package/test/pretty-imports/ImportDeclaration.js +32 -24
  9. package/test/pretty-imports.js +3 -3
  10. package/test/pretty-jsdoc-casting/case_by_expression.js +73 -25
  11. package/test/pretty-jsdoc-casting/various_situations.js +31 -11
  12. package/test/pretty-jsdoc-casting.js +3 -3
  13. package/test/pretty-sequence/case_by_node_type.js +62 -30
  14. package/test/pretty-sequence/case_by_option.js +31 -15
  15. package/test/pretty-sequence/various_situations.js +34 -9
  16. package/test/pretty-sequence.js +3 -3
  17. package/test/svelte-naming-convention/basic_snake_case.js +21 -8
  18. package/test/svelte-naming-convention/case_by_identifier.js +761 -195
  19. package/test/svelte-naming-convention/snake_case_with_symbols.js +28 -7
  20. package/test/svelte-naming-convention.js +3 -3
  21. package/tsconfig.json +10 -2
  22. package/types/index.d.ts +15 -0
  23. package/types/index.d.ts.map +1 -0
  24. package/types/rules/pretty-imports.d.ts +3 -0
  25. package/types/rules/pretty-imports.d.ts.map +1 -0
  26. package/types/rules/pretty-jsdoc-casting.d.ts +3 -0
  27. package/types/rules/pretty-jsdoc-casting.d.ts.map +1 -0
  28. package/types/rules/pretty-sequence.d.ts +3 -0
  29. package/types/rules/pretty-sequence.d.ts.map +1 -0
  30. package/types/rules/svelte-naming-convention.d.ts +3 -0
  31. package/types/rules/svelte-naming-convention.d.ts.map +1 -0
  32. package/types/test/pretty-imports/ExportNamedDeclaration.d.ts +2 -0
  33. package/types/test/pretty-imports/ExportNamedDeclaration.d.ts.map +1 -0
  34. package/types/test/pretty-imports/ImportDeclaration.d.ts +2 -0
  35. package/types/test/pretty-imports/ImportDeclaration.d.ts.map +1 -0
  36. package/types/test/pretty-imports.d.ts +2 -0
  37. package/types/test/pretty-imports.d.ts.map +1 -0
  38. package/types/test/pretty-jsdoc-casting/case_by_expression.d.ts +2 -0
  39. package/types/test/pretty-jsdoc-casting/case_by_expression.d.ts.map +1 -0
  40. package/types/test/pretty-jsdoc-casting/various_situations.d.ts +2 -0
  41. package/types/test/pretty-jsdoc-casting/various_situations.d.ts.map +1 -0
  42. package/types/test/pretty-jsdoc-casting.d.ts +2 -0
  43. package/types/test/pretty-jsdoc-casting.d.ts.map +1 -0
  44. package/types/test/pretty-sequence/case_by_node_type.d.ts +2 -0
  45. package/types/test/pretty-sequence/case_by_node_type.d.ts.map +1 -0
  46. package/types/test/pretty-sequence/case_by_option.d.ts +2 -0
  47. package/types/test/pretty-sequence/case_by_option.d.ts.map +1 -0
  48. package/types/test/pretty-sequence/various_situations.d.ts +2 -0
  49. package/types/test/pretty-sequence/various_situations.d.ts.map +1 -0
  50. package/types/test/pretty-sequence.d.ts +2 -0
  51. package/types/test/pretty-sequence.d.ts.map +1 -0
  52. package/types/test/svelte-naming-convention/basic_snake_case.d.ts +2 -0
  53. package/types/test/svelte-naming-convention/basic_snake_case.d.ts.map +1 -0
  54. package/types/test/svelte-naming-convention/case_by_identifier.d.ts +2 -0
  55. package/types/test/svelte-naming-convention/case_by_identifier.d.ts.map +1 -0
  56. package/types/test/svelte-naming-convention/snake_case_with_symbols.d.ts +2 -0
  57. package/types/test/svelte-naming-convention/snake_case_with_symbols.d.ts.map +1 -0
  58. package/types/test/svelte-naming-convention.d.ts +2 -0
  59. package/types/test/svelte-naming-convention.d.ts.map +1 -0
@@ -13,9 +13,21 @@ exports.module = (valid, invalid) => {
13
13
  var value = [ pendingA ]
14
14
  `,
15
15
  errors: [
16
- { line: 3, column: 18 },
17
- { line: 4, column: 8 },
18
- { line: 5, column: 18 }
16
+ {
17
+ column: 18,
18
+ line: 3,
19
+ messageId: "not_match"
20
+ },
21
+ {
22
+ column: 8,
23
+ line: 4,
24
+ messageId: "not_match"
25
+ },
26
+ {
27
+ column: 18,
28
+ line: 5,
29
+ messageId: "not_match"
30
+ }
19
31
  ],
20
32
  output: `
21
33
  var value = [ deferA ]
@@ -27,16 +39,32 @@ exports.module = (valid, invalid) => {
27
39
  // ArrayPattern
28
40
  {
29
41
  code: "var [ camelCase ] = value",
30
- errors: [ { line: 1, column: 7 } ],
42
+ errors: [
43
+ {
44
+ column: 7,
45
+ line: 1,
46
+ messageId: "not_match"
47
+ }
48
+ ],
31
49
  output: "var [ camel_case ] = value",
32
- parserOptions: { ecmaVersion: "latest" }
50
+ languageOptions: {
51
+ parserOptions: { ecmaVersion: "latest" }
52
+ }
33
53
  },
34
54
  // ArrowFunctionExpression
35
55
  {
36
56
  code: "(camelCase) => {}",
37
- errors: [ { line: 1, column: 2 } ],
57
+ errors: [
58
+ {
59
+ column: 2,
60
+ line: 1,
61
+ messageId: "not_match"
62
+ }
63
+ ],
38
64
  output: "(camel_case) => {}",
39
- parserOptions: { ecmaVersion: "latest" }
65
+ languageOptions: {
66
+ parserOptions: { ecmaVersion: "latest" }
67
+ }
40
68
  },
41
69
  // AssignmentExpression
42
70
  {
@@ -48,12 +76,36 @@ exports.module = (valid, invalid) => {
48
76
  function func({ pendingA = 123 }) {}
49
77
  `,
50
78
  errors: [
51
- { line: 3, column: 4 },
52
- { line: 3, column: 15 },
53
- { line: 4, column: 8 },
54
- { line: 4, column: 18 },
55
- { line: 5, column: 4 },
56
- { line: 5, column: 15 }
79
+ {
80
+ column: 4,
81
+ line: 3,
82
+ messageId: "not_match"
83
+ },
84
+ {
85
+ column: 15,
86
+ line: 3,
87
+ messageId: "not_match"
88
+ },
89
+ {
90
+ column: 8,
91
+ line: 4,
92
+ messageId: "not_match"
93
+ },
94
+ {
95
+ column: 18,
96
+ line: 4,
97
+ messageId: "not_match"
98
+ },
99
+ {
100
+ column: 4,
101
+ line: 5,
102
+ messageId: "not_match"
103
+ },
104
+ {
105
+ column: 15,
106
+ line: 5,
107
+ messageId: "not_match"
108
+ }
57
109
  ],
58
110
  output: `
59
111
  deferA = deferB
@@ -62,7 +114,9 @@ exports.module = (valid, invalid) => {
62
114
  pending_a = pending_b
63
115
  function func({ pendingA = 123 }) {}
64
116
  `,
65
- parserOptions: { ecmaVersion: "latest" }
117
+ languageOptions: {
118
+ parserOptions: { ecmaVersion: "latest" }
119
+ }
66
120
  },
67
121
  // AssignmentPattern
68
122
  {
@@ -73,10 +127,26 @@ exports.module = (valid, invalid) => {
73
127
  (snake_case = pendingA) => {}
74
128
  `,
75
129
  errors: [
76
- { line: 2, column: 5 },
77
- { line: 3, column: 18 },
78
- { line: 4, column: 8 },
79
- { line: 5, column: 18 }
130
+ {
131
+ column: 5,
132
+ line: 2,
133
+ messageId: "not_match"
134
+ },
135
+ {
136
+ column: 18,
137
+ line: 3,
138
+ messageId: "not_match"
139
+ },
140
+ {
141
+ column: 8,
142
+ line: 4,
143
+ messageId: "not_match"
144
+ },
145
+ {
146
+ column: 18,
147
+ line: 5,
148
+ messageId: "not_match"
149
+ }
80
150
  ],
81
151
  output: `
82
152
  (camel_case = deferA) => {}
@@ -84,7 +154,9 @@ exports.module = (valid, invalid) => {
84
154
  var pending_a
85
155
  (snake_case = pending_a) => {}
86
156
  `,
87
- parserOptions: { ecmaVersion: "latest" }
157
+ languageOptions: {
158
+ parserOptions: { ecmaVersion: "latest" }
159
+ }
88
160
  },
89
161
  // AwaitExpression
90
162
  {
@@ -95,9 +167,21 @@ exports.module = (valid, invalid) => {
95
167
  await pendingA
96
168
  `,
97
169
  errors: [
98
- { line: 3, column: 10 },
99
- { line: 4, column: 8 },
100
- { line: 5, column: 10 }
170
+ {
171
+ column: 10,
172
+ line: 3,
173
+ messageId: "not_match"
174
+ },
175
+ {
176
+ column: 8,
177
+ line: 4,
178
+ messageId: "not_match"
179
+ },
180
+ {
181
+ column: 10,
182
+ line: 5,
183
+ messageId: "not_match"
184
+ }
101
185
  ],
102
186
  output: `
103
187
  await deferA
@@ -105,9 +189,11 @@ exports.module = (valid, invalid) => {
105
189
  var pending_a
106
190
  await pending_a
107
191
  `,
108
- parserOptions: {
109
- ecmaVersion: "latest",
110
- sourceType: "module"
192
+ languageOptions: {
193
+ parserOptions: {
194
+ ecmaVersion: "latest",
195
+ sourceType: "module"
196
+ }
111
197
  }
112
198
  },
113
199
  // BinaryExpression
@@ -119,12 +205,36 @@ exports.module = (valid, invalid) => {
119
205
  pendingA / pendingB
120
206
  `,
121
207
  errors: [
122
- { line: 3, column: 4 },
123
- { line: 3, column: 15 },
124
- { line: 4, column: 8 },
125
- { line: 4, column: 18 },
126
- { line: 5, column: 4 },
127
- { line: 5, column: 15 }
208
+ {
209
+ column: 4,
210
+ line: 3,
211
+ messageId: "not_match"
212
+ },
213
+ {
214
+ column: 15,
215
+ line: 3,
216
+ messageId: "not_match"
217
+ },
218
+ {
219
+ column: 8,
220
+ line: 4,
221
+ messageId: "not_match"
222
+ },
223
+ {
224
+ column: 18,
225
+ line: 4,
226
+ messageId: "not_match"
227
+ },
228
+ {
229
+ column: 4,
230
+ line: 5,
231
+ messageId: "not_match"
232
+ },
233
+ {
234
+ column: 15,
235
+ line: 5,
236
+ messageId: "not_match"
237
+ }
128
238
  ],
129
239
  output: `
130
240
  deferA = deferB
@@ -142,9 +252,21 @@ exports.module = (valid, invalid) => {
142
252
  pendingA()
143
253
  `,
144
254
  errors: [
145
- { line: 3, column: 4 },
146
- { line: 4, column: 8 },
147
- { line: 5, column: 4 }
255
+ {
256
+ column: 4,
257
+ line: 3,
258
+ messageId: "not_match"
259
+ },
260
+ {
261
+ column: 8,
262
+ line: 4,
263
+ messageId: "not_match"
264
+ },
265
+ {
266
+ column: 4,
267
+ line: 5,
268
+ messageId: "not_match"
269
+ }
148
270
  ],
149
271
  output: `
150
272
  deferA()
@@ -156,9 +278,17 @@ exports.module = (valid, invalid) => {
156
278
  // ClassDeclaration
157
279
  {
158
280
  code: "class camelCase {}",
159
- errors: [ { line: 1, column: 7 } ],
281
+ errors: [
282
+ {
283
+ column: 7,
284
+ line: 1,
285
+ messageId: "not_match"
286
+ }
287
+ ],
160
288
  output: "class camel_case {}",
161
- parserOptions: { ecmaVersion: "latest" }
289
+ languageOptions: {
290
+ parserOptions: { ecmaVersion: "latest" }
291
+ }
162
292
  },
163
293
  // ConditionalExpression
164
294
  {
@@ -169,12 +299,36 @@ exports.module = (valid, invalid) => {
169
299
  test ? pendingA : pendingB
170
300
  `,
171
301
  errors: [
172
- { line: 3, column: 11 },
173
- { line: 3, column: 22 },
174
- { line: 4, column: 8 },
175
- { line: 4, column: 18 },
176
- { line: 5, column: 11 },
177
- { line: 5, column: 22 }
302
+ {
303
+ column: 11,
304
+ line: 3,
305
+ messageId: "not_match"
306
+ },
307
+ {
308
+ column: 22,
309
+ line: 3,
310
+ messageId: "not_match"
311
+ },
312
+ {
313
+ column: 8,
314
+ line: 4,
315
+ messageId: "not_match"
316
+ },
317
+ {
318
+ column: 18,
319
+ line: 4,
320
+ messageId: "not_match"
321
+ },
322
+ {
323
+ column: 11,
324
+ line: 5,
325
+ messageId: "not_match"
326
+ },
327
+ {
328
+ column: 22,
329
+ line: 5,
330
+ messageId: "not_match"
331
+ }
178
332
  ],
179
333
  output: `
180
334
  test ? deferA : deferB
@@ -189,14 +343,22 @@ exports.module = (valid, invalid) => {
189
343
  export * as camelCase from "module"
190
344
  var camelCase
191
345
  `,
192
- errors: [ { line: 3, column: 8 } ],
346
+ errors: [
347
+ {
348
+ column: 8,
349
+ line: 3,
350
+ messageId: "not_match"
351
+ }
352
+ ],
193
353
  output: `
194
354
  export * as camelCase from "module"
195
355
  var camel_case
196
356
  `,
197
- parserOptions: {
198
- ecmaVersion: "latest",
199
- sourceType: "module"
357
+ languageOptions: {
358
+ parserOptions: {
359
+ ecmaVersion: "latest",
360
+ sourceType: "module"
361
+ }
200
362
  }
201
363
  },
202
364
  // ExportDefaultDeclaration
@@ -205,15 +367,23 @@ exports.module = (valid, invalid) => {
205
367
  export default camelCase
206
368
  var camelCase
207
369
  `,
208
- errors: [ { line: 3, column: 8 } ],
370
+ errors: [
371
+ {
372
+ column: 8,
373
+ line: 3,
374
+ messageId: "not_match"
375
+ }
376
+ ],
209
377
  options: [ { fixSameNames: false } ],
210
378
  output: `
211
379
  export default camelCase
212
380
  var camel_case
213
381
  `,
214
- parserOptions: {
215
- ecmaVersion: "latest",
216
- sourceType: "module"
382
+ languageOptions: {
383
+ parserOptions: {
384
+ ecmaVersion: "latest",
385
+ sourceType: "module"
386
+ }
217
387
  }
218
388
  },
219
389
  {
@@ -222,16 +392,26 @@ exports.module = (valid, invalid) => {
222
392
  var camelCase
223
393
  `,
224
394
  errors: [
225
- { line: 2, column: 19 },
226
- { line: 3, column: 8 }
395
+ {
396
+ column: 19,
397
+ line: 2,
398
+ messageId: "not_match"
399
+ },
400
+ {
401
+ column: 8,
402
+ line: 3,
403
+ messageId: "not_match"
404
+ }
227
405
  ],
228
406
  output: `
229
407
  export default camel_case
230
408
  var camel_case
231
409
  `,
232
- parserOptions: {
233
- ecmaVersion: "latest",
234
- sourceType: "module"
410
+ languageOptions: {
411
+ parserOptions: {
412
+ ecmaVersion: "latest",
413
+ sourceType: "module"
414
+ }
235
415
  }
236
416
  },
237
417
  // ExportSpecifier
@@ -241,16 +421,26 @@ exports.module = (valid, invalid) => {
241
421
  var camelCase, camelCase2
242
422
  `,
243
423
  errors: [
244
- { line: 3, column: 8 },
245
- { line: 3, column: 19 }
424
+ {
425
+ column: 8,
426
+ line: 3,
427
+ messageId: "not_match"
428
+ },
429
+ {
430
+ column: 19,
431
+ line: 3,
432
+ messageId: "not_match"
433
+ }
246
434
  ],
247
435
  output: `
248
436
  export { default as camelCase, camelCase2 } from 'module'
249
437
  var camel_case, camel_case2
250
438
  `,
251
- parserOptions: {
252
- ecmaVersion: "latest",
253
- sourceType: "module"
439
+ languageOptions: {
440
+ parserOptions: {
441
+ ecmaVersion: "latest",
442
+ sourceType: "module"
443
+ }
254
444
  }
255
445
  },
256
446
  // ExpressionStatement
@@ -262,9 +452,21 @@ exports.module = (valid, invalid) => {
262
452
  pendingA
263
453
  `,
264
454
  errors: [
265
- { line: 3, column: 4 },
266
- { line: 4, column: 8 },
267
- { line: 5, column: 4 }
455
+ {
456
+ column: 4,
457
+ line: 3,
458
+ messageId: "not_match"
459
+ },
460
+ {
461
+ column: 8,
462
+ line: 4,
463
+ messageId: "not_match"
464
+ },
465
+ {
466
+ column: 4,
467
+ line: 5,
468
+ messageId: "not_match"
469
+ }
268
470
  ],
269
471
  output: `
270
472
  deferA
@@ -282,10 +484,26 @@ exports.module = (valid, invalid) => {
282
484
  for (snake_case in pendingA) {}
283
485
  `,
284
486
  errors: [
285
- { line: 2, column: 9 },
286
- { line: 3, column: 23 },
287
- { line: 4, column: 8 },
288
- { line: 5, column: 23 }
487
+ {
488
+ column: 9,
489
+ line: 2,
490
+ messageId: "not_match"
491
+ },
492
+ {
493
+ column: 23,
494
+ line: 3,
495
+ messageId: "not_match"
496
+ },
497
+ {
498
+ column: 8,
499
+ line: 4,
500
+ messageId: "not_match"
501
+ },
502
+ {
503
+ column: 23,
504
+ line: 5,
505
+ messageId: "not_match"
506
+ }
289
507
  ],
290
508
  output: `
291
509
  for (camel_case in deferA) {}
@@ -293,7 +511,9 @@ exports.module = (valid, invalid) => {
293
511
  var pending_a
294
512
  for (snake_case in pending_a) {}
295
513
  `,
296
- parserOptions: { ecmaVersion: "latest" }
514
+ languageOptions: {
515
+ parserOptions: { ecmaVersion: "latest" }
516
+ }
297
517
  },
298
518
  // ForStatement
299
519
  {
@@ -304,15 +524,51 @@ exports.module = (valid, invalid) => {
304
524
  for (pendingA; pendingB; pendingC) {}
305
525
  `,
306
526
  errors: [
307
- { line: 3, column: 9 },
308
- { line: 3, column: 19 },
309
- { line: 3, column: 29 },
310
- { line: 4, column: 8 },
311
- { line: 4, column: 18 },
312
- { line: 4, column: 28 },
313
- { line: 5, column: 9 },
314
- { line: 5, column: 19 },
315
- { line: 5, column: 29 }
527
+ {
528
+ column: 9,
529
+ line: 3,
530
+ messageId: "not_match"
531
+ },
532
+ {
533
+ column: 19,
534
+ line: 3,
535
+ messageId: "not_match"
536
+ },
537
+ {
538
+ column: 29,
539
+ line: 3,
540
+ messageId: "not_match"
541
+ },
542
+ {
543
+ column: 8,
544
+ line: 4,
545
+ messageId: "not_match"
546
+ },
547
+ {
548
+ column: 18,
549
+ line: 4,
550
+ messageId: "not_match"
551
+ },
552
+ {
553
+ column: 28,
554
+ line: 4,
555
+ messageId: "not_match"
556
+ },
557
+ {
558
+ column: 9,
559
+ line: 5,
560
+ messageId: "not_match"
561
+ },
562
+ {
563
+ column: 19,
564
+ line: 5,
565
+ messageId: "not_match"
566
+ },
567
+ {
568
+ column: 29,
569
+ line: 5,
570
+ messageId: "not_match"
571
+ }
316
572
  ],
317
573
  output: `
318
574
  for (deferA; deferB; deferC) {}
@@ -320,7 +576,9 @@ exports.module = (valid, invalid) => {
320
576
  var pending_a, pending_b, pending_c
321
577
  for (pending_a; pending_b; pending_c) {}
322
578
  `,
323
- parserOptions: { ecmaVersion: "latest" }
579
+ languageOptions: {
580
+ parserOptions: { ecmaVersion: "latest" }
581
+ }
324
582
  },
325
583
  // FunctionDeclaration
326
584
  {
@@ -330,17 +588,27 @@ exports.module = (valid, invalid) => {
330
588
  export function camelCase$() {}
331
589
  `,
332
590
  errors: [
333
- { line: 2, column: 13 },
334
- { line: 4, column: 20 }
591
+ {
592
+ column: 13,
593
+ line: 2,
594
+ messageId: "not_match"
595
+ },
596
+ {
597
+ column: 20,
598
+ line: 4,
599
+ messageId: "not_match"
600
+ }
335
601
  ],
336
602
  output: `
337
603
  function camel_case() {}
338
604
  export function camelCase2() {}
339
605
  export function camel_case$() {}
340
606
  `,
341
- parserOptions: {
342
- ecmaVersion: "latest",
343
- sourceType: "module"
607
+ languageOptions: {
608
+ parserOptions: {
609
+ ecmaVersion: "latest",
610
+ sourceType: "module"
611
+ }
344
612
  }
345
613
  },
346
614
  // IfStatement
@@ -352,9 +620,21 @@ exports.module = (valid, invalid) => {
352
620
  if (pendingA) {}
353
621
  `,
354
622
  errors: [
355
- { line: 3, column: 8 },
356
- { line: 4, column: 8 },
357
- { line: 5, column: 8 }
623
+ {
624
+ column: 8,
625
+ line: 3,
626
+ messageId: "not_match"
627
+ },
628
+ {
629
+ column: 8,
630
+ line: 4,
631
+ messageId: "not_match"
632
+ },
633
+ {
634
+ column: 8,
635
+ line: 5,
636
+ messageId: "not_match"
637
+ }
358
638
  ],
359
639
  output: `
360
640
  if (deferA) {}
@@ -366,21 +646,37 @@ exports.module = (valid, invalid) => {
366
646
  // ImportDefaultSpecifier
367
647
  {
368
648
  code: "import camelCase from 'module'",
369
- errors: [ { line: 1, column: 8 } ],
649
+ errors: [
650
+ {
651
+ column: 8,
652
+ line: 1,
653
+ messageId: "not_match"
654
+ }
655
+ ],
370
656
  output: "import camel_case from 'module'",
371
- parserOptions: {
372
- ecmaVersion: "latest",
373
- sourceType: "module"
657
+ languageOptions: {
658
+ parserOptions: {
659
+ ecmaVersion: "latest",
660
+ sourceType: "module"
661
+ }
374
662
  }
375
663
  },
376
664
  // ImportNamespaceSpecifier
377
665
  {
378
666
  code: "import * as camelCase from 'module'",
379
- errors: [ { line: 1, column: 13 } ],
667
+ errors: [
668
+ {
669
+ column: 13,
670
+ line: 1,
671
+ messageId: "not_match"
672
+ }
673
+ ],
380
674
  output: "import * as camel_case from 'module'",
381
- parserOptions: {
382
- ecmaVersion: "latest",
383
- sourceType: "module"
675
+ languageOptions: {
676
+ parserOptions: {
677
+ ecmaVersion: "latest",
678
+ sourceType: "module"
679
+ }
384
680
  }
385
681
  },
386
682
  // ImportSpecifier
@@ -391,17 +687,27 @@ exports.module = (valid, invalid) => {
391
687
  camelCase2
392
688
  `,
393
689
  errors: [
394
- { line: 2, column: 25 },
395
- { line: 3, column: 4 }
690
+ {
691
+ column: 25,
692
+ line: 2,
693
+ messageId: "not_match"
694
+ },
695
+ {
696
+ column: 4,
697
+ line: 3,
698
+ messageId: "not_match"
699
+ }
396
700
  ],
397
701
  output: `
398
702
  import { imported as camel_case, camelCase2, camelCase3 } from "module"
399
703
  camel_case
400
704
  camelCase2
401
705
  `,
402
- parserOptions: {
403
- ecmaVersion: "latest",
404
- sourceType: "module"
706
+ languageOptions: {
707
+ parserOptions: {
708
+ ecmaVersion: "latest",
709
+ sourceType: "module"
710
+ }
405
711
  }
406
712
  },
407
713
  // LogicalExpression
@@ -413,12 +719,36 @@ exports.module = (valid, invalid) => {
413
719
  pendingA ?? pendingB
414
720
  `,
415
721
  errors: [
416
- { line: 3, column: 4 },
417
- { line: 3, column: 16 },
418
- { line: 4, column: 8 },
419
- { line: 4, column: 18 },
420
- { line: 5, column: 4 },
421
- { line: 5, column: 16 }
722
+ {
723
+ column: 4,
724
+ line: 3,
725
+ messageId: "not_match"
726
+ },
727
+ {
728
+ column: 16,
729
+ line: 3,
730
+ messageId: "not_match"
731
+ },
732
+ {
733
+ column: 8,
734
+ line: 4,
735
+ messageId: "not_match"
736
+ },
737
+ {
738
+ column: 18,
739
+ line: 4,
740
+ messageId: "not_match"
741
+ },
742
+ {
743
+ column: 4,
744
+ line: 5,
745
+ messageId: "not_match"
746
+ },
747
+ {
748
+ column: 16,
749
+ line: 5,
750
+ messageId: "not_match"
751
+ }
422
752
  ],
423
753
  output: `
424
754
  deferA && deferB
@@ -426,7 +756,9 @@ exports.module = (valid, invalid) => {
426
756
  var pending_a, pending_b
427
757
  pending_a ?? pending_b
428
758
  `,
429
- parserOptions: { ecmaVersion: "latest" }
759
+ languageOptions: {
760
+ parserOptions: { ecmaVersion: "latest" }
761
+ }
430
762
  },
431
763
  // MemberExpression
432
764
  {
@@ -441,12 +773,36 @@ exports.module = (valid, invalid) => {
441
773
  object[pendingB]
442
774
  `,
443
775
  errors: [
444
- { line: 3, column: 4 },
445
- { line: 4, column: 8 },
446
- { line: 5, column: 4 },
447
- { line: 7, column: 11 },
448
- { line: 8, column: 8 },
449
- { line: 9, column: 11 }
776
+ {
777
+ column: 4,
778
+ line: 3,
779
+ messageId: "not_match"
780
+ },
781
+ {
782
+ column: 8,
783
+ line: 4,
784
+ messageId: "not_match"
785
+ },
786
+ {
787
+ column: 4,
788
+ line: 5,
789
+ messageId: "not_match"
790
+ },
791
+ {
792
+ column: 11,
793
+ line: 7,
794
+ messageId: "not_match"
795
+ },
796
+ {
797
+ column: 8,
798
+ line: 8,
799
+ messageId: "not_match"
800
+ },
801
+ {
802
+ column: 11,
803
+ line: 9,
804
+ messageId: "not_match"
805
+ }
450
806
  ],
451
807
  output: `
452
808
  deferA.camelCase
@@ -465,12 +821,20 @@ exports.module = (valid, invalid) => {
465
821
  class ObjectB { camelCase() {} }
466
822
  var camelCase
467
823
  `,
468
- errors: [ { line: 3, column: 8 } ],
824
+ errors: [
825
+ {
826
+ column: 8,
827
+ line: 3,
828
+ messageId: "not_match"
829
+ }
830
+ ],
469
831
  output: `
470
832
  class ObjectB { camelCase() {} }
471
833
  var camel_case
472
834
  `,
473
- parserOptions: { ecmaVersion: "latest" }
835
+ languageOptions: {
836
+ parserOptions: { ecmaVersion: "latest" }
837
+ }
474
838
  },
475
839
  // NewExpression
476
840
  {
@@ -481,9 +845,21 @@ exports.module = (valid, invalid) => {
481
845
  new pendingA
482
846
  `,
483
847
  errors: [
484
- { line: 3, column: 8 },
485
- { line: 4, column: 8 },
486
- { line: 5, column: 8 }
848
+ {
849
+ column: 8,
850
+ line: 3,
851
+ messageId: "not_match"
852
+ },
853
+ {
854
+ column: 8,
855
+ line: 4,
856
+ messageId: "not_match"
857
+ },
858
+ {
859
+ column: 8,
860
+ line: 5,
861
+ messageId: "not_match"
862
+ }
487
863
  ],
488
864
  output: `
489
865
  new deferA
@@ -502,10 +878,26 @@ exports.module = (valid, invalid) => {
502
878
  var value = { pendingA }
503
879
  `,
504
880
  errors: [
505
- { line: 3, column: 23 },
506
- { line: 4, column: 8 },
507
- { line: 5, column: 23 },
508
- { line: 6, column: 18 }
881
+ {
882
+ line: 3,
883
+ column: 23,
884
+ messageId: "not_match"
885
+ },
886
+ {
887
+ column: 8,
888
+ line: 4,
889
+ messageId: "not_match"
890
+ },
891
+ {
892
+ column: 23,
893
+ line: 5,
894
+ messageId: "not_match"
895
+ },
896
+ {
897
+ column: 18,
898
+ line: 6,
899
+ messageId: "not_match"
900
+ }
509
901
  ],
510
902
  output: `
511
903
  var value = { camelCase: deferA }
@@ -514,7 +906,9 @@ exports.module = (valid, invalid) => {
514
906
  var value = { key: pending_a }
515
907
  var value = { pendingA: pending_a }
516
908
  `,
517
- parserOptions: { ecmaVersion: "latest" }
909
+ languageOptions: {
910
+ parserOptions: { ecmaVersion: "latest" }
911
+ }
518
912
  },
519
913
  // PropertyDefinition
520
914
  {
@@ -523,14 +917,24 @@ exports.module = (valid, invalid) => {
523
917
  var camelCase, camelCase2
524
918
  `,
525
919
  errors: [
526
- { line: 3, column: 8 },
527
- { line: 3, column: 19 }
920
+ {
921
+ column: 8,
922
+ line: 3,
923
+ messageId: "not_match"
924
+ },
925
+ {
926
+ column: 19,
927
+ line: 3,
928
+ messageId: "not_match"
929
+ }
528
930
  ],
529
931
  output: `
530
932
  class ObjectB { camelCase = camelCase2 }
531
933
  var camel_case, camel_case2
532
934
  `,
533
- parserOptions: { ecmaVersion: "latest" }
935
+ languageOptions: {
936
+ parserOptions: { ecmaVersion: "latest" }
937
+ }
534
938
  },
535
939
  //RestElement
536
940
  {
@@ -539,14 +943,24 @@ exports.module = (valid, invalid) => {
539
943
  var { ...camelCaseB } = value
540
944
  `,
541
945
  errors: [
542
- { line: 2, column: 13 },
543
- { line: 3, column: 13 }
946
+ {
947
+ column: 13,
948
+ line: 2,
949
+ messageId: "not_match"
950
+ },
951
+ {
952
+ column: 13,
953
+ line: 3,
954
+ messageId: "not_match"
955
+ }
544
956
  ],
545
957
  output: `
546
958
  var [ ...camel_case_a ] = value
547
959
  var { ...camel_case_b } = value
548
960
  `,
549
- parserOptions: { ecmaVersion: "latest" }
961
+ languageOptions: {
962
+ parserOptions: { ecmaVersion: "latest" }
963
+ }
550
964
  },
551
965
  // ReturnStatement
552
966
  {
@@ -557,9 +971,21 @@ exports.module = (valid, invalid) => {
557
971
  function func_c() { return pendingA }
558
972
  `,
559
973
  errors: [
560
- { line: 3, column: 31 },
561
- { line: 4, column: 8 },
562
- { line: 5, column: 31 }
974
+ {
975
+ column: 31,
976
+ line: 3,
977
+ messageId: "not_match"
978
+ },
979
+ {
980
+ column: 8,
981
+ line: 4,
982
+ messageId: "not_match"
983
+ },
984
+ {
985
+ column: 31,
986
+ line: 5,
987
+ messageId: "not_match"
988
+ }
563
989
  ],
564
990
  output: `
565
991
  function func_a() { return deferA }
@@ -577,9 +1003,21 @@ exports.module = (valid, invalid) => {
577
1003
  a, b, pendingA
578
1004
  `,
579
1005
  errors: [
580
- { line: 3, column: 10 },
581
- { line: 4, column: 8 },
582
- { line: 5, column: 10 }
1006
+ {
1007
+ column: 10,
1008
+ line: 3,
1009
+ messageId: "not_match"
1010
+ },
1011
+ {
1012
+ column: 8,
1013
+ line: 4,
1014
+ messageId: "not_match"
1015
+ },
1016
+ {
1017
+ column: 10,
1018
+ line: 5,
1019
+ messageId: "not_match"
1020
+ }
583
1021
  ],
584
1022
  output: `
585
1023
  a, b, deferA
@@ -597,12 +1035,36 @@ exports.module = (valid, invalid) => {
597
1035
  var value = [ ...pendingA, pendingB ]
598
1036
  `,
599
1037
  errors: [
600
- { line: 3, column: 21 },
601
- { line: 3, column: 31 },
602
- { line: 4, column: 8 },
603
- { line: 4, column: 18 },
604
- { line: 5, column: 21 },
605
- { line: 5, column: 31 }
1038
+ {
1039
+ column: 21,
1040
+ line: 3,
1041
+ messageId: "not_match"
1042
+ },
1043
+ {
1044
+ column: 31,
1045
+ line: 3,
1046
+ messageId: "not_match"
1047
+ },
1048
+ {
1049
+ column: 8,
1050
+ line: 4,
1051
+ messageId: "not_match"
1052
+ },
1053
+ {
1054
+ column: 18,
1055
+ line: 4,
1056
+ messageId: "not_match"
1057
+ },
1058
+ {
1059
+ column: 21,
1060
+ line: 5,
1061
+ messageId: "not_match"
1062
+ },
1063
+ {
1064
+ column: 31,
1065
+ line: 5,
1066
+ messageId: "not_match"
1067
+ }
606
1068
  ],
607
1069
  output: `
608
1070
  var value = [ ...deferA, deferB ]
@@ -610,7 +1072,9 @@ exports.module = (valid, invalid) => {
610
1072
  var pending_a, pending_b
611
1073
  var value = [ ...pending_a, pending_b ]
612
1074
  `,
613
- parserOptions: { ecmaVersion: "latest" }
1075
+ languageOptions: {
1076
+ parserOptions: { ecmaVersion: "latest" }
1077
+ }
614
1078
  },
615
1079
  // SwitchCase
616
1080
  {
@@ -621,9 +1085,21 @@ exports.module = (valid, invalid) => {
621
1085
  switch (pendingA) {}
622
1086
  `,
623
1087
  errors: [
624
- { line: 3, column: 12 },
625
- { line: 4, column: 8 },
626
- { line: 5, column: 12 }
1088
+ {
1089
+ column: 12,
1090
+ line: 3,
1091
+ messageId: "not_match"
1092
+ },
1093
+ {
1094
+ column: 8,
1095
+ line: 4,
1096
+ messageId: "not_match"
1097
+ },
1098
+ {
1099
+ column: 12,
1100
+ line: 5,
1101
+ messageId: "not_match"
1102
+ }
627
1103
  ],
628
1104
  output: `
629
1105
  switch (deferA) {}
@@ -641,9 +1117,21 @@ exports.module = (valid, invalid) => {
641
1117
  switch (cond) { case pendingA: break }
642
1118
  `,
643
1119
  errors: [
644
- { line: 3, column: 25 },
645
- { line: 4, column: 8 },
646
- { line: 5, column: 25 }
1120
+ {
1121
+ column: 25,
1122
+ line: 3,
1123
+ messageId: "not_match"
1124
+ },
1125
+ {
1126
+ column: 8,
1127
+ line: 4,
1128
+ messageId: "not_match"
1129
+ },
1130
+ {
1131
+ column: 25,
1132
+ line: 5,
1133
+ messageId: "not_match"
1134
+ }
647
1135
  ],
648
1136
  output: `
649
1137
  switch (cond) { case deferA: break }
@@ -661,9 +1149,21 @@ exports.module = (valid, invalid) => {
661
1149
  pendingA\`quasis\${expression}quasis\`
662
1150
  `,
663
1151
  errors: [
664
- { line: 3, column: 4 },
665
- { line: 4, column: 8 },
666
- { line: 5, column: 4 }
1152
+ {
1153
+ column: 4,
1154
+ line: 3,
1155
+ messageId: "not_match"
1156
+ },
1157
+ {
1158
+ column: 8,
1159
+ line: 4,
1160
+ messageId: "not_match"
1161
+ },
1162
+ {
1163
+ column: 4,
1164
+ line: 5,
1165
+ messageId: "not_match"
1166
+ }
667
1167
  ],
668
1168
  output: `
669
1169
  deferA\`quasis\${expression}quasis\`
@@ -671,7 +1171,9 @@ exports.module = (valid, invalid) => {
671
1171
  var pending_a
672
1172
  pending_a\`quasis\${expression}quasis\`
673
1173
  `,
674
- parserOptions: { ecmaVersion: "latest" }
1174
+ languageOptions: {
1175
+ parserOptions: { ecmaVersion: "latest" }
1176
+ }
675
1177
  },
676
1178
  // ThrowStatement
677
1179
  {
@@ -682,9 +1184,21 @@ exports.module = (valid, invalid) => {
682
1184
  throw pendingA
683
1185
  `,
684
1186
  errors: [
685
- { line: 3, column: 10 },
686
- { line: 4, column: 8 },
687
- { line: 5, column: 10 }
1187
+ {
1188
+ column: 10,
1189
+ line: 3,
1190
+ messageId: "not_match"
1191
+ },
1192
+ {
1193
+ column: 8,
1194
+ line: 4,
1195
+ messageId: "not_match"
1196
+ },
1197
+ {
1198
+ column: 10,
1199
+ line: 5,
1200
+ messageId: "not_match"
1201
+ }
688
1202
  ],
689
1203
  output: `
690
1204
  throw deferA
@@ -702,9 +1216,21 @@ exports.module = (valid, invalid) => {
702
1216
  ~pendingA
703
1217
  `,
704
1218
  errors: [
705
- { line: 3, column: 5 },
706
- { line: 4, column: 8 },
707
- { line: 5, column: 5 }
1219
+ {
1220
+ column: 5,
1221
+ line: 3,
1222
+ messageId: "not_match"
1223
+ },
1224
+ {
1225
+ column: 8,
1226
+ line: 4,
1227
+ messageId: "not_match"
1228
+ },
1229
+ {
1230
+ column: 5,
1231
+ line: 5,
1232
+ messageId: "not_match"
1233
+ }
708
1234
  ],
709
1235
  output: `
710
1236
  +deferA
@@ -722,9 +1248,21 @@ exports.module = (valid, invalid) => {
722
1248
  pendingA++
723
1249
  `,
724
1250
  errors: [
725
- { line: 3, column: 6 },
726
- { line: 4, column: 8 },
727
- { line: 5, column: 4 }
1251
+ {
1252
+ column: 6,
1253
+ line: 3,
1254
+ messageId: "not_match"
1255
+ },
1256
+ {
1257
+ column: 8,
1258
+ line: 4,
1259
+ messageId: "not_match"
1260
+ },
1261
+ {
1262
+ column: 4,
1263
+ line: 5,
1264
+ messageId: "not_match"
1265
+ }
728
1266
  ],
729
1267
  output: `
730
1268
  ++deferA
@@ -744,11 +1282,31 @@ exports.module = (valid, invalid) => {
744
1282
  export var camelCase$
745
1283
  `,
746
1284
  errors: [
747
- { line: 2, column: 8 },
748
- { line: 3, column: 21 },
749
- { line: 4, column: 8 },
750
- { line: 5, column: 21 },
751
- { line: 7, column: 15 }
1285
+ {
1286
+ column: 8,
1287
+ line: 2,
1288
+ messageId: "not_match"
1289
+ },
1290
+ {
1291
+ column: 21,
1292
+ line: 3,
1293
+ messageId: "not_match"
1294
+ },
1295
+ {
1296
+ column: 8,
1297
+ line: 4,
1298
+ messageId: "not_match"
1299
+ },
1300
+ {
1301
+ column: 21,
1302
+ line: 5,
1303
+ messageId: "not_match"
1304
+ },
1305
+ {
1306
+ column: 15,
1307
+ line: 7,
1308
+ messageId: "not_match"
1309
+ }
752
1310
  ],
753
1311
  output: `
754
1312
  var camel_case = deferA
@@ -758,9 +1316,11 @@ exports.module = (valid, invalid) => {
758
1316
  export var camelCase2
759
1317
  export var camel_case$
760
1318
  `,
761
- parserOptions: {
762
- ecmaVersion: "latest",
763
- sourceType: "module"
1319
+ languageOptions: {
1320
+ parserOptions: {
1321
+ ecmaVersion: "latest",
1322
+ sourceType: "module"
1323
+ }
764
1324
  }
765
1325
  },
766
1326
  // WhileStatement
@@ -772,9 +1332,21 @@ exports.module = (valid, invalid) => {
772
1332
  while (pendingA) {}
773
1333
  `,
774
1334
  errors: [
775
- { line: 3, column: 11 },
776
- { line: 4, column: 8 },
777
- { line: 5, column: 11 }
1335
+ {
1336
+ column: 11,
1337
+ line: 3,
1338
+ messageId: "not_match"
1339
+ },
1340
+ {
1341
+ column: 8,
1342
+ line: 4,
1343
+ messageId: "not_match"
1344
+ },
1345
+ {
1346
+ column: 11,
1347
+ line: 5,
1348
+ messageId: "not_match"
1349
+ }
778
1350
  ],
779
1351
  output: `
780
1352
  while (deferA) {}
@@ -783,26 +1355,6 @@ exports.module = (valid, invalid) => {
783
1355
  while (pending_a) {}
784
1356
  `
785
1357
  },
786
- // WithStatement
787
- {
788
- code: `
789
- with (deferA) {}
790
- with (pendingA) {}
791
- var pendingA
792
- with (pendingA) {}
793
- `,
794
- errors: [
795
- { line: 3, column: 10 },
796
- { line: 4, column: 8 },
797
- { line: 5, column: 10 }
798
- ],
799
- output: `
800
- with (deferA) {}
801
- with (pending_a) {}
802
- var pending_a
803
- with (pending_a) {}
804
- `
805
- },
806
1358
  // YieldStatement
807
1359
  {
808
1360
  code: `
@@ -812,9 +1364,21 @@ exports.module = (valid, invalid) => {
812
1364
  function* func_c() { yield pendingA }
813
1365
  `,
814
1366
  errors: [
815
- { line: 3, column: 31 },
816
- { line: 4, column: 8 },
817
- { line: 5, column: 31 }
1367
+ {
1368
+ column: 31,
1369
+ line: 3,
1370
+ messageId: "not_match"
1371
+ },
1372
+ {
1373
+ column: 8,
1374
+ line: 4,
1375
+ messageId: "not_match"
1376
+ },
1377
+ {
1378
+ column: 31,
1379
+ line: 5,
1380
+ messageId: "not_match"
1381
+ }
818
1382
  ],
819
1383
  output: `
820
1384
  function* func_a() { yield deferA }
@@ -822,7 +1386,9 @@ exports.module = (valid, invalid) => {
822
1386
  var pending_a
823
1387
  function* func_c() { yield pending_a }
824
1388
  `,
825
- parserOptions: { ecmaVersion: "latest" }
1389
+ languageOptions: {
1390
+ parserOptions: { ecmaVersion: "latest" }
1391
+ }
826
1392
  }
827
1393
  )
828
1394
  }