@putout/printer 1.82.0 → 1.82.1
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 +5 -0
- package/lib/tokenize/statements/export-declaration/export-all-declaration.js +1 -0
- package/lib/tokenize/statements/export-declaration/export-declaration.js +1 -0
- package/lib/tokenize/statements/export-declaration/export-default-declaration.js +11 -1
- package/package.json +1 -1
package/ChangeLog
CHANGED
|
@@ -9,12 +9,22 @@ const notClass = (path) => {
|
|
|
9
9
|
return !path.get('declaration').isClass();
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
+
function shouldAddSemi(path) {
|
|
13
|
+
if (path.isClassDeclaration())
|
|
14
|
+
return false;
|
|
15
|
+
|
|
16
|
+
if (path.isFunctionDeclaration())
|
|
17
|
+
return false;
|
|
18
|
+
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
|
|
12
22
|
module.exports.ExportDefaultDeclaration = {
|
|
13
23
|
print(path, {print, traverse, maybe}) {
|
|
14
24
|
const declaration = path.get('declaration');
|
|
15
25
|
print('export default ');
|
|
16
26
|
traverse(declaration);
|
|
17
|
-
maybe.print(
|
|
27
|
+
maybe.print(shouldAddSemi(declaration), ';');
|
|
18
28
|
},
|
|
19
29
|
afterSatisfy: () => [
|
|
20
30
|
notClass,
|
package/package.json
CHANGED