Skip to content

Commit c8f3d14

Browse files
committed
fix: @putout/plugin-putout: apply-report: no-report-three: TemplateLiteral
1 parent 428ac5f commit c8f3d14

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

packages/plugin-putout/lib/apply-report/fixture/no-report-three-fix.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,8 @@ t.noReportWithOptions('a', {
22
from: [],
33
to: [],
44
});
5+
6+
t.noReportWithOptions('rename-files-full', {
7+
from: ['/'],
8+
to: [],
9+
});

packages/plugin-putout/lib/apply-report/fixture/no-report-three.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,8 @@ t.noReportWithOptions('a', 'Use b', {
22
from: [],
33
to: [],
44
});
5+
6+
t.noReportWithOptions('rename-files-full', `Rename '/hello/README.md' to '/hello/abc/_README.md'`, {
7+
from: ['/'],
8+
to: [],
9+
});

packages/plugin-putout/lib/apply-report/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ module.exports.report = (path) => {
1414
if (compare(path, 't.noReport(__a, "__b")'))
1515
return `Use 't.noReport(__a)' instead of 't.noReport(__a, "__b")'`;
1616

17-
if (compare(path, 't.noReportWithOptions(__a, "__b", __c)'))
18-
return `Use 't.noReportWithOptions(__a, __c)' instead of 't.noReportWithOptions(__a, "__b", __c)'`;
17+
if (compare(path, 't.noReportWithOptions(__a, __b, __c)'))
18+
return `Use 't.noReportWithOptions(__a, __c)' instead of 't.noReportWithOptions(__a, __b, __c)'`;
1919

20-
return `Use '${TYPES[name]}()' instead of '${name}()'`;
20+
return `Use 't.${TYPES[name]}()' instead of 't.${name}()'`;
2121
};
2222

2323
module.exports.replace = () => ({
2424
't.noReport(__a, __object)': 't.noReportWithOptions(__a, __object)',
2525
't.noReport(__a, "__b")': 't.noReport(__a)',
2626
't.report(__a)': 't.noReport(__a)',
2727
't.noReportWithOptions(__a)': 't.noReport(__a)',
28-
't.noReportWithOptions(__a, "__b", __c)': 't.noReportWithOptions(__a, __c)',
28+
't.noReportWithOptions(__a, __b, __c)': 't.noReportWithOptions(__a, __c)',
2929
});

packages/plugin-putout/lib/apply-report/index.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const test = createTest(__dirname, {
1010
});
1111

1212
test('putout: apply-report: report', (t) => {
13-
t.report('apply-report', `Use 'noReportWithOptions()' instead of 'noReport()'`);
13+
t.report('apply-report', `Use 't.noReportWithOptions()' instead of 't.noReport()'`);
1414
t.end();
1515
});
1616

@@ -25,7 +25,7 @@ test('putout: apply-report: transform: no-report-three', (t) => {
2525
});
2626

2727
test('putout: apply-report: report: no-report-three', (t) => {
28-
t.report('no-report-three', `Use 't.noReportWithOptions(__a, __c)' instead of 't.noReportWithOptions(__a, "__b", __c)'`);
28+
t.report('no-report-three', `Use 't.noReportWithOptions(__a, __c)' instead of 't.noReportWithOptions(__a, __b, __c)'`);
2929
t.end();
3030
});
3131

0 commit comments

Comments
 (0)