@@ -832,12 +832,16 @@ Generated by [AVA](https://avajs.dev).
832
832
| ^^^^^^ Prefer the spread operator over `Array#concat(…)`.␊
833
833
␊
834
834
--------------------------------------------------------------------------------␊
835
- Suggestion 1/2 : First argument is an `array`.␊
835
+ Suggestion 1/3 : First argument is an `array`.␊
836
836
1 | [...foo, ...bar]␊
837
837
␊
838
838
--------------------------------------------------------------------------------␊
839
- Suggestion 2/2 : First argument is not an `array`.␊
839
+ Suggestion 2/3 : First argument is not an `array`.␊
840
840
1 | [...foo, bar]␊
841
+ ␊
842
+ --------------------------------------------------------------------------------␊
843
+ Suggestion 3/3: Use `Array.isArray(…)` test first argument.␊
844
+ 1 | [...foo, ...(Array.isArray(bar) ? bar : [text])]␊
841
845
`
842
846
843
847
## Invalid #24
@@ -944,12 +948,16 @@ Generated by [AVA](https://avajs.dev).
944
948
| ^^^^^^ Prefer the spread operator over `Array#concat(…)`.␊
945
949
␊
946
950
--------------------------------------------------------------------------------␊
947
- Suggestion 1/2 : First argument is an `array`.␊
951
+ Suggestion 1/3 : First argument is an `array`.␊
948
952
1 | [...foo, 2, ...bar]␊
949
953
␊
950
954
--------------------------------------------------------------------------------␊
951
- Suggestion 2/2 : First argument is not an `array`.␊
955
+ Suggestion 2/3 : First argument is not an `array`.␊
952
956
1 | [...foo, 2, bar]␊
957
+ ␊
958
+ --------------------------------------------------------------------------------␊
959
+ Suggestion 3/3: Use `Array.isArray(…)` test first argument.␊
960
+ 1 | [...foo, 2, ...(Array.isArray(bar) ? bar : [text])]␊
953
961
`
954
962
955
963
## Invalid #30
@@ -978,12 +986,16 @@ Generated by [AVA](https://avajs.dev).
978
986
| ^^^^^^ Prefer the spread operator over `Array#concat(…)`.␊
979
987
␊
980
988
--------------------------------------------------------------------------------␊
981
- Suggestion 1/2 : First argument is an `array`.␊
989
+ Suggestion 1/3 : First argument is an `array`.␊
982
990
1 | [...foo, ...bar, 2, 3]␊
983
991
␊
984
992
--------------------------------------------------------------------------------␊
985
- Suggestion 2/2 : First argument is not an `array`.␊
993
+ Suggestion 2/3 : First argument is not an `array`.␊
986
994
1 | [...foo, bar, 2, 3]␊
995
+ ␊
996
+ --------------------------------------------------------------------------------␊
997
+ Suggestion 3/3: Use `Array.isArray(…)` test first argument.␊
998
+ 1 | [...foo, ...(Array.isArray(bar) ? bar : [text]), 2, 3]␊
987
999
`
988
1000
989
1001
## Invalid #32
@@ -996,12 +1008,16 @@ Generated by [AVA](https://avajs.dev).
996
1008
| ^^^^^^ Prefer the spread operator over `Array#concat(…)`.␊
997
1009
␊
998
1010
--------------------------------------------------------------------------------␊
999
- Suggestion 1/2 : First argument is an `array`.␊
1011
+ Suggestion 1/3 : First argument is an `array`.␊
1000
1012
1 | [...foo, ...bar, 2, 3].concat(baz)␊
1001
1013
␊
1002
1014
--------------------------------------------------------------------------------␊
1003
- Suggestion 2/2 : First argument is not an `array`.␊
1015
+ Suggestion 2/3 : First argument is not an `array`.␊
1004
1016
1 | [...foo, bar, 2, 3].concat(baz)␊
1017
+ ␊
1018
+ --------------------------------------------------------------------------------␊
1019
+ Suggestion 3/3: Use `Array.isArray(…)` test first argument.␊
1020
+ 1 | [...foo, ...(Array.isArray(bar) ? bar : [text]), 2, 3].concat(baz)␊
1005
1021
`
1006
1022
1007
1023
## Invalid #33
@@ -1266,3 +1282,43 @@ Generated by [AVA](https://avajs.dev).
1266
1282
11 | [[EMPTY_STRING_IN_ARRAY_OF_ARRAY]]␊
1267
1283
12 | )␊
1268
1284
`
1285
+
1286
+ ## Invalid #48
1287
+ 1 | [].concat((a.b.c), 2)
1288
+
1289
+ > Error 1/1
1290
+
1291
+ `␊
1292
+ > 1 | [].concat((a.b.c), 2)␊
1293
+ | ^^^^^^ Prefer the spread operator over `Array#concat(…)`.␊
1294
+ ␊
1295
+ --------------------------------------------------------------------------------␊
1296
+ Suggestion 1/3: First argument is an `array`.␊
1297
+ 1 | [...(a.b.c), 2]␊
1298
+ ␊
1299
+ --------------------------------------------------------------------------------␊
1300
+ Suggestion 2/3: First argument is not an `array`.␊
1301
+ 1 | [(a.b.c), 2]␊
1302
+ ␊
1303
+ --------------------------------------------------------------------------------␊
1304
+ Suggestion 3/3: Use `Array.isArray(…)` test first argument.␊
1305
+ 1 | [...(Array.isArray((a.b.c)) ? (a.b.c) : [text]), 2]␊
1306
+ `
1307
+
1308
+ ## Invalid #49
1309
+ 1 | [].concat(a.b(), 2)
1310
+
1311
+ > Error 1/1
1312
+
1313
+ `␊
1314
+ > 1 | [].concat(a.b(), 2)␊
1315
+ | ^^^^^^ Prefer the spread operator over `Array#concat(…)`.␊
1316
+ ␊
1317
+ --------------------------------------------------------------------------------␊
1318
+ Suggestion 1/2: First argument is an `array`.␊
1319
+ 1 | [...a.b(), 2]␊
1320
+ ␊
1321
+ --------------------------------------------------------------------------------␊
1322
+ Suggestion 2/2: First argument is not an `array`.␊
1323
+ 1 | [a.b(), 2]␊
1324
+ `
0 commit comments