set allowSingleLine to true for `one-line`->`brace-style` conversion
benjaminpjones opened this issue · comments
Benjamin Jones commented
Overview
TSLint's one-line
is more narrow in scope than ESLint's brace-style
in the sense that ESLint will error on single line blocks by default.
Example code that errors under brace-style
but not one-line
del(this.del_url, obj.id)
.then(this.refresh)
.catch((e) => { this.refresh(); errorAlerter(e); });
Actual Behavior
A one-line
TSLint rule generates the following eslint rule:
"brace-style": [
"error",
"1tbs"
],
Expected Behavior
Given that one-line
does not care about single line blocks, I'd expect it to output this ESLint rule:
"brace-style": [
"error",
"1tbs",
{ "allowSingleLine" : true }
],
Reproduce
Here is the TSLint rule I was working with:
"one-line": [
true,
"check-catch",
"check-finally",
"check-open-brace",
"check-whitespace"
],