@@ -428,8 +428,8 @@ const tests = {
428
428
}
429
429
` ,
430
430
errors : [
431
- ' React Hook useEffect has missing [ local] dependencies. ' +
432
- 'Either fix or remove the dependency array.' ,
431
+ " React Hook useEffect has a missing ' local' dependency. " +
432
+ 'Either include it or remove the dependency array.' ,
433
433
] ,
434
434
} ,
435
435
{
@@ -456,8 +456,8 @@ const tests = {
456
456
}
457
457
` ,
458
458
errors : [
459
- ' React Hook useEffect has missing [ local] dependencies. ' +
460
- 'Either fix or remove the dependency array.' ,
459
+ " React Hook useEffect has a missing ' local' dependency. " +
460
+ 'Either include it or remove the dependency array.' ,
461
461
] ,
462
462
} ,
463
463
{
@@ -484,8 +484,8 @@ const tests = {
484
484
}
485
485
` ,
486
486
errors : [
487
- ' React Hook useEffect has missing [ local] dependencies. ' +
488
- 'Either fix or remove the dependency array.' ,
487
+ " React Hook useEffect has a missing ' local' dependency. " +
488
+ 'Either include it or remove the dependency array.' ,
489
489
] ,
490
490
} ,
491
491
{
@@ -514,8 +514,8 @@ const tests = {
514
514
}
515
515
` ,
516
516
errors : [
517
- ' React Hook useEffect has missing [ local] dependencies. ' +
518
- 'Either fix or remove the dependency array.' ,
517
+ " React Hook useEffect has a missing ' local' dependency. " +
518
+ 'Either include it or remove the dependency array.' ,
519
519
] ,
520
520
} ,
521
521
{
@@ -544,8 +544,8 @@ const tests = {
544
544
}
545
545
` ,
546
546
errors : [
547
- ' React Hook useEffect has missing [ local1, local2] dependencies. ' +
548
- 'Either fix or remove the dependency array.' ,
547
+ " React Hook useEffect has missing ' local1' and ' local2' dependencies. " +
548
+ 'Either include them or remove the dependency array.' ,
549
549
] ,
550
550
} ,
551
551
{
@@ -570,8 +570,8 @@ const tests = {
570
570
}
571
571
` ,
572
572
errors : [
573
- ' React Hook useEffect has missing [ local2] dependencies. ' +
574
- 'Either fix or remove the dependency array.' ,
573
+ " React Hook useEffect has a missing ' local2' dependency. " +
574
+ 'Either include it or remove the dependency array.' ,
575
575
] ,
576
576
} ,
577
577
{
@@ -594,8 +594,8 @@ const tests = {
594
594
}
595
595
` ,
596
596
errors : [
597
- ' React Hook useEffect has unnecessary [ local2] dependencies. ' +
598
- 'Either fix or remove the dependency array.' ,
597
+ " React Hook useEffect has an unnecessary ' local2' dependency. " +
598
+ 'Either exclude it or remove the dependency array.' ,
599
599
] ,
600
600
} ,
601
601
{
@@ -626,8 +626,9 @@ const tests = {
626
626
}
627
627
` ,
628
628
errors : [
629
- 'React Hook useEffect has missing [local2], unnecessary [local1] dependencies. ' +
630
- 'Either fix or remove the dependency array.' ,
629
+ // Focus on the more important part first (missing dep)
630
+ "React Hook useEffect has a missing 'local2' dependency. " +
631
+ 'Either include it or remove the dependency array.' ,
631
632
] ,
632
633
} ,
633
634
{
@@ -650,8 +651,8 @@ const tests = {
650
651
}
651
652
` ,
652
653
errors : [
653
- ' React Hook useEffect has missing [ local] dependencies. ' +
654
- 'Either fix or remove the dependency array.' ,
654
+ " React Hook useEffect has a missing ' local' dependency. " +
655
+ 'Either include it or remove the dependency array.' ,
655
656
] ,
656
657
} ,
657
658
{
@@ -674,8 +675,8 @@ const tests = {
674
675
}
675
676
` ,
676
677
errors : [
677
- ' React Hook useEffect has duplicate [ local] dependencies. ' +
678
- 'Either fix or remove the dependency array.' ,
678
+ " React Hook useEffect has a duplicate ' local' dependency. " +
679
+ 'Either omit it or remove the dependency array.' ,
679
680
] ,
680
681
} ,
681
682
{
@@ -690,8 +691,8 @@ const tests = {
690
691
}
691
692
` ,
692
693
errors : [
693
- ' React Hook useEffect has unnecessary [ local] dependencies. ' +
694
- 'Either fix or remove the dependency array.' ,
694
+ " React Hook useEffect has an unnecessary ' local' dependency. " +
695
+ 'Either exclude it or remove the dependency array.' ,
695
696
] ,
696
697
} ,
697
698
{
@@ -710,8 +711,8 @@ const tests = {
710
711
}
711
712
` ,
712
713
errors : [
713
- ' React Hook useEffect has missing [ history] dependencies. ' +
714
- 'Either fix or remove the dependency array.' ,
714
+ " React Hook useEffect has a missing ' history' dependency. " +
715
+ 'Either include it or remove the dependency array.' ,
715
716
] ,
716
717
} ,
717
718
{
@@ -736,8 +737,8 @@ const tests = {
736
737
}
737
738
` ,
738
739
errors : [
739
- ' React Hook useEffect has missing [ history.foo] dependencies. ' +
740
- 'Either fix or remove the dependency array.' ,
740
+ " React Hook useEffect has a missing ' history.foo' dependency. " +
741
+ 'Either include it or remove the dependency array.' ,
741
742
] ,
742
743
} ,
743
744
{
@@ -783,8 +784,8 @@ const tests = {
783
784
'React Hook useEffect has a second argument which is not an array ' +
784
785
"literal. This means we can't statically verify whether you've " +
785
786
'passed the correct dependencies.' ,
786
- ' React Hook useEffect has missing [ local] dependencies. ' +
787
- 'Either fix or remove the dependency array.' ,
787
+ " React Hook useEffect has a missing ' local' dependency. " +
788
+ 'Either include it or remove the dependency array.' ,
788
789
] ,
789
790
} ,
790
791
{
@@ -808,8 +809,8 @@ const tests = {
808
809
}
809
810
` ,
810
811
errors : [
811
- ' React Hook useEffect has missing [ local] dependencies. ' +
812
- 'Either fix or remove the dependency array.' ,
812
+ " React Hook useEffect has a missing ' local' dependency. " +
813
+ 'Either include it or remove the dependency array.' ,
813
814
'React Hook useEffect has a spread element in its dependency list. ' +
814
815
"This means we can't statically verify whether you've passed the " +
815
816
'correct dependencies.' ,
@@ -858,8 +859,8 @@ const tests = {
858
859
}
859
860
` ,
860
861
errors : [
861
- ' React Hook useEffect has missing [ local] dependencies. ' +
862
- 'Either fix or remove the dependency array.' ,
862
+ " React Hook useEffect has a missing ' local' dependency. " +
863
+ 'Either include it or remove the dependency array.' ,
863
864
"Unsupported expression in React Hook useEffect's dependency list. " +
864
865
'Currently only simple variables are supported.' ,
865
866
] ,
@@ -884,8 +885,8 @@ const tests = {
884
885
}
885
886
` ,
886
887
errors : [
887
- ' React Hook useEffect has missing [ local], unnecessary [local.id] dependencies. ' +
888
- 'Either fix or remove the dependency array.' ,
888
+ " React Hook useEffect has a missing ' local' dependency. " +
889
+ 'Either include it or remove the dependency array.' ,
889
890
] ,
890
891
} ,
891
892
{
@@ -906,8 +907,8 @@ const tests = {
906
907
}
907
908
` ,
908
909
errors : [
909
- ' React Hook useEffect has duplicate [ local] dependencies. ' +
910
- 'Either fix or remove the dependency array.' ,
910
+ " React Hook useEffect has a duplicate ' local' dependency. " +
911
+ 'Either omit it or remove the dependency array.' ,
911
912
] ,
912
913
} ,
913
914
{
@@ -930,8 +931,8 @@ const tests = {
930
931
}
931
932
` ,
932
933
errors : [
933
- ' React Hook useEffect has unnecessary [ local1] dependencies. ' +
934
- 'Either fix or remove the dependency array.' ,
934
+ " React Hook useEffect has an unnecessary ' local1' dependency. " +
935
+ 'Either exclude it or remove the dependency array.' ,
935
936
] ,
936
937
} ,
937
938
{
@@ -948,8 +949,8 @@ const tests = {
948
949
}
949
950
` ,
950
951
errors : [
951
- ' React Hook useEffect has unnecessary [ local1] dependencies. ' +
952
- 'Either fix or remove the dependency array.' ,
952
+ " React Hook useEffect has an unnecessary ' local1' dependency. " +
953
+ 'Either exclude it or remove the dependency array.' ,
953
954
] ,
954
955
} ,
955
956
{
@@ -970,8 +971,8 @@ const tests = {
970
971
}
971
972
` ,
972
973
errors : [
973
- ' React Hook useEffect has missing [ props.foo] dependencies. ' +
974
- 'Either fix or remove the dependency array.' ,
974
+ " React Hook useEffect has a missing ' props.foo' dependency. " +
975
+ 'Either include it or remove the dependency array.' ,
975
976
] ,
976
977
} ,
977
978
{
@@ -994,8 +995,8 @@ const tests = {
994
995
}
995
996
` ,
996
997
errors : [
997
- ' React Hook useEffect has missing [ props.foo, props.bar] dependencies. ' +
998
- 'Either fix or remove the dependency array.' ,
998
+ " React Hook useEffect has missing ' props.foo' and ' props.bar' dependencies. " +
999
+ 'Either include them or remove the dependency array.' ,
999
1000
] ,
1000
1001
} ,
1001
1002
{
@@ -1022,8 +1023,8 @@ const tests = {
1022
1023
}
1023
1024
` ,
1024
1025
errors : [
1025
- ' React Hook useEffect has missing [ props.foo, props.bar, local] dependencies. ' +
1026
- 'Either fix or remove the dependency array.' ,
1026
+ " React Hook useEffect has missing ' props.foo', ' props.bar', and ' local' dependencies. " +
1027
+ 'Either include them or remove the dependency array.' ,
1027
1028
] ,
1028
1029
} ,
1029
1030
{
@@ -1048,8 +1049,8 @@ const tests = {
1048
1049
}
1049
1050
` ,
1050
1051
errors : [
1051
- ' React Hook useEffect has missing [ local] dependencies. ' +
1052
- 'Either fix or remove the dependency array.' ,
1052
+ " React Hook useEffect has a missing ' local' dependency. " +
1053
+ 'Either include it or remove the dependency array.' ,
1053
1054
] ,
1054
1055
} ,
1055
1056
{
@@ -1104,18 +1105,18 @@ const tests = {
1104
1105
}
1105
1106
` ,
1106
1107
errors : [
1107
- ' React Hook useEffect has missing [ props.foo] dependencies. ' +
1108
- 'Either fix or remove the dependency array.' ,
1109
- ' React Hook useCallback has missing [ props.foo] dependencies. ' +
1110
- 'Either fix or remove the dependency array.' ,
1111
- ' React Hook useMemo has missing [ props.foo] dependencies. ' +
1112
- 'Either fix or remove the dependency array.' ,
1113
- ' React Hook React.useEffect has missing [ props.foo] dependencies. ' +
1114
- 'Either fix or remove the dependency array.' ,
1115
- ' React Hook React.useCallback has missing [ props.foo] dependencies. ' +
1116
- 'Either fix or remove the dependency array.' ,
1117
- ' React Hook React.useMemo has missing [ props.foo] dependencies. ' +
1118
- 'Either fix or remove the dependency array.' ,
1108
+ " React Hook useEffect has a missing ' props.foo' dependency. " +
1109
+ 'Either include it or remove the dependency array.' ,
1110
+ " React Hook useCallback has a missing ' props.foo' dependency. " +
1111
+ 'Either include it or remove the dependency array.' ,
1112
+ " React Hook useMemo has a missing ' props.foo' dependency. " +
1113
+ 'Either include it or remove the dependency array.' ,
1114
+ " React Hook React.useEffect has a missing ' props.foo' dependency. " +
1115
+ 'Either include it or remove the dependency array.' ,
1116
+ " React Hook React.useCallback has a missing ' props.foo' dependency. " +
1117
+ 'Either include it or remove the dependency array.' ,
1118
+ " React Hook React.useMemo has a missing ' props.foo' dependency. " +
1119
+ 'Either include it or remove the dependency array.' ,
1119
1120
] ,
1120
1121
} ,
1121
1122
{
@@ -1153,12 +1154,12 @@ const tests = {
1153
1154
` ,
1154
1155
options : [ { additionalHooks : 'useCustomEffect' } ] ,
1155
1156
errors : [
1156
- ' React Hook useCustomEffect has missing [ props.foo] dependencies. ' +
1157
- 'Either fix or remove the dependency array.' ,
1158
- ' React Hook useEffect has missing [ props.foo] dependencies. ' +
1159
- 'Either fix or remove the dependency array.' ,
1160
- ' React Hook React.useEffect has missing [ props.foo] dependencies. ' +
1161
- 'Either fix or remove the dependency array.' ,
1157
+ " React Hook useCustomEffect has a missing ' props.foo' dependency. " +
1158
+ 'Either include it or remove the dependency array.' ,
1159
+ " React Hook useEffect has a missing ' props.foo' dependency. " +
1160
+ 'Either include it or remove the dependency array.' ,
1161
+ " React Hook React.useEffect has a missing ' props.foo' dependency. " +
1162
+ 'Either include it or remove the dependency array.' ,
1162
1163
] ,
1163
1164
} ,
1164
1165
{
@@ -1180,8 +1181,8 @@ const tests = {
1180
1181
}
1181
1182
` ,
1182
1183
errors : [
1183
- ' React Hook useEffect has missing [ local] dependencies. ' +
1184
- 'Either fix or remove the dependency array.' ,
1184
+ " React Hook useEffect has a missing ' local' dependency. " +
1185
+ 'Either include it or remove the dependency array.' ,
1185
1186
"Unsupported expression in React Hook useEffect's dependency list. " +
1186
1187
'Currently only simple variables are supported.' ,
1187
1188
] ,
@@ -1205,8 +1206,8 @@ const tests = {
1205
1206
}
1206
1207
` ,
1207
1208
errors : [
1208
- ' React Hook useEffect has missing [ local] dependencies. ' +
1209
- 'Either fix or remove the dependency array.' ,
1209
+ " React Hook useEffect has a missing ' local' dependency. " +
1210
+ 'Either include it or remove the dependency array.' ,
1210
1211
"Unsupported expression in React Hook useEffect's dependency list. " +
1211
1212
'Currently only simple variables are supported.' ,
1212
1213
] ,
@@ -1233,8 +1234,8 @@ const tests = {
1233
1234
}
1234
1235
` ,
1235
1236
errors : [
1236
- ' React Hook useEffect has missing [ state] dependencies. ' +
1237
- 'Either fix or remove the dependency array.' ,
1237
+ " React Hook useEffect has a missing ' state' dependency. " +
1238
+ 'Either include it or remove the dependency array.' ,
1238
1239
] ,
1239
1240
} ,
1240
1241
{
@@ -1262,10 +1263,10 @@ const tests = {
1262
1263
}, [ref1, ref2, props.someOtherRefs, props.color]);
1263
1264
}
1264
1265
` ,
1265
- // TODO: better message for the ref case.
1266
+ // TODO: special message for the ref case.
1266
1267
errors : [
1267
- ' React Hook useEffect has missing [ props.someOtherRefs, props.color] dependencies. ' +
1268
- 'Either fix or remove the dependency array.' ,
1268
+ " React Hook useEffect has missing ' props.someOtherRefs' and ' props.color' dependencies. " +
1269
+ 'Either include them or remove the dependency array.' ,
1269
1270
] ,
1270
1271
} ,
1271
1272
{
@@ -1285,10 +1286,10 @@ const tests = {
1285
1286
}, [ref]);
1286
1287
}
1287
1288
` ,
1288
- // TODO: better message for the ref case.
1289
+ // TODO: special message for the ref case.
1289
1290
errors : [
1290
- ' React Hook useEffect has unnecessary [ ref.current] dependencies. ' +
1291
- 'Either fix or remove the dependency array.' ,
1291
+ " React Hook useEffect has an unnecessary ' ref.current' dependency. " +
1292
+ 'Either exclude it or remove the dependency array.' ,
1292
1293
] ,
1293
1294
} ,
1294
1295
{
@@ -1311,8 +1312,8 @@ const tests = {
1311
1312
});
1312
1313
` ,
1313
1314
errors : [
1314
- ' React Hook useImperativeHandle has missing [ props.hello] dependencies. ' +
1315
- 'Either fix or remove the dependency array.' ,
1315
+ " React Hook useImperativeHandle has a missing ' props.hello' dependency. " +
1316
+ 'Either include it or remove the dependency array.' ,
1316
1317
] ,
1317
1318
} ,
1318
1319
] ,
0 commit comments