File tree 3 files changed +47
-0
lines changed
docs/rules/no-unsupported-features
lib/rules/no-unsupported-features
tests/lib/rules/no-unsupported-features
3 files changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ The `"ignores"` option accepts an array of the following strings.
67
67
- ` "BigInt64Array" `
68
68
- ` "BigUint64Array" `
69
69
- ` "Promise.allSettled" `
70
+ - ` "globalThis" `
70
71
71
72
** ES2019:**
72
73
Original file line number Diff line number Diff line change @@ -128,6 +128,9 @@ const trackMap = {
128
128
SharedArrayBuffer : {
129
129
[ READ ] : { supported : "8.10.0" } ,
130
130
} ,
131
+ globalThis : {
132
+ [ READ ] : { supported : "12.0.0" } ,
133
+ } ,
131
134
} ,
132
135
}
133
136
Original file line number Diff line number Diff line change @@ -2228,5 +2228,48 @@ ruleTester.run(
2228
2228
} ,
2229
2229
] ,
2230
2230
} ,
2231
+ {
2232
+ keyword : "globalThis" ,
2233
+ valid : [
2234
+ {
2235
+ code : "(function(globalThis) { globalThis }(a))" ,
2236
+ options : [ { version : "12.0.0" } ] ,
2237
+ } ,
2238
+ {
2239
+ code : "globalThis" ,
2240
+ options : [ { version : "12.0.0" } ] ,
2241
+ } ,
2242
+ ] ,
2243
+ invalid : [
2244
+ {
2245
+ code : "globalThis" ,
2246
+ options : [ { version : "11.9.9" } ] ,
2247
+ errors : [
2248
+ {
2249
+ messageId : "unsupported" ,
2250
+ data : {
2251
+ name : "globalThis" ,
2252
+ supported : "12.0.0" ,
2253
+ version : "11.9.9" ,
2254
+ } ,
2255
+ } ,
2256
+ ] ,
2257
+ } ,
2258
+ {
2259
+ code : "function wrap() { globalThis }" ,
2260
+ options : [ { version : "11.9.9" } ] ,
2261
+ errors : [
2262
+ {
2263
+ messageId : "unsupported" ,
2264
+ data : {
2265
+ name : "globalThis" ,
2266
+ supported : "12.0.0" ,
2267
+ version : "11.9.9" ,
2268
+ } ,
2269
+ } ,
2270
+ ] ,
2271
+ } ,
2272
+ ] ,
2273
+ } ,
2231
2274
] )
2232
2275
)
You can’t perform that action at this time.
0 commit comments