зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1358050: Add no-implied-eval rule to eslint config r=standard8
MozReview-Commit-ID: KdmpXq2rg1q --HG-- extra : rebase_source : fc89233a590604e1035be4aebfee9cda894ee07e
This commit is contained in:
Родитель
5f3be63ea2
Коммит
777b70a929
|
@ -18,6 +18,8 @@ module.exports = {
|
|||
|
||||
// No (!foo in bar) or (!object instanceof Class)
|
||||
"no-unsafe-negation": "error",
|
||||
// No eval() and no strings in the first param of setTimeout or setInterval
|
||||
"no-implied-eval": "error",
|
||||
},
|
||||
"env": {
|
||||
"es6": true
|
||||
|
|
|
@ -19,7 +19,9 @@ var gLanguagesDialog = {
|
|||
// see bug 1194346.
|
||||
forceReflow() {
|
||||
this._activeLanguages.style.fontKerning = "none";
|
||||
setTimeout("gLanguagesDialog._activeLanguages.style.removeProperty('font-kerning')", 0);
|
||||
setTimeout(() => {
|
||||
this._activeLanguages.style.removeProperty("font-kerning")
|
||||
}, 0);
|
||||
},
|
||||
|
||||
get _activeLanguages() {
|
||||
|
|
|
@ -233,6 +233,8 @@ module.exports = {
|
|||
"no-fallthrough": "error",
|
||||
// Allow the use of leading or trailing decimal points in numeric literals.
|
||||
"no-floating-decimal": "off",
|
||||
// disallow use of eval()-like methods
|
||||
"no-implied-eval": "error",
|
||||
// Allow comments inline after code.
|
||||
"no-inline-comments": "off",
|
||||
// Disallow if as the only statement in an else block.
|
||||
|
@ -427,8 +429,6 @@ module.exports = {
|
|||
"no-eq-null": "off",
|
||||
// disallow overwriting functions written as function declarations
|
||||
"no-func-assign": "off",
|
||||
// disallow use of eval()-like methods
|
||||
"no-implied-eval": "off",
|
||||
// disallow function or variable declarations in nested blocks
|
||||
"no-inner-declarations": "off",
|
||||
// disallow invalid regular expression strings in the RegExp constructor
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
<head>
|
||||
<title>history.go(0)</title>
|
||||
<script>
|
||||
setTimeout("history.go(0)", 1000);
|
||||
setTimeout(function() {
|
||||
history.go(0)
|
||||
}, 1000);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
<head>
|
||||
<title>location.reload()</title>
|
||||
<script>
|
||||
setTimeout("location.reload();", 100);
|
||||
setTimeout(function() {
|
||||
location.reload();
|
||||
}, 100);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
<head>
|
||||
<title>location.replace</title>
|
||||
<script>
|
||||
setTimeout("location.replace(window.location.href)", 1000);
|
||||
setTimeout(function() {
|
||||
location.replace(window.location.href)
|
||||
}, 1000);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
<head>
|
||||
<title>window.location.href</title>
|
||||
<script>
|
||||
setTimeout("window.location.href = window.location.href", 1000);
|
||||
setTimeout(function() {
|
||||
window.location.href = window.location.href
|
||||
}, 1000);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
<head>
|
||||
<title>window.location</title>
|
||||
<script>
|
||||
setTimeout("window.location = window.location", 1000);
|
||||
setTimeout(function() {
|
||||
window.location = window.location
|
||||
}, 1000);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -114,6 +114,9 @@ module.exports = {
|
|||
// Disallow unnecessary calls to .bind()
|
||||
"no-extra-bind": "error",
|
||||
|
||||
// Disallow eval and setInteral/setTimeout with strings
|
||||
"no-implied-eval": "error",
|
||||
|
||||
// No labels
|
||||
"no-labels": "error",
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "eslint-plugin-mozilla",
|
||||
"version": "0.2.41",
|
||||
"version": "0.2.42",
|
||||
"description": "A collection of rules that help enforce JavaScript coding standard in the Mozilla project.",
|
||||
"keywords": [
|
||||
"eslint",
|
||||
|
|
Загрузка…
Ссылка в новой задаче