Skip to content

Commit 6d79c90

Browse files
committed
refactor: make xo happy
1 parent c604850 commit 6d79c90

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

rules/no-inline-assertions.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ const {visitIf} = require('enhance-visitors');
33
const createAvaRule = require('../create-ava-rule');
44
const util = require('../util');
55

6-
function report({ node, context }) {
6+
function report({node, context}) {
77
context.report({
8-
node: node,
8+
node,
99
message: 'Assertions should not be called from an inline function'
10-
})
10+
});
1111
}
12+
1213
const create = context => {
1314
const ava = createAvaRule();
1415

@@ -28,24 +29,23 @@ const create = context => {
2829
return;
2930
}
3031

31-
const { body } = functionArg;
32-
if (body.type === "CallExpression") {
33-
report({ node, context });
32+
const {body} = functionArg;
33+
if (body.type === 'CallExpression') {
34+
report({node, context});
3435
return;
3536
}
3637

37-
if (body.type === "BlockStatement") {
38+
if (body.type === 'BlockStatement') {
3839
if (body.loc.start.line !== body.loc.end.line) {
3940
return;
4041
}
4142

42-
if (!body.body.length) {
43+
if (body.body.length === 0) {
4344
return;
4445
}
4546

46-
report({ node, context });
47+
report({node, context});
4748
}
48-
4949
})
5050
});
5151
};

0 commit comments

Comments
 (0)