@putout/plugin-esm 5.0.0 → 5.1.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/README.md CHANGED
@@ -20,6 +20,7 @@ npm i putout @putout/plugin-esm -D
20
20
 
21
21
  - ✅ [add-index-to-import](#add-index-to-import);
22
22
  - ✅ [apply-export-from](#apply-export-from);
23
+ - ✅ [convert-assert-to-with](#convert-assert-to-with);
23
24
  - ✅ [declare-imports-first](#declare-imports-first);
24
25
  - ✅ [group-imports-by-source](#group-imports-by-source);
25
26
  - ✅ [merge-duplicate-imports](#merge-duplicate-imports);
@@ -69,8 +70,8 @@ Checkout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/b7c4897107
69
70
  #### ❌ Example of incorrect code
70
71
 
71
72
  ```js
72
- import insertRust from './insert-rust.js';
73
- import addAction from './add-action.js';
73
+ import insertRust from './insert-rust';
74
+ import addAction from './add-action';
74
75
 
75
76
  export const rules = {};
76
77
  ```
@@ -1,6 +1,11 @@
1
1
  import {types, operator} from 'putout';
2
2
 
3
- const {remove, replaceWith} = operator;
3
+ const {
4
+ remove,
5
+ replaceWith,
6
+ compare,
7
+ } = operator;
8
+
4
9
  const {
5
10
  variableDeclaration,
6
11
  isVariableDeclarator,
@@ -42,6 +47,9 @@ export const filter = (path) => {
42
47
 
43
48
  if (isImportDefaultSpecifier(bindingPath))
44
49
  return false;
50
+
51
+ if (compare(bindingPath, 'const __a = require(__b)'))
52
+ return false;
45
53
  }
46
54
 
47
55
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-esm",
3
- "version": "5.0.0",
3
+ "version": "5.1.1",
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",
@@ -46,7 +46,7 @@
46
46
  "@putout/plugin-reuse-duplicate-init": "*",
47
47
  "@putout/plugin-tape": "*",
48
48
  "@putout/plugin-typescript": "*",
49
- "@putout/test": "^13.0.0",
49
+ "@putout/test": "^14.0.0",
50
50
  "c8": "^10.0.0",
51
51
  "eslint": "^9.0.0",
52
52
  "eslint-plugin-n": "^17.0.0",