Skip to content

Commit

Permalink
enable no-lonely-if eslint rule
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Jun 5, 2021
1 parent f23cec3 commit 8cf605d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .eslintrc.js
Expand Up @@ -240,6 +240,8 @@ const base = {
'new-cap': ['error', { newIsCap: true, capIsNew: false }],
// require parentheses when invoking a constructor with no arguments
'new-parens': 'error',
// disallow `if` as the only statement in an `else` block
'no-lonely-if': 'error',
// disallow mixed spaces and tabs for indentation
'no-mixed-spaces-and-tabs': 'error',
// disallow multiple empty lines and only one newline at the end
Expand Down Expand Up @@ -383,7 +385,7 @@ const base = {
'unicorn/no-console-spaces': 'error',
// enforce the use of unicode escapes instead of hexadecimal escapes
'unicorn/no-hex-escape': 'error',
// disallow if as the only statement in an else block
// disallow `if` statements as the only statement in `if` blocks without `else`
'unicorn/no-lonely-if': 'error',
// forbid classes that only have static members
'unicorn/no-static-only-class': 'error',
Expand Down

0 comments on commit 8cf605d

Please sign in to comment.