es-check 9.4.1 → 9.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.
- package/package.json +1 -1
- package/utils.js +0 -15
package/package.json
CHANGED
package/utils.js
CHANGED
|
@@ -517,21 +517,6 @@ function parseCode(code, acornOpts, acorn, file, needsFeatures = false) {
|
|
|
517
517
|
: code;
|
|
518
518
|
|
|
519
519
|
const options = { target: targetVersion, sourceType };
|
|
520
|
-
|
|
521
|
-
if (sourceType !== 'module') {
|
|
522
|
-
let moduleFeature = null;
|
|
523
|
-
if (codeToCheck.indexOf('import ') !== -1) {
|
|
524
|
-
moduleFeature = { name: 'import' };
|
|
525
|
-
} else if (codeToCheck.indexOf('export ') !== -1) {
|
|
526
|
-
moduleFeature = { name: 'export' };
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
if (moduleFeature) {
|
|
530
|
-
throw new Error(
|
|
531
|
-
`'${moduleFeature.name}' can only be used in ES modules. Use --module flag to enable module support`
|
|
532
|
-
);
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
520
|
|
|
536
521
|
const isCompatible = fastbrake.check(codeToCheck, options);
|
|
537
522
|
if (!isCompatible) {
|