Repository: babel/babel
File: packages/babel-preset-env/src/normalize-options.ts (TypeScript)

Code before:
          "  yarn add core-js@2              yarn add core-js@3\n\n" +
          "More info about useBuiltIns: https://babeljs.io/docs/en/babel-preset-env#usebuiltins\n" +
          "More info about core-js: https://babeljs.io/docs/en/babel-preset-env#corejs",
      );
    }
  } else if (typeof corejs === "object" && corejs !== null) {
    rawVersion = corejs.version;
    proposals = Boolean(corejs.proposals);
  } else {
    rawVersion = corejs as false | string | number | undefined | null;
  }

  const version = rawVersion ? semver.coerce(String(rawVersion)) : false;

  if (version) {
    if (useBuiltIns) {
      if (process.env.BABEL_8_BREAKING) {
        if (version.major !== 3) {
          throw new RangeError(
            "Invalid Option: The version passed to `corejs` is invalid. Currently, " +
              "only core-js@3 is supported.",
          );
        }

        if (
          typeof rawVersion === "number" ||
          !String(rawVersion).includes(".")
        ) {
          throw new Error(
            "Invalid Option: The version passed to `corejs` is invalid. It must be a string with minor version, like `3.10` or `3.10.1`.",
          );
        }
      } else {
        if (version.major < 2 || version.major > 3) {
          throw new RangeError(
            "Invalid Option: The version passed to `corejs` is invalid. Currently, " +
              "only core-js@2 and core-js@3 are supported.",
          );
        }
      }
    } else {
      console.warn(
        "\nWARNING (@babel/preset-env): The `corejs` option only has an effect when the `useBuiltIns` option is not `false`\n",
      );
    }
  }

  return { version, proposals };
}

export default function normalizeOptions(opts: Options) {

Review comment (suggestion):
```suggestion
          typeof rawVersion !== "string" ||
```

bigints :)

Code after:
          "  yarn add core-js@2              yarn add core-js@3\n\n" +
          "More info about useBuiltIns: https://babeljs.io/docs/en/babel-preset-env#usebuiltins\n" +
          "More info about core-js: https://babeljs.io/docs/en/babel-preset-env#corejs",
      );
    }
  } else if (typeof corejs === "object" && corejs !== null) {
    rawVersion = corejs.version;
    proposals = Boolean(corejs.proposals);
  } else {
    rawVersion = corejs as false | string | number | undefined | null;
  }

  const version = rawVersion ? semver.coerce(String(rawVersion)) : false;

  if (version) {
    if (useBuiltIns) {
      if (process.env.BABEL_8_BREAKING) {
        if (version.major !== 3) {
          throw new RangeError(
            "Invalid Option: The version passed to `corejs` is invalid. Currently, " +
              "only core-js@3 is supported.",
          );
        }

        if (
          typeof rawVersion !== "string" ||
          !String(rawVersion).includes(".")
        ) {
          throw new Error(
            'Invalid Option: The version passed to `corejs` is invalid. Please use string and specify the minor version, such as `"3.33"`.',
          );
        }
      } else {
        if (version.major < 2 || version.major > 3) {
          throw new RangeError(
            "Invalid Option: The version passed to `corejs` is invalid. Currently, " +
              "only core-js@2 and core-js@3 are supported.",
          );
        }
      }
    } else {
      console.warn(
        "\nWARNING (@babel/preset-env): The `corejs` option only has an effect when the `useBuiltIns` option is not `false`\n",
      );
    }
  }

  return { version, proposals };
}

export default function normalizeOptions(opts: Options) {