We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
no-sequences
1 parent 8e96064 commit 388d6f8Copy full SHA for 388d6f8
lib/rules/no-sequences.js
@@ -31,7 +31,8 @@ module.exports = {
31
IfStatement: "test",
32
SwitchStatement: "discriminant",
33
WhileStatement: "test",
34
- WithStatement: "object"
+ WithStatement: "object",
35
+ ArrowFunctionExpression: "body"
36
37
// Omitting CallExpression - commas are parsed as argument separators
38
// Omitting NewExpression - commas are parsed as argument separators
tests/lib/rules/no-sequences.js
@@ -48,7 +48,8 @@ ruleTester.run("no-sequences", rule, {
48
"if ((doSomething(), !!test));",
49
"switch ((doSomething(), !!test)) {}",
50
"while ((doSomething(), !!test));",
51
- "with ((doSomething(), val)) {}"
+ "with ((doSomething(), val)) {}",
52
+ { code: "a => ((doSomething(), a))", env: {es6: true} }
53
],
54
55
// Examples of code that should trigger the rule
@@ -59,6 +60,7 @@ ruleTester.run("no-sequences", rule, {
59
60
{ code: "if (doSomething(), !!test);", errors: errors(18) },
61
{ code: "switch (doSomething(), val) {}", errors: errors(22) },
62
{ code: "while (doSomething(), !!test);", errors: errors(21) },
- { code: "with (doSomething(), val) {}", errors: errors(20) }
63
+ { code: "with (doSomething(), val) {}", errors: errors(20) },
64
+ { code: "a => (doSomething(), a)", env: {es6: true}, errors: errors(20)}
65
]
66
});
0 commit comments