Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9613 from shaodahong/optimize-eslint
optimize eslint script
- Loading branch information
Showing
20 changed files
with
91 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Ignore node_modules | ||
node_modules | ||
|
||
# Ignore some folders | ||
benchmark | ||
coverage | ||
|
||
# Ignore not support files | ||
!.*.js | ||
.eslintrc.js | ||
*.d.ts | ||
|
||
# Ignore some test files | ||
test/* | ||
!test/*Cases | ||
!test/helpers | ||
!test/*.js | ||
test/*Cases/**/*.js | ||
!test/*Cases/**/webpack.config.js | ||
|
||
# Ignore some examples files | ||
examples/**/*.js | ||
!examples/*/webpack.config.js | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
module.exports = function supportDefaultAssignment() { | ||
try { | ||
var E = eval("class E { toString() { return 'default' } }") | ||
var f1 = eval("(function f1({a, b = E}) {return new b().toString();})") | ||
return f1({a: "test"}) === "default" ; | ||
} catch(e) { | ||
// eslint-disable-next-line no-unused-vars | ||
var E = eval("class E { toString() { return 'default' } }"); | ||
var f1 = eval("(function f1({a, b = E}) {return new b().toString();})"); | ||
return f1({ a: "test" }) === "default"; | ||
} catch (e) { | ||
return false; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
module.exports = function supportArrowFunctionExpression() { | ||
try { | ||
eval("var foo = function(fn) {return fn.toString()}; foo(() => {return 'a'})"); | ||
eval( | ||
"var foo = function(fn) {return fn.toString()}; foo(() => {return 'a'})" | ||
); | ||
return true; | ||
} catch(e) { | ||
} catch (e) { | ||
return false; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
module.exports = function supportsBlockScoping() { | ||
try { | ||
var f = eval("(function f() { const x = 1; if (true) { const x = 2; } return x; })"); | ||
var f = eval( | ||
"(function f() { const x = 1; if (true) { const x = 2; } return x; })" | ||
); | ||
return f() === 1; | ||
} catch(e) { | ||
} catch (e) { | ||
return false; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
module.exports = function supportDefaultAssignment() { | ||
try { | ||
var f = eval("(function f() { for(var x of ['ok', 'fail']) return x; })"); | ||
return f() === "ok" ; | ||
} catch(e) { | ||
return f() === "ok"; | ||
} catch (e) { | ||
return false; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
module.exports = function supportsSpread() { | ||
try { | ||
var x = { a: true }, y; // eslint-disable-line no-unused-vars | ||
var x = { a: true }, | ||
y; // eslint-disable-line no-unused-vars | ||
eval("y = { ...x }"); | ||
return y !== x && y.a; | ||
} catch(e) { | ||
} catch (e) { | ||
return false; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
module.exports = function supportsWebAssembly() { | ||
try { | ||
return typeof WebAssembly !== "undefined"; | ||
} catch(e) { | ||
} catch (e) { | ||
return false; | ||
} | ||
}; |