@putout/plugin-esm 4.5.0 → 4.7.0

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/README.md CHANGED
@@ -139,7 +139,6 @@ export function sum(a, b) {
139
139
  }
140
140
  ```
141
141
 
142
-
143
142
  ### remove-useless-export-specifiers
144
143
 
145
144
  Check out in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/e5c3ea469437ade0f4467323dcec9a36/7c298c7078b004ae3aba2a29e38579bf8f48a098).
@@ -1,7 +1,10 @@
1
1
  import {types, operator} from 'putout';
2
2
 
3
3
  const {remove} = operator;
4
- const {isExportNamedDeclaration} = types;
4
+ const {
5
+ isExportNamedDeclaration,
6
+ isTSModuleBlock,
7
+ } = types;
5
8
 
6
9
  export const report = () => `Avoid useless export specifier`;
7
10
 
@@ -15,6 +18,12 @@ export const traverse = ({push}) => ({
15
18
  const {local} = node;
16
19
  const {name} = local;
17
20
 
21
+ if (isTSModuleBlock(path.parentPath.parentPath))
22
+ return;
23
+
24
+ if (path.parentPath.node.source)
25
+ return;
26
+
18
27
  const binding = scope.bindings[name];
19
28
 
20
29
  if (binding) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-esm",
3
- "version": "4.5.0",
3
+ "version": "4.7.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin improves ability to transform ESM code",
@@ -49,7 +49,7 @@
49
49
  "c8": "^10.0.0",
50
50
  "eslint": "^9.0.0",
51
51
  "eslint-plugin-n": "^17.0.0",
52
- "eslint-plugin-putout": "^26.0.0",
52
+ "eslint-plugin-putout": "^27.0.0",
53
53
  "madrun": "^11.0.0",
54
54
  "montag": "^1.2.1",
55
55
  "nodemon": "^3.0.1",