Skip to content

Commit 1be11d7

Browse files
Loosened no-unused-expresssions rule for tests
1 parent 8a2a80d commit 1be11d7

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/javascript-test-rules.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,19 @@ module.exports = {
1818
*/
1919
"no-return-await": "off",
2020

21+
/**
22+
* Warn about usage of expressions in statement position
23+
*
24+
* @see https://eslint.org/docs/rules/no-unused-expressions
25+
*/
26+
"no-unused-expressions": [
27+
"warn",
28+
{
29+
allowShortCircuit: true, // allow short-circuited expressions (e.g. foo && bar())
30+
allowTernary: true, // allow ternary expressions (e.g. foo ? bar() : baz())
31+
},
32+
],
33+
2134
/**
2235
* allow async functions without an `await` keyword
2336
*

0 commit comments

Comments
 (0)