github
1419 of 1928 branches covered (0.0%)
Branch coverage included in aggregate %.
7 of 7 new or added lines in 1 file covered. (100.0%)
23 existing lines in 1 file now uncovered.20977 of 29523 relevant lines covered (71.05%)
18.04 hits per line
UNCOV
1
|
const logFunctions = new Set([
|
|
UNCOV
2
|
'warn',
|
× |
UNCOV
3
|
'error',
|
× |
UNCOV
4
|
'deprecated',
|
× |
UNCOV
5
|
'removed',
|
× |
UNCOV
6
|
'probe',
|
× |
UNCOV
7
|
'log',
|
× |
UNCOV
8
|
'info',
|
× |
UNCOV
9
|
'once',
|
× |
UNCOV
10
|
'table',
|
× |
UNCOV
11
|
'image',
|
× |
UNCOV
12
|
'time',
|
× |
UNCOV
13
|
'timeEnd',
|
× |
UNCOV
14
|
'timeStamp',
|
× |
UNCOV
15
|
'group',
|
× |
UNCOV
16
|
'groupCollapsed',
|
× |
UNCOV
17
|
'groupEnd',
|
× |
UNCOV
18
|
'withGroup'
|
× |
UNCOV
19
|
]); |
× |
UNCOV
20
|
|
× |
UNCOV
21
|
module.exports = { |
× |
UNCOV
22
|
create: (context) => {
|
× |
23 |
return {
|
× |
24 |
CallExpression: (node) => {
|
× |
25 |
if (
|
× |
26 |
node.callee && |
× |
27 |
node.callee.object && |
× |
28 |
node.callee.object.name === 'log' &&
|
× |
29 |
logFunctions.has(node.callee.property.name) && |
× |
30 |
node.parent && |
× |
31 |
node.parent.type !== 'CallExpression'
|
× |
32 |
) { |
× |
33 |
context.report({ |
× |
34 |
node, |
× |
35 |
message: `Use log.${node.callee.property.name}(...)()`, |
× |
36 |
fix: (fixer) => {
|
× |
37 |
return fixer.insertTextAfter(node, '()'); |
× |
38 |
} |
× |
39 |
}); |
× |
40 |
} |
× |
41 |
} |
× |
42 |
}; |
× |
43 |
} |
× |
UNCOV
44
|
}; |
× |