Skip to content

Commit

Permalink
Add process.env.IS_PUBLISH check in eslint parser
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Sep 19, 2023
1 parent 71818a8 commit 20e04e2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions eslint/babel-eslint-parser/src/parse.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ let isRunningMinSupportedCoreVersion = null;

module.exports = function parse(code, options, client) {
// Ensure we're using a version of `@babel/core` that includes `parse()` and `tokTypes`.
const minSupportedCoreVersion = process.env.BABEL_8_BREAKING
? PACKAGE_JSON.version
: ">=7.2.0";
const minSupportedCoreVersion =
process.env.BABEL_8_BREAKING && process.env.IS_PUBLISH
? PACKAGE_JSON.version
: ">=7.2.0";

if (typeof isRunningMinSupportedCoreVersion !== "boolean") {
isRunningMinSupportedCoreVersion = semver.satisfies(
Expand Down

0 comments on commit 20e04e2

Please sign in to comment.