@putout/plugin-esm 4.2.1 → 4.2.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.
|
@@ -5,6 +5,7 @@ import putout, {
|
|
|
5
5
|
transform,
|
|
6
6
|
operator,
|
|
7
7
|
} from 'putout';
|
|
8
|
+
|
|
8
9
|
import * as isESMPlugin from './is-esm/index.js';
|
|
9
10
|
import * as hasExportDefaultPlugin from './has-export-default/index.js';
|
|
10
11
|
import * as applyNamespaceImportPlugin from './apply-namespace-import/index.js';
|
|
@@ -21,7 +22,11 @@ const getMessage = (a) => a.message;
|
|
|
21
22
|
const isESM = (a) => a.rule === 'is-esm';
|
|
22
23
|
const hasExportDefault = (a) => a.rule === 'has-export-default';
|
|
23
24
|
|
|
24
|
-
export const report = (file, {name, source}) =>
|
|
25
|
+
export const report = (file, {name, source}) => {
|
|
26
|
+
const filename = getFilename(file);
|
|
27
|
+
return `Use 'import * as ${name} from '${source}' in '${filename}'`;
|
|
28
|
+
};
|
|
29
|
+
|
|
25
30
|
export const fix = (file, {name, source, content, ast}) => {
|
|
26
31
|
transform(ast, content, {
|
|
27
32
|
rules: {
|
package/package.json
CHANGED