ter-arrow-parens (ESLint: arrow-parens)
require parens in arrow function arguments
Arrow functions can omit parentheses when they have exactly one parameter. In all other cases the parameter(s) must be wrapped in parentheses. This rule enforces the consistent use of parentheses in arrow functions.
This rule has a string option and an object one.
String options are:
"always"
(default) requires parentheses around arguments in all cases."as-needed"
allows omitting parentheses when there is only one argument.
Object properties for variants of the "as-needed"
option:
"requireForBlockBody": true
modifies the as-needed rule in order to require parentheses if the function body is in an instructions block (surrounded by braces).
"ter-arrow-parens": [true]
"ter-arrow-parens": [true, "always"]
"ter-arrow-parens": [true, "as-needed"]
"ter-arrow-parens": [true, "as-needed", { "requireForBlockBody": true }]
{
"type": "array",
"items": [
{
"enum": [
"always",
"as-needed"
]
},
{
"type": "object",
"properties": {
"requireForBlockBody": {
"type": "boolean"
}
},
"additionalProperties": false
}
],
"maxLength": 1
}