зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1826514: Add eslint rule to disallow 'arguments' in self-hosted code. r=jandem
Use a custom rule instead of the built-in "prefer-rest-params" [1] rule, so we can adjust the error message to mention `ArgumentsLength()` and `GetArgument()`. [1] https://eslint.org/docs/latest/rules/prefer-rest-params Differential Revision: https://phabricator.services.mozilla.com/D174727
This commit is contained in:
Родитель
3c87541fa8
Коммит
1af28ee6dc
|
@ -107,6 +107,11 @@ module.exports = {
|
|||
message:
|
||||
"TO_PROPERTY_KEY macro must be called with a simple identifier",
|
||||
},
|
||||
{
|
||||
selector: "Identifier[name='arguments']",
|
||||
message:
|
||||
"'arguments' is disallowed, use ArgumentsLength(), GetArgument(n), or rest-parameters",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче