Issue 1:
Bug Report

I would like to work on a fix!

Current Behavior

My config is set to >=0.5% in GB, but now adding this parameter brings the target version for Chrome down to v4. I've tried adding >=0.5% in GB and not chrome but no combination seems to shift the Chrome version. When it gets to >=40% in GB it will correctly use the last 2 versions flag for chrome.

I'm not sure if this is a browserlist or caniuse issue, I tried the GB.js caniuselite file from a year ago to see if it was corrupted data but it made no change.

Output

@babel/preset-env: `DEBUG` option

Using targets:
{
"android": "79",
"chrome": "4",
"edge": "79",
"firefox": "72",
"ie": "11",
"ios": "10.3",
"node": "12.16",
"opera": "65",
"safari": "12.1",
"samsung": "9.2"
}

Using modules transform: false

Using plugins:
proposal-nullish-coalescing-operator { "android":"79", "chrome":"4", "edge":"79", "ie":"11", "ios":"10.3", "node":"12.16", "opera":"65", "safari":"12.1", "samsung":"9.2" }
proposal-optional-chaining { "android":"79", "chrome":"4", "edge":"79", "firefox":"72", "ie":"11", "ios":"10.3", "node":"12.16", "opera":"65", "safari":"12.1", "samsung":"9.2" }
proposal-json-strings { "chrome":"4", "ie":"11", "ios":"10.3" }
proposal-optional-catch-binding { "chrome":"4", "ie":"11", "ios":"10.3" }
proposal-async-generator-functions { "chrome":"4", "ie":"11", "ios":"10.3" }
proposal-object-rest-spread { "chrome":"4", "ie":"11", "ios":"10.3" }
transform-dotall-regex { "chrome":"4", "firefox":"72", "ie":"11", "ios":"10.3" }
proposal-unicode-property-regex { "chrome":"4", "firefox":"72", "ie":"11", "ios":"10.3" }
transform-named-capturing-groups-regex { "chrome":"4", "firefox":"72", "ie":"11", "ios":"10.3" }
transform-async-to-generator { "chrome":"4", "ie":"11", "ios":"10.3" }
transform-exponentiation-operator { "chrome":"4", "ie":"11" }
transform-template-literals { "chrome":"4", "ie":"11", "ios":"10.3", "safari":"12.1" }
transform-literals { "chrome":"4", "ie":"11" }
transform-function-name { "chrome":"4", "ie":"11" }
transform-arrow-functions { "chrome":"4", "ie":"11" }
transform-block-scoped-functions { "chrome":"4" }
transform-classes { "chrome":"4", "ie":"11" }
transform-object-super { "chrome":"4", "ie":"11" }
transform-shorthand-properties { "chrome":"4", "ie":"11" }
transform-duplicate-keys { "chrome":"4", "ie":"11" }
transform-computed-properties { "chrome":"4", "ie":"11" }
transform-for-of { "chrome":"4", "ie":"11" }
transform-sticky-regex { "chrome":"4", "ie":"11" }
transform-unicode-regex { "chrome":"4", "ie":"11", "ios":"10.3" }
transform-spread { "chrome":"4", "ie":"11" }
transform-parameters { "chrome":"4", "ie":"11" }
transform-destructuring { "chrome":"4", "ie":"11" }
transform-block-scoping { "chrome":"4", "ie":"11", "ios":"10.3" }
transform-typeof-symbol { "chrome":"4", "ie":"11" }
transform-new-target { "chrome":"4", "ie":"11" }
transform-regenerator { "chrome":"4", "ie":"11" }
transform-member-expression-literals { "chrome":"4" }
transform-property-literals { "chrome":"4" }
transform-reserved-words { "chrome":"4" }
syntax-dynamic-import { "android":"79", "chrome":"4", "edge":"79", "firefox":"72", "ie":"11", "ios":"10.3", "node":"12.16", "opera":"65", "safari":"12.1", "samsung":"9.2" }

Expected behavior/code

When I remove the >=0.5% in GB I get the expected output

@babel/preset-env: `DEBUG` option

Using targets:
{
"android": "79",
"chrome": "79",
"edge": "79",
"firefox": "72",
"ie": "11",
"ios": "13",
"node": "10.19",
"opera": "65",
"safari": "12.1",
"samsung": "9.2"
}

Using modules transform: false

Using plugins:
proposal-nullish-coalescing-operator { "android":"79", "chrome":"79", "edge":"79", "ie":"11", "ios":"13", "node":"10.19", "opera":"65", "safari":"12.1", "samsung":"9.2" }
proposal-optional-chaining { "android":"79", "chrome":"79", "edge":"79", "firefox":"72", "ie":"11", "ios":"13", "node":"10.19", "opera":"65", "safari":"12.1", "samsung":"9.2" }
proposal-json-strings { "ie":"11" }
proposal-optional-catch-binding { "ie":"11" }
proposal-async-generator-functions { "ie":"11" }
proposal-object-rest-spread { "ie":"11" }
transform-dotall-regex { "firefox":"72", "ie":"11" }
proposal-unicode-property-regex { "firefox":"72", "ie":"11" }
transform-named-capturing-groups-regex { "firefox":"72", "ie":"11" }
transform-async-to-generator { "ie":"11" }
transform-exponentiation-operator { "ie":"11" }
transform-template-literals { "ie":"11", "safari":"12.1" }
transform-literals { "ie":"11" }
transform-function-name { "ie":"11" }
transform-arrow-functions { "ie":"11" }
transform-classes { "ie":"11" }
transform-object-super { "ie":"11" }
transform-shorthand-properties { "ie":"11" }
transform-duplicate-keys { "ie":"11" }
transform-computed-properties { "ie":"11" }
transform-for-of { "ie":"11" }
transform-sticky-regex { "ie":"11" }
transform-unicode-regex { "ie":"11" }
transform-spread { "ie":"11" }
transform-parameters { "ie":"11" }
transform-destructuring { "ie":"11" }
transform-block-scoping { "ie":"11" }
transform-typeof-symbol { "ie":"11" }
transform-new-target { "ie":"11" }
transform-regenerator { "ie":"11" }
syntax-dynamic-import { "android":"79", "chrome":"79", "edge":"79", "firefox":"72", "ie":"11", "ios":"13", "node":"10.19", "opera":"65", "safari":"12.1", "samsung":"9.2" }

Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)

Filename: .babelrc

{
"sourceType": "unambiguous",
"presets": [
[
"@babel/preset-env", {
"debug": true,
"modules": false,
"useBuiltIns": "usage",
"corejs": 3,
"targets": "last 2 versions, >=0.5% in GB, node 10, not IE <= 10, not dead"
}
],
"@babel/preset-react"
],
// Only use node polyfills for server files, no need for IE11 support on the server
"overrides": [{
"test": "./src/server",
"presets": [
[
"@babel/preset-env", {
"debug": true,
"modules": false,
"useBuiltIns": "usage",
"corejs": 3,
"targets": "node 12"
}
],
"@babel/preset-react"
]
}],
"plugins": [
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-exponentiation-operator",
"syntax-dynamic-import",
"transform-async-to-generator",
"universal-import"
]
}

Environment

System:
OS: macOS 10.15.3
Binaries:
Node: 12.16.1 - ~/.nvm/versions/node/v12.16.1/bin/node
Yarn: 1.19.1 - /usr/local/bin/yarn
npm: 6.13.4 - ~/.nvm/versions/node/v12.16.1/bin/npm
npmPackages:
@babel/core: ^7.8.6 => 7.8.6
@babel/plugin-proposal-class-properties: ^7.8.3 => 7.8.3
@babel/plugin-proposal-optional-chaining: ^7.8.3 => 7.8.3
@babel/preset-env: ^7.8.6 => 7.8.6
@babel/preset-react: ^7.8.3 => 7.8.3
@babel/register: ^7.8.6 => 7.8.6
babel-cli: ^6.26.0 => 6.26.0
babel-eslint: ^10.1.0 => 10.1.0
babel-loader: ^8.0.6 => 8.0.6
babel-plugin-syntax-dynamic-import: ^6.18.0 => 6.18.0
babel-plugin-transform-async-to-generator: ^6.24.1 => 6.24.1
babel-plugin-universal-import: ^4.0.0 => 4.0.0
eslint: ^6.6.0 => 6.8.0
webpack: ^4.16.5 => 4.41.6

Same issue in node 10.x

Possible Solution

I have a feeling it's a browserlist issue with parsing the semvar

Issue 2:
The only place I saw "I'd like to use JavaScript inside .babelrc is here: #4449, so I am opening a proper issue about .babelrc.js.

Expected Behavior

I would like to be able to provide:

.babelrc.js

module.exports = {
plugins: [
["babel-plugin-transform-cool", {
isCool: maybe => maybe ? 'yes' : 'no';
}]
]
};

And use the isCool option in the plugin like so: state.opts.isCool(true);

Current Behavior

.babelrc only allows for JSON.

Possible Solution

Use babel-core programmatically, this allows for any type of option (which may be seen as non-consistent with .babelrc).

Context

ESLint allows this, I find it easier to reason about configuration files when they are written with JavaScript: comments, easy customization with ENV variables, no context switch (This is JavaScript).