Skip to content

Commit c3dcb37

Browse files
committed
feature: @putout/plugin-esm: apply-privately-imported-file: report: filename
1 parent 9084a5b commit c3dcb37

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/plugin-esm/lib/apply-privately-imported-file/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ const {
1717

1818
const getMessage = (a) => a.message;
1919

20-
export const report = (file, {from, to}) => `Apply privately imported source: '${from}' -> '${to}'`;
20+
export const report = (file, {from, to, filename}) => {
21+
return `Apply private import: '${from}' -> '${to}' in '${filename}'`;
22+
};
2123
export const fix = (file, {content, ast, from, to}) => {
2224
transform(ast, content, {
2325
rules: {
@@ -75,6 +77,7 @@ export const scan = (rootPath, {push, trackFile}) => {
7577
push(file, {
7678
from,
7779
to: privateImports.get(to),
80+
filename,
7881
content,
7982
ast,
8083
});

packages/plugin-esm/lib/apply-privately-imported-file/index.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const test = createTest(import.meta.url, {
88
});
99

1010
test('esm: apply-privately-imported-file: report', (t) => {
11-
t.report('apply-privately-imported-file', `Apply privately imported source: '../is.js' -> '#is'`);
11+
t.report('apply-privately-imported-file', `Apply private import: '../is.js' -> '#is' in '/lib/tokenize/expressions/spread-element.js'`);
1212
t.end();
1313
});
1414

0 commit comments

Comments
 (0)