@putout/plugin-esm 7.4.0 → 7.4.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.
|
@@ -55,10 +55,8 @@ export const scan = (rootPath, {push, trackFile}) => {
|
|
|
55
55
|
const content = readFileContent(file);
|
|
56
56
|
const [error, ast] = tryCatch(parse, content);
|
|
57
57
|
|
|
58
|
-
if (error)
|
|
59
|
-
|
|
60
|
-
throw error;
|
|
61
|
-
}
|
|
58
|
+
if (error)
|
|
59
|
+
continue;
|
|
62
60
|
|
|
63
61
|
const importsTuples = getImports(file, content, ast);
|
|
64
62
|
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
dirname,
|
|
4
4
|
basename,
|
|
5
5
|
} from 'node:path';
|
|
6
|
+
import {tryCatch} from 'try-catch';
|
|
6
7
|
import {
|
|
7
8
|
parse,
|
|
8
9
|
print,
|
|
@@ -51,7 +52,10 @@ export const scan = (rootPath, {push, trackFile}) => {
|
|
|
51
52
|
if (!content.includes('import'))
|
|
52
53
|
continue;
|
|
53
54
|
|
|
54
|
-
const ast = parse
|
|
55
|
+
const [error, ast] = tryCatch(parse, content);
|
|
56
|
+
|
|
57
|
+
if (error)
|
|
58
|
+
continue;
|
|
55
59
|
|
|
56
60
|
const places = transform(ast, content, {
|
|
57
61
|
plugins: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/plugin-esm",
|
|
3
|
-
"version": "7.4.
|
|
3
|
+
"version": "7.4.2",
|
|
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",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"esm"
|
|
43
43
|
],
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@putout/eslint-flat": "^
|
|
45
|
+
"@putout/eslint-flat": "^4.0.0",
|
|
46
46
|
"@putout/plugin-declare": "*",
|
|
47
47
|
"@putout/plugin-declare-before-reference": "*",
|
|
48
48
|
"@putout/plugin-destructuring": "*",
|