mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
* feat: support sourceType: commonjs * fix: improve eslint-parser souceType: commonjs handling * allow sourceType: commonjs in babel/core * set program.sourceType to script for commonjs * feat: disallow some allow* parser flags in commonjs mode * do not set allowReturnOutsideFunction for commonjs source type * update error messages * normalize Windows path * fix option typo * add souceType: "commonjs" compatibility layer * update default ecmaVersion to latest * update eslint-parser docs --------- Co-authored-by: Nicolò Ribaudo <[email protected]>
15 lines
427 B
JavaScript
15 lines
427 B
JavaScript
import path from "node:path";
|
|
import runFixtureTests from "./helpers/run-fixture-tests.js";
|
|
import { parseExpression } from "../lib/index.js";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
runFixtureTests(
|
|
path.join(path.dirname(fileURLToPath(import.meta.url)), "expressions"),
|
|
(input, options = {}) => {
|
|
options.attachComment = false;
|
|
return parseExpression(input, options);
|
|
},
|
|
/* filter */ undefined,
|
|
true,
|
|
);
|