escover 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ChangeLog +9 -0
- package/coverage.json +1 -2
- package/example/example.js +1 -1
- package/lib/instrument/index.js +3 -3
- package/lib/instrument/{plugin-mark-line → plugin-mark}/arrow.js +0 -0
- package/lib/instrument/{plugin-mark-line → plugin-mark}/fixture/arrow-fix.js +0 -0
- package/lib/instrument/{plugin-mark-line → plugin-mark}/fixture/arrow.js +0 -0
- package/lib/instrument/plugin-mark/fixture/assignment-fix.js +1 -0
- package/lib/instrument/plugin-mark/fixture/assignment.js +1 -0
- package/lib/instrument/{plugin-mark-line → plugin-mark}/fixture/logical-fix.js +0 -0
- package/lib/instrument/{plugin-mark-line → plugin-mark}/fixture/logical.js +0 -0
- package/lib/instrument/{plugin-mark-line → plugin-mark}/fixture/mark-line-fix.js +1 -1
- package/lib/instrument/{plugin-mark-line → plugin-mark}/fixture/mark-line.js +0 -0
- package/lib/instrument/{plugin-mark-line → plugin-mark}/fixture/new-fix.js +0 -0
- package/lib/instrument/{plugin-mark-line → plugin-mark}/fixture/new.js +0 -0
- package/lib/instrument/{plugin-mark-line → plugin-mark}/fixture/no-loc-fix.js +0 -0
- package/lib/instrument/{plugin-mark-line → plugin-mark}/fixture/no-loc.js +0 -0
- package/lib/instrument/{plugin-mark-line → plugin-mark}/index.js +8 -2
- package/lib/instrument/{plugin-mark-line → plugin-mark}/return.js +0 -0
- package/package.json +1 -1
package/ChangeLog
CHANGED
package/coverage.json
CHANGED
package/example/example.js
CHANGED
package/lib/instrument/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import putout, {} from 'putout';
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as mark from './plugin-mark/index.js';
|
|
4
4
|
|
|
5
5
|
export const instrument = (url, source) => {
|
|
6
6
|
const __c4 = global.__createC4(url);
|
|
7
7
|
const options = {
|
|
8
8
|
rules: {
|
|
9
|
-
|
|
9
|
+
mark: ['on', {
|
|
10
10
|
__c4,
|
|
11
11
|
}],
|
|
12
12
|
},
|
|
13
13
|
plugins: [
|
|
14
|
-
['mark
|
|
14
|
+
['mark', mark],
|
|
15
15
|
],
|
|
16
16
|
};
|
|
17
17
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const [error, {packageJson} = (__c4.mark(1, 14), {})] = (__c4.mark(1, 36), tryCatch(readPackageUpSync));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const [error, {packageJson} = {}] = tryCatch(readPackageUpSync);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -10,6 +10,7 @@ const {
|
|
|
10
10
|
NumericLiteral,
|
|
11
11
|
SequenceExpression,
|
|
12
12
|
BlockStatement,
|
|
13
|
+
ExpressionStatement,
|
|
13
14
|
} = types;
|
|
14
15
|
|
|
15
16
|
const {
|
|
@@ -83,7 +84,7 @@ export const fix = (path, {options}) => {
|
|
|
83
84
|
if (path.isAssignmentPattern()) {
|
|
84
85
|
replaceWithMultiple(path.get('right'), [
|
|
85
86
|
lineNode,
|
|
86
|
-
node.
|
|
87
|
+
node.right,
|
|
87
88
|
]);
|
|
88
89
|
return;
|
|
89
90
|
}
|
|
@@ -117,13 +118,18 @@ const EXCLUDE = [
|
|
|
117
118
|
export const exclude = () => EXCLUDE;
|
|
118
119
|
|
|
119
120
|
export const include = () => [
|
|
120
|
-
'AssignmentPattern',
|
|
121
121
|
'CallExpression',
|
|
122
122
|
'NewExpression',
|
|
123
123
|
'ReturnStatement',
|
|
124
124
|
];
|
|
125
125
|
|
|
126
126
|
export const traverse = ({push}) => ({
|
|
127
|
+
AssignmentPattern(path) {
|
|
128
|
+
if (compareAny(path.get('right'), EXCLUDE))
|
|
129
|
+
return;
|
|
130
|
+
|
|
131
|
+
push(path);
|
|
132
|
+
},
|
|
127
133
|
ArrowFunctionExpression(path) {
|
|
128
134
|
if (path.get('body').isBlockStatement())
|
|
129
135
|
return;
|
|
File without changes
|