Rule: one-line
Requires the specified tokens to be on the same line as the expression preceding them.
Notes:
Has Fixer
Config
Five arguments may be optionally provided:
"check-catch"checks thatcatchis on the same line as the closing brace fortry."check-finally"checks thatfinallyis on the same line as the closing brace forcatch."check-else"checks thatelseis on the same line as the closing brace forif."check-open-brace"checks that an open brace falls on the same line as its preceding expression."check-whitespace"checks preceding whitespace for the specified tokens.
Config examples
"one-line": [true, "check-catch", "check-finally", "check-else"]
Schema
{
"type": "array",
"items": {
"type": "string",
"enum": [
"check-catch",
"check-finally",
"check-else",
"check-open-brace",
"check-whitespace"
]
},
"minLength": 0,
"maxLength": 5
}