amilajack / amilajack/eslint-plugin-compat

Some js methods not supported on IE 11

Open
#445 4 comments 16 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3.2k
Forks
115
PR merge metrics
No merged PRs in 30d

Description

### Problem
- It seems like support for IE 11 does not work on some function such as
`[].includes()` , `"strsd".includes()`
- only fetch works in this case

> How to solve this problem and are their workarounds ?
Thanks 👍

![image](https://user-images.githubusercontent.com/38217535/103606553-47c17600-4f49-11eb-9fa0-5022e491cf72.png)

![image](https://user-images.githubusercontent.com/38217535/103606462-0e890600-4f49-11eb-999c-08290f933d8f.png)

![image](https://user-images.githubusercontent.com/38217535/103606440-003aea00-4f49-11eb-8300-7611a0915e26.png)

### Code

`packge.json`
```json
{
"name": "testproject",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"eslint": "^7.17.0",
"eslint-plugin-compat": "^3.9.0"
}
}

```

`test.js`
```
// IE 11 No Support

Array.includes();

Array.from(Set(1,2,3));

[3,2,1].includes(1);

"asdasd".includes("a");

fetch('asdasd');

```

`.eslintrc.js`
```js
module.exports = {
"env": {
"browser": true,
"es2020": true
},
"settings": {
targets: [
"ie >= 11"
],
polyfills: [],
},
"extends": [ ],
"plugins": [ "compat" ],
"rules": {
"compat/compat": "error"
}
};

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.