amilajack / amilajack/eslint-plugin-compat

Map with constructor

Đang mở
#248 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
3.2k
Fork
115
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I'm using `Map` in my client code. I passed an array to the constructor as it is supported in several runtimes, but not in IE.

This does not work, the map will be empty:
```const map = new Map([["fuu", "bar"]]);```

There is no linting error of this plugin. This is my configuration:
```
{
"extends": [
"plugin:compat/recommended",
"../../../.eslintrc.json"
],
"plugins": [
"es"
],
"env": {
"browser": true
},
"overrides": [
{
"files": [
"**/clientFunctions/**/*.js"
],
"rules": {
"es/no-arrow-functions": ["error"],
"es/no-for-of-loops": ["error"],
"es/no-rest-spread-properties": ["error"],
"es/no-spread-elements": ["error"]
}
}
]
}
```

And the .browserlistrc
```json
ie 11
```

Expected to get a linting error as Map with constructor parameter is not supported in IE11 (see [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Browser_compatibility))

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.