This is a plugin for eslint that checks the grammar of es6, which does not work with Internet explorer.
package.json
{
...
"devDependencies": {
"eslint": "^8.1.0",
"eslint-plugin-native-ie": "^0.1.0"
},
...
}
.eslitrc.json
(for ie11)
{
"extends": ["plugin:native-ie/ie11"]
}
.eslitrc.json
(for ie10)
{
"extends": ["plugin:native-ie/ie10"]
}
Rule | IE11 | IE10 | Disallowed grammer example |
---|---|---|---|
no-default-function-parameters | ✅ | ✅ | function fn(param="default") {} |
no-rest-parameters | ✅ | ✅ | function fn(...rest) {} |
no-spread-syntax-for-iterable-objects | ✅ | ✅ | var a = [...[]]; |
no-object-literal-extensions | ✅ | ✅ | var o = { [foo]: false, bar, hoge() {}, } |
no-for-of-loops | ✅ | ✅ | for (var _ of {}) {} |
no-octal-and-binary-literals | ✅ | ✅ | var o = 0o0755; var b = 0b0010; |
no-template-literals | ✅ | ✅ | var s = `hello ${name}`: |
no-regexp-y-and-u-flags | ✅ | ✅ | var y = /test/y; var u = /test/u; |
no-destructing | ✅ | ✅ | var [a, b, c] = [1, 2, 3]; |
no-unicode-code-point-escapes | ✅ | ✅ | var u = "\u{1f4a9}"; |
no-new-target | ✅ | ✅ | function() { new.target === C } |
no-const | - | ✅ | const c = null; |
no-let | - | ✅ | let l = null; |
no-const-in-for-in-loop | ✅ | - | for (const _ in {}) {} |
no-let-in-for-in-loop | ✅ | - | for (let _ in {}) {} |
no-arrow-functions | ✅ | ✅ | var fn = () => {}; |
no-class | ✅ | ✅ | class C {} |
no-super | ✅ | ✅ | class C { constructor() {super.foo()} } |
no-generators | ✅ | ✅ | function *g() {} |