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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/utils.js +0 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "es-check",
3
- "version": "9.4.1",
3
+ "version": "9.4.2",
4
4
  "description": "Checks the ECMAScript version of .js glob against a specified version of ECMAScript with a shell command",
5
5
  "main": "index.js",
6
6
  "license": "MIT",
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) {