Skip to content

Commit 0d8c0af

Browse files
mdjermanovicKai Cataldo
authored and
Kai Cataldo
committedJan 17, 2020
Fix: improve report location for computed-property-spacing (#12795)
1 parent 756b95d commit 0d8c0af

File tree

2 files changed

+398
-128
lines changed

2 files changed

+398
-128
lines changed
 

‎lib/rules/computed-property-spacing.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ module.exports = {
6767
function reportNoBeginningSpace(node, token, tokenAfter) {
6868
context.report({
6969
node,
70-
loc: token.loc.start,
70+
loc: { start: token.loc.end, end: tokenAfter.loc.start },
7171
messageId: "unexpectedSpaceAfter",
7272
data: {
7373
tokenValue: token.value
@@ -88,7 +88,7 @@ module.exports = {
8888
function reportNoEndingSpace(node, token, tokenBefore) {
8989
context.report({
9090
node,
91-
loc: token.loc.start,
91+
loc: { start: tokenBefore.loc.end, end: token.loc.start },
9292
messageId: "unexpectedSpaceBefore",
9393
data: {
9494
tokenValue: token.value
@@ -108,7 +108,7 @@ module.exports = {
108108
function reportRequiredBeginningSpace(node, token) {
109109
context.report({
110110
node,
111-
loc: token.loc.start,
111+
loc: token.loc,
112112
messageId: "missingSpaceAfter",
113113
data: {
114114
tokenValue: token.value
@@ -128,7 +128,7 @@ module.exports = {
128128
function reportRequiredEndingSpace(node, token) {
129129
context.report({
130130
node,
131-
loc: token.loc.start,
131+
loc: token.loc,
132132
messageId: "missingSpaceBefore",
133133
data: {
134134
tokenValue: token.value

‎tests/lib/rules/computed-property-spacing.js

+394-124
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ ruleTester.run("computed-property-spacing", rule, {
184184
options: ["always", { enforceForClassMembers: true }],
185185
parserOptions: { ecmaVersion: 6 }
186186
},
187+
188+
// handling of parens and comments
187189
{
188190
code: [
189191
"const foo = {",
@@ -277,8 +279,11 @@ ruleTester.run("computed-property-spacing", rule, {
277279
messageId: "missingSpaceBefore",
278280
data: { tokenValue: "]" },
279281
type: "MemberExpression",
282+
line: 1,
280283
column: 17,
281-
line: 1
284+
endLine: 1,
285+
endColumn: 18
286+
282287
}
283288
]
284289
},
@@ -291,8 +296,10 @@ ruleTester.run("computed-property-spacing", rule, {
291296
messageId: "missingSpaceAfter",
292297
data: { tokenValue: "[" },
293298
type: "MemberExpression",
299+
line: 1,
294300
column: 14,
295-
line: 1
301+
endLine: 1,
302+
endColumn: 15
296303
}
297304
]
298305
},
@@ -305,8 +312,10 @@ ruleTester.run("computed-property-spacing", rule, {
305312
messageId: "unexpectedSpaceAfter",
306313
data: { tokenValue: "[" },
307314
type: "MemberExpression",
308-
column: 14,
309-
line: 1
315+
line: 1,
316+
column: 15,
317+
endLine: 1,
318+
endColumn: 16
310319
}
311320
]
312321
},
@@ -318,7 +327,11 @@ ruleTester.run("computed-property-spacing", rule, {
318327
{
319328
messageId: "unexpectedSpaceBefore",
320329
data: { tokenValue: "]" },
321-
type: "MemberExpression"
330+
type: "MemberExpression",
331+
line: 1,
332+
column: 16,
333+
endLine: 1,
334+
endColumn: 17
322335
}
323336
]
324337
},
@@ -331,15 +344,19 @@ ruleTester.run("computed-property-spacing", rule, {
331344
messageId: "unexpectedSpaceAfter",
332345
data: { tokenValue: "[" },
333346
type: "MemberExpression",
334-
column: 4,
335-
line: 1
347+
line: 1,
348+
column: 5,
349+
endLine: 1,
350+
endColumn: 6
336351
},
337352
{
338353
messageId: "unexpectedSpaceBefore",
339354
data: { tokenValue: "]" },
340355
type: "MemberExpression",
341-
column: 10,
342-
line: 1
356+
line: 1,
357+
column: 9,
358+
endLine: 1,
359+
endColumn: 10
343360
}
344361
]
345362
},
@@ -352,8 +369,10 @@ ruleTester.run("computed-property-spacing", rule, {
352369
messageId: "unexpectedSpaceBefore",
353370
data: { tokenValue: "]" },
354371
type: "MemberExpression",
355-
column: 9,
356-
line: 1
372+
line: 1,
373+
column: 8,
374+
endLine: 1,
375+
endColumn: 9
357376
}
358377
]
359378
},
@@ -366,8 +385,10 @@ ruleTester.run("computed-property-spacing", rule, {
366385
messageId: "unexpectedSpaceAfter",
367386
data: { tokenValue: "[" },
368387
type: "MemberExpression",
369-
column: 4,
370-
line: 1
388+
line: 1,
389+
column: 5,
390+
endLine: 1,
391+
endColumn: 6
371392
}
372393
]
373394
},
@@ -380,15 +401,128 @@ ruleTester.run("computed-property-spacing", rule, {
380401
messageId: "missingSpaceAfter",
381402
data: { tokenValue: "[" },
382403
type: "MemberExpression",
404+
line: 1,
383405
column: 14,
384-
line: 1
406+
endLine: 1,
407+
endColumn: 15
385408
},
386409
{
387410
messageId: "missingSpaceBefore",
388411
data: { tokenValue: "]" },
389412
type: "MemberExpression",
413+
line: 1,
390414
column: 16,
391-
line: 1
415+
endLine: 1,
416+
endColumn: 17
417+
}
418+
]
419+
},
420+
421+
// multiple spaces
422+
{
423+
code: "obj[ foo]",
424+
output: "obj[foo]",
425+
options: ["never"],
426+
errors: [
427+
{
428+
messageId: "unexpectedSpaceAfter",
429+
data: { tokenValue: "[" },
430+
type: "MemberExpression",
431+
line: 1,
432+
column: 5,
433+
endLine: 1,
434+
endColumn: 9
435+
}
436+
]
437+
},
438+
{
439+
code: "obj[ foo ]",
440+
output: "obj[foo]",
441+
options: ["never"],
442+
errors: [
443+
{
444+
messageId: "unexpectedSpaceAfter",
445+
data: { tokenValue: "[" },
446+
type: "MemberExpression",
447+
line: 1,
448+
column: 5,
449+
endLine: 1,
450+
endColumn: 7
451+
},
452+
{
453+
messageId: "unexpectedSpaceBefore",
454+
data: { tokenValue: "]" },
455+
type: "MemberExpression",
456+
line: 1,
457+
column: 10,
458+
endLine: 1,
459+
endColumn: 12
460+
}
461+
]
462+
},
463+
{
464+
code: "obj[ foo ]",
465+
output: "obj[foo]",
466+
options: ["never"],
467+
errors: [
468+
{
469+
messageId: "unexpectedSpaceAfter",
470+
data: { tokenValue: "[" },
471+
type: "MemberExpression",
472+
line: 1,
473+
column: 5,
474+
endLine: 1,
475+
endColumn: 8
476+
},
477+
{
478+
messageId: "unexpectedSpaceBefore",
479+
data: { tokenValue: "]" },
480+
type: "MemberExpression",
481+
line: 1,
482+
column: 11,
483+
endLine: 1,
484+
endColumn: 12
485+
}
486+
]
487+
},
488+
{
489+
code: "obj[ foo + \n bar ]",
490+
output: "obj[foo + \n bar]",
491+
options: ["never"],
492+
errors: [
493+
{
494+
messageId: "unexpectedSpaceAfter",
495+
data: { tokenValue: "[" },
496+
type: "MemberExpression",
497+
line: 1,
498+
column: 5,
499+
endLine: 1,
500+
endColumn: 6
501+
},
502+
{
503+
messageId: "unexpectedSpaceBefore",
504+
data: { tokenValue: "]" },
505+
type: "MemberExpression",
506+
line: 2,
507+
column: 6,
508+
endLine: 2,
509+
endColumn: 9
510+
}
511+
]
512+
},
513+
{
514+
code: "obj[\n foo ]",
515+
output: "obj[\n foo]",
516+
options: ["never"],
517+
errors: [
518+
{
519+
messageId: "unexpectedSpaceBefore",
520+
data: { tokenValue: "]" },
521+
type: "MemberExpression",
522+
line: 2,
523+
column: 5,
524+
endLine: 2,
525+
endColumn: 7
392526
}
393527
]
394528
},
@@ -404,15 +538,19 @@ ruleTester.run("computed-property-spacing", rule, {
404538
messageId: "missingSpaceAfter",
405539
data: { tokenValue: "[" },
406540
type: "Property",
541+
line: 1,
407542
column: 10,
408-
line: 1
543+
endLine: 1,
544+
endColumn: 11
409545
},
410546
{
411547
messageId: "missingSpaceBefore",
412548
data: { tokenValue: "]" },
413549
type: "Property",
550+
line: 1,
414551
column: 12,
415-
line: 1
552+
endLine: 1,
553+
endColumn: 13
416554
}
417555
]
418556
},
@@ -426,8 +564,10 @@ ruleTester.run("computed-property-spacing", rule, {
426564
messageId: "missingSpaceAfter",
427565
data: { tokenValue: "[" },
428566
type: "Property",
567+
line: 1,
429568
column: 10,
430-
line: 1
569+
endLine: 1,
570+
endColumn: 11
431571
}
432572
]
433573
},
@@ -441,8 +581,10 @@ ruleTester.run("computed-property-spacing", rule, {
441581
messageId: "missingSpaceBefore",
442582
data: { tokenValue: "]" },
443583
type: "Property",
584+
line: 1,
444585
column: 13,
445-
line: 1
586+
endLine: 1,
587+
endColumn: 14
446588
}
447589
]
448590
},
@@ -458,15 +600,19 @@ ruleTester.run("computed-property-spacing", rule, {
458600
messageId: "unexpectedSpaceAfter",
459601
data: { tokenValue: "[" },
460602
type: "Property",
461-
column: 10,
462-
line: 1
603+
line: 1,
604+
column: 11,
605+
endLine: 1,
606+
endColumn: 12
463607
},
464608
{
465609
messageId: "unexpectedSpaceBefore",
466610
data: { tokenValue: "]" },
467611
type: "Property",
468-
column: 14,
469-
line: 1
612+
line: 1,
613+
column: 13,
614+
endLine: 1,
615+
endColumn: 14
470616
}
471617
]
472618
},
@@ -480,8 +626,10 @@ ruleTester.run("computed-property-spacing", rule, {
480626
messageId: "unexpectedSpaceBefore",
481627
data: { tokenValue: "]" },
482628
type: "Property",
483-
column: 13,
484-
line: 1
629+
line: 1,
630+
column: 12,
631+
endLine: 1,
632+
endColumn: 13
485633
}
486634
]
487635
},
@@ -495,8 +643,10 @@ ruleTester.run("computed-property-spacing", rule, {
495643
messageId: "unexpectedSpaceAfter",
496644
data: { tokenValue: "[" },
497645
type: "Property",
498-
column: 10,
499-
line: 1
646+
line: 1,
647+
column: 11,
648+
endLine: 1,
649+
endColumn: 12
500650
}
501651
]
502652
},
@@ -510,17 +660,15 @@ ruleTester.run("computed-property-spacing", rule, {
510660
messageId: "unexpectedSpaceAfter",
511661
data: { tokenValue: "[" },
512662
type: "Property",
513-
column: 10,
514-
line: 1
663+
line: 1,
664+
column: 11,
665+
endLine: 1,
666+
endColumn: 12
515667
}
516668
]
517669
},
518670

519-
//------------------------------------------------------------------------------
520-
// Classes
521-
//------------------------------------------------------------------------------
522-
523-
// never
671+
// never - classes
524672
{
525673
code: "class A { [ a](){} }",
526674
output: "class A { [a](){} }",
@@ -531,8 +679,10 @@ ruleTester.run("computed-property-spacing", rule, {
531679
messageId: "unexpectedSpaceAfter",
532680
data: { tokenValue: "[" },
533681
type: "MethodDefinition",
534-
column: 11,
535-
line: 1
682+
line: 1,
683+
column: 12,
684+
endLine: 1,
685+
endColumn: 13
536686
}
537687
]
538688
},
@@ -546,8 +696,10 @@ ruleTester.run("computed-property-spacing", rule, {
546696
messageId: "unexpectedSpaceBefore",
547697
data: { tokenValue: "]" },
548698
type: "MethodDefinition",
549-
column: 37,
550-
line: 1
699+
line: 1,
700+
column: 36,
701+
endLine: 1,
702+
endColumn: 37
551703
}
552704
]
553705
},
@@ -561,29 +713,37 @@ ruleTester.run("computed-property-spacing", rule, {
561713
messageId: "unexpectedSpaceBefore",
562714
data: { tokenValue: "]" },
563715
type: "MethodDefinition",
564-
column: 18,
565-
line: 1
716+
line: 1,
717+
column: 17,
718+
endLine: 1,
719+
endColumn: 18
566720
},
567721
{
568722
messageId: "unexpectedSpaceAfter",
569723
data: { tokenValue: "[" },
570724
type: "MethodDefinition",
571-
column: 28,
572-
line: 1
725+
line: 1,
726+
column: 29,
727+
endLine: 1,
728+
endColumn: 30
573729
},
574730
{
575731
messageId: "unexpectedSpaceAfter",
576732
data: { tokenValue: "[" },
577733
type: "MethodDefinition",
578-
column: 81,
579-
line: 1
734+
line: 1,
735+
column: 82,
736+
endLine: 1,
737+
endColumn: 83
580738
},
581739
{
582740
messageId: "unexpectedSpaceBefore",
583741
data: { tokenValue: "]" },
584742
type: "MethodDefinition",
585-
column: 104,
586-
line: 1
743+
line: 1,
744+
column: 103,
745+
endLine: 1,
746+
endColumn: 104
587747
}
588748
]
589749
},
@@ -597,90 +757,114 @@ ruleTester.run("computed-property-spacing", rule, {
597757
messageId: "unexpectedSpaceAfter",
598758
data: { tokenValue: "[" },
599759
type: "MethodDefinition",
600-
column: 13,
601-
line: 1
760+
line: 1,
761+
column: 14,
762+
endLine: 1,
763+
endColumn: 15
602764
},
603765
{
604766
messageId: "unexpectedSpaceBefore",
605767
data: { tokenValue: "]" },
606768
type: "MethodDefinition",
607-
column: 17,
608-
line: 1
769+
line: 1,
770+
column: 16,
771+
endLine: 1,
772+
endColumn: 17
609773
},
610774
{
611775
messageId: "unexpectedSpaceAfter",
612776
data: { tokenValue: "[" },
613777
type: "MethodDefinition",
614-
column: 27,
615-
line: 1
778+
line: 1,
779+
column: 28,
780+
endLine: 1,
781+
endColumn: 29
616782
},
617783
{
618784
messageId: "unexpectedSpaceBefore",
619785
data: { tokenValue: "]" },
620786
type: "MethodDefinition",
621-
column: 31,
622-
line: 1
787+
line: 1,
788+
column: 30,
789+
endLine: 1,
790+
endColumn: 31
623791
},
624792
{
625793
messageId: "unexpectedSpaceAfter",
626794
data: { tokenValue: "[" },
627795
type: "MethodDefinition",
628-
column: 41,
629-
line: 1
796+
line: 1,
797+
column: 42,
798+
endLine: 1,
799+
endColumn: 43
630800
},
631801
{
632802
messageId: "unexpectedSpaceBefore",
633803
data: { tokenValue: "]" },
634804
type: "MethodDefinition",
635-
column: 45,
636-
line: 1
805+
line: 1,
806+
column: 44,
807+
endLine: 1,
808+
endColumn: 45
637809
},
638810
{
639811
messageId: "unexpectedSpaceAfter",
640812
data: { tokenValue: "[" },
641813
type: "MethodDefinition",
642-
column: 61,
643-
line: 1
814+
line: 1,
815+
column: 62,
816+
endLine: 1,
817+
endColumn: 63
644818
},
645819
{
646820
messageId: "unexpectedSpaceBefore",
647821
data: { tokenValue: "]" },
648822
type: "MethodDefinition",
649-
column: 65,
650-
line: 1
823+
line: 1,
824+
column: 64,
825+
endLine: 1,
826+
endColumn: 65
651827
},
652828
{
653829
messageId: "unexpectedSpaceAfter",
654830
data: { tokenValue: "[" },
655831
type: "MethodDefinition",
656-
column: 82,
657-
line: 1
832+
line: 1,
833+
column: 83,
834+
endLine: 1,
835+
endColumn: 84
658836
},
659837
{
660838
messageId: "unexpectedSpaceBefore",
661839
data: { tokenValue: "]" },
662840
type: "MethodDefinition",
663-
column: 86,
664-
line: 1
841+
line: 1,
842+
column: 85,
843+
endLine: 1,
844+
endColumn: 86
665845
},
666846
{
667847
messageId: "unexpectedSpaceAfter",
668848
data: { tokenValue: "[" },
669849
type: "MethodDefinition",
670-
column: 103,
671-
line: 1
850+
line: 1,
851+
column: 104,
852+
endLine: 1,
853+
endColumn: 105
672854
},
673855
{
674856
messageId: "unexpectedSpaceBefore",
675857
data: { tokenValue: "]" },
676858
type: "MethodDefinition",
677-
column: 107,
678-
line: 1
859+
line: 1,
860+
column: 106,
861+
endLine: 1,
862+
endColumn: 107
679863
}
680864
]
681865
},
682866

683-
// always
867+
// always - classes
684868
{
685869
code: "class A { [ a](){} }",
686870
output: "class A { [ a ](){} }",
@@ -691,8 +875,10 @@ ruleTester.run("computed-property-spacing", rule, {
691875
messageId: "missingSpaceBefore",
692876
data: { tokenValue: "]" },
693877
type: "MethodDefinition",
878+
line: 1,
694879
column: 14,
695-
line: 1
880+
endLine: 1,
881+
endColumn: 15
696882
}
697883
]
698884
},
@@ -706,8 +892,10 @@ ruleTester.run("computed-property-spacing", rule, {
706892
messageId: "missingSpaceAfter",
707893
data: { tokenValue: "[" },
708894
type: "MethodDefinition",
895+
line: 1,
709896
column: 36,
710-
line: 1
897+
endLine: 1,
898+
endColumn: 37
711899
}
712900
]
713901
},
@@ -721,29 +909,37 @@ ruleTester.run("computed-property-spacing", rule, {
721909
messageId: "missingSpaceAfter",
722910
data: { tokenValue: "[" },
723911
type: "MethodDefinition",
912+
line: 1,
724913
column: 15,
725-
line: 1
914+
endLine: 1,
915+
endColumn: 16
726916
},
727917
{
728918
messageId: "missingSpaceBefore",
729919
data: { tokenValue: "]" },
730920
type: "MethodDefinition",
921+
line: 1,
731922
column: 31,
732-
line: 1
923+
endLine: 1,
924+
endColumn: 32
733925
},
734926
{
735927
messageId: "missingSpaceBefore",
736928
data: { tokenValue: "]" },
737929
type: "MethodDefinition",
930+
line: 1,
738931
column: 84,
739-
line: 1
932+
endLine: 1,
933+
endColumn: 85
740934
},
741935
{
742936
messageId: "missingSpaceAfter",
743937
data: { tokenValue: "[" },
744938
type: "MethodDefinition",
939+
line: 1,
745940
column: 101,
746-
line: 1
941+
endLine: 1,
942+
endColumn: 102
747943
}
748944
]
749945
},
@@ -757,88 +953,114 @@ ruleTester.run("computed-property-spacing", rule, {
757953
messageId: "missingSpaceAfter",
758954
data: { tokenValue: "[" },
759955
type: "MethodDefinition",
956+
line: 1,
760957
column: 13,
761-
line: 1
958+
endLine: 1,
959+
endColumn: 14
762960
},
763961
{
764962
messageId: "missingSpaceBefore",
765963
data: { tokenValue: "]" },
766964
type: "MethodDefinition",
965+
line: 1,
767966
column: 15,
768-
line: 1
967+
endLine: 1,
968+
endColumn: 16
769969
},
770970
{
771971
messageId: "missingSpaceAfter",
772972
data: { tokenValue: "[" },
773973
type: "MethodDefinition",
974+
line: 1,
774975
column: 25,
775-
line: 1
976+
endLine: 1,
977+
endColumn: 26
776978
},
777979
{
778980
messageId: "missingSpaceBefore",
779981
data: { tokenValue: "]" },
780982
type: "MethodDefinition",
983+
line: 1,
781984
column: 27,
782-
line: 1
985+
endLine: 1,
986+
endColumn: 28
783987
},
784988
{
785989
messageId: "missingSpaceAfter",
786990
data: { tokenValue: "[" },
787991
type: "MethodDefinition",
992+
line: 1,
788993
column: 37,
789-
line: 1
994+
endLine: 1,
995+
endColumn: 38
790996
},
791997
{
792998
messageId: "missingSpaceBefore",
793999
data: { tokenValue: "]" },
7941000
type: "MethodDefinition",
1001+
line: 1,
7951002
column: 39,
796-
line: 1
1003+
endLine: 1,
1004+
endColumn: 40
7971005
},
7981006
{
7991007
messageId: "missingSpaceAfter",
8001008
data: { tokenValue: "[" },
8011009
type: "MethodDefinition",
1010+
line: 1,
8021011
column: 55,
803-
line: 1
1012+
endLine: 1,
1013+
endColumn: 56
8041014
},
8051015
{
8061016
messageId: "missingSpaceBefore",
8071017
data: { tokenValue: "]" },
8081018
type: "MethodDefinition",
1019+
line: 1,
8091020
column: 57,
810-
line: 1
1021+
endLine: 1,
1022+
endColumn: 58
8111023
},
8121024
{
8131025
messageId: "missingSpaceAfter",
8141026
data: { tokenValue: "[" },
8151027
type: "MethodDefinition",
1028+
line: 1,
8161029
column: 74,
817-
line: 1
1030+
endLine: 1,
1031+
endColumn: 75
8181032
},
8191033
{
8201034
messageId: "missingSpaceBefore",
8211035
data: { tokenValue: "]" },
8221036
type: "MethodDefinition",
1037+
line: 1,
8231038
column: 76,
824-
line: 1
1039+
endLine: 1,
1040+
endColumn: 77
8251041
},
8261042
{
8271043
messageId: "missingSpaceAfter",
8281044
data: { tokenValue: "[" },
8291045
type: "MethodDefinition",
1046+
line: 1,
8301047
column: 93,
831-
line: 1
1048+
endLine: 1,
1049+
endColumn: 94
8321050
},
8331051
{
8341052
messageId: "missingSpaceBefore",
8351053
data: { tokenValue: "]" },
8361054
type: "MethodDefinition",
1055+
line: 1,
8371056
column: 95,
838-
line: 1
1057+
endLine: 1,
1058+
endColumn: 96
8391059
}
8401060
]
8411061
},
1062+
1063+
// handling of parens and comments
8421064
{
8431065
code: [
8441066
"const foo = {",
@@ -857,15 +1079,19 @@ ruleTester.run("computed-property-spacing", rule, {
8571079
messageId: "missingSpaceAfter",
8581080
data: { tokenValue: "[" },
8591081
type: "Property",
1082+
line: 2,
8601083
column: 3,
861-
line: 2
1084+
endLine: 2,
1085+
endColumn: 4
8621086
},
8631087
{
8641088
messageId: "missingSpaceBefore",
8651089
data: { tokenValue: "]" },
8661090
type: "Property",
1091+
line: 2,
8671092
column: 7,
868-
line: 2
1093+
endLine: 2,
1094+
endColumn: 8
8691095
}
8701096
]
8711097
},
@@ -887,15 +1113,19 @@ ruleTester.run("computed-property-spacing", rule, {
8871113
messageId: "missingSpaceAfter",
8881114
data: { tokenValue: "[" },
8891115
type: "Property",
1116+
line: 2,
8901117
column: 3,
891-
line: 2
1118+
endLine: 2,
1119+
endColumn: 4
8921120
},
8931121
{
8941122
messageId: "missingSpaceBefore",
8951123
data: { tokenValue: "]" },
8961124
type: "Property",
1125+
line: 2,
8971126
column: 9,
898-
line: 2
1127+
endLine: 2,
1128+
endColumn: 10
8991129
}
9001130
]
9011131
},
@@ -917,15 +1147,19 @@ ruleTester.run("computed-property-spacing", rule, {
9171147
messageId: "unexpectedSpaceAfter",
9181148
data: { tokenValue: "[" },
9191149
type: "Property",
920-
column: 3,
921-
line: 2
1150+
line: 2,
1151+
column: 4,
1152+
endLine: 2,
1153+
endColumn: 5
9221154
},
9231155
{
9241156
messageId: "unexpectedSpaceBefore",
9251157
data: { tokenValue: "]" },
9261158
type: "Property",
927-
column: 11,
928-
line: 2
1159+
line: 2,
1160+
column: 10,
1161+
endLine: 2,
1162+
endColumn: 11
9291163
}
9301164
]
9311165
},
@@ -947,15 +1181,19 @@ ruleTester.run("computed-property-spacing", rule, {
9471181
messageId: "missingSpaceAfter",
9481182
data: { tokenValue: "[" },
9491183
type: "Property",
1184+
line: 2,
9501185
column: 3,
951-
line: 2
1186+
endLine: 2,
1187+
endColumn: 4
9521188
},
9531189
{
9541190
messageId: "missingSpaceBefore",
9551191
data: { tokenValue: "]" },
9561192
type: "Property",
1193+
line: 2,
9571194
column: 15,
958-
line: 2
1195+
endLine: 2,
1196+
endColumn: 16
9591197
}
9601198
]
9611199
},
@@ -977,15 +1215,19 @@ ruleTester.run("computed-property-spacing", rule, {
9771215
messageId: "unexpectedSpaceAfter",
9781216
data: { tokenValue: "[" },
9791217
type: "Property",
980-
column: 3,
981-
line: 2
1218+
line: 2,
1219+
column: 4,
1220+
endLine: 2,
1221+
endColumn: 5
9821222
},
9831223
{
9841224
messageId: "unexpectedSpaceBefore",
9851225
data: { tokenValue: "]" },
9861226
type: "Property",
987-
column: 17,
988-
line: 2
1227+
line: 2,
1228+
column: 16,
1229+
endLine: 2,
1230+
endColumn: 17
9891231
}
9901232
]
9911233
},
@@ -1007,29 +1249,37 @@ ruleTester.run("computed-property-spacing", rule, {
10071249
messageId: "missingSpaceAfter",
10081250
data: { tokenValue: "[" },
10091251
type: "Property",
1252+
line: 2,
10101253
column: 3,
1011-
line: 2
1254+
endLine: 2,
1255+
endColumn: 4
10121256
},
10131257
{
10141258
messageId: "missingSpaceAfter",
10151259
data: { tokenValue: "[" },
10161260
type: "MemberExpression",
1261+
line: 2,
10171262
column: 5,
1018-
line: 2
1263+
endLine: 2,
1264+
endColumn: 6
10191265
},
10201266
{
10211267
messageId: "missingSpaceBefore",
10221268
data: { tokenValue: "]" },
10231269
type: "MemberExpression",
1270+
line: 2,
10241271
column: 7,
1025-
line: 2
1272+
endLine: 2,
1273+
endColumn: 8
10261274
},
10271275
{
10281276
messageId: "missingSpaceBefore",
10291277
data: { tokenValue: "]" },
10301278
type: "Property",
1279+
line: 2,
10311280
column: 8,
1032-
line: 2
1281+
endLine: 2,
1282+
endColumn: 9
10331283
}
10341284
]
10351285
},
@@ -1051,29 +1301,37 @@ ruleTester.run("computed-property-spacing", rule, {
10511301
messageId: "unexpectedSpaceAfter",
10521302
data: { tokenValue: "[" },
10531303
type: "Property",
1054-
column: 3,
1055-
line: 2
1304+
line: 2,
1305+
column: 4,
1306+
endLine: 2,
1307+
endColumn: 5
10561308
},
10571309
{
10581310
messageId: "unexpectedSpaceAfter",
10591311
data: { tokenValue: "[" },
10601312
type: "MemberExpression",
1061-
column: 6,
1062-
line: 2
1313+
line: 2,
1314+
column: 7,
1315+
endLine: 2,
1316+
endColumn: 8
10631317
},
10641318
{
10651319
messageId: "unexpectedSpaceBefore",
10661320
data: { tokenValue: "]" },
10671321
type: "MemberExpression",
1068-
column: 10,
1069-
line: 2
1322+
line: 2,
1323+
column: 9,
1324+
endLine: 2,
1325+
endColumn: 10
10701326
},
10711327
{
10721328
messageId: "unexpectedSpaceBefore",
10731329
data: { tokenValue: "]" },
10741330
type: "Property",
1075-
column: 12,
1076-
line: 2
1331+
line: 2,
1332+
column: 11,
1333+
endLine: 2,
1334+
endColumn: 12
10771335
}
10781336
]
10791337
},
@@ -1095,22 +1353,28 @@ ruleTester.run("computed-property-spacing", rule, {
10951353
messageId: "missingSpaceAfter",
10961354
data: { tokenValue: "[" },
10971355
type: "Property",
1356+
line: 2,
10981357
column: 3,
1099-
line: 2
1358+
endLine: 2,
1359+
endColumn: 4
11001360
},
11011361
{
11021362
messageId: "missingSpaceAfter",
11031363
data: { tokenValue: "[" },
11041364
type: "MemberExpression",
1365+
line: 2,
11051366
column: 5,
1106-
line: 2
1367+
endLine: 2,
1368+
endColumn: 6
11071369
},
11081370
{
11091371
messageId: "missingSpaceBefore",
11101372
data: { tokenValue: "]" },
11111373
type: "Property",
1374+
line: 2,
11121375
column: 18,
1113-
line: 2
1376+
endLine: 2,
1377+
endColumn: 19
11141378
}
11151379
]
11161380
},
@@ -1132,22 +1396,28 @@ ruleTester.run("computed-property-spacing", rule, {
11321396
messageId: "unexpectedSpaceAfter",
11331397
data: { tokenValue: "[" },
11341398
type: "Property",
1135-
column: 3,
1136-
line: 2
1399+
line: 2,
1400+
column: 4,
1401+
endLine: 2,
1402+
endColumn: 5
11371403
},
11381404
{
11391405
messageId: "unexpectedSpaceAfter",
11401406
data: { tokenValue: "[" },
11411407
type: "MemberExpression",
1142-
column: 10,
1143-
line: 2
1408+
line: 2,
1409+
column: 11,
1410+
endLine: 2,
1411+
endColumn: 12
11441412
},
11451413
{
11461414
messageId: "unexpectedSpaceBefore",
11471415
data: { tokenValue: "]" },
11481416
type: "MemberExpression",
1149-
column: 19,
1150-
line: 2
1417+
line: 2,
1418+
column: 18,
1419+
endLine: 2,
1420+
endColumn: 19
11511421
}
11521422
]
11531423
}

0 commit comments

Comments
 (0)
Please sign in to comment.