Skip to content

Commit

Permalink
style: add ts-eslint brace-style rule
Browse files Browse the repository at this point in the history
Ensures 1tbs (one true brace style), where braces must be on the same line as the keywords they're associated with.
[Documentation](https://typescript-eslint.io/rules/brace-style/)

This rule ensures:
```js
if (foo) {
  //
} else {
  //
}

try {
  //
} catch(error) {
  //
}
```

Instead of allowing:
```js
if (foo)
{
  //
}
else {
  //
}

try
{
  //
}
catch(error)
{
  //
}
```
  • Loading branch information
devonzara committed Apr 2, 2023
1 parent 6e7ad52 commit 4b009df
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ module.exports = {
'array-bracket-spacing': ['error', 'never'],
'arrow-parens': ['error', 'as-needed'],
'arrow-spacing': 'error',
'brace-style': 'off',
'@typescript-eslint/brace-style': 'error',
'key-spacing': 'off',
'@typescript-eslint/key-spacing': 'error',
'object-curly-spacing': ['error', 'always', { objectsInObjects: false }],
Expand Down

0 comments on commit 4b009df

Please sign in to comment.