Skip to content

Commit b664554

Browse files
authored
feat(eslint): Allow short circuit expressions (#4697)
This changes the default `eslint` config in order to allow expressions of the form `someBoolean && doStuff()` or `someBoolean && (someVariable = someValue)` (which are just alternate, slightly shorter forms of single-line `if` blocks), in order to be able to use them when checking whether or not to emit logs.
1 parent 21a623b commit b664554

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/eslint-config-sdk/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ module.exports = {
8484
// Make sure all expressions are used. Turned off in tests
8585
// Must disable base rule to prevent false positives
8686
'no-unused-expressions': 'off',
87-
'@typescript-eslint/no-unused-expressions': 'error',
87+
'@typescript-eslint/no-unused-expressions': ['error', { allowShortCircuit: true }],
8888

8989
// Make sure Promises are handled appropriately
9090
'@typescript-eslint/no-floating-promises': 'error',

0 commit comments

Comments
 (0)