Issue 1:
Bug Report

Current Behavior

I am using

require("@babel/register")({
babelrc: false, // Tell babel-register to ignore the .babelrc file
presets: ["babel-preset-env", "babel-preset-react"],
plugins: [
"babel-plugin-transform-class-properties",
"babel-plugin-transform-object-rest-spread",
[
"babel-plugin-transform-runtime",
{
helpers: false,
polyfill: false,
regenerator: true
}
]
]
});

and all I get is an error when requiring the next file which says:

ReferenceError: Unknown option: .caller. Check out http://babeljs.io/docs/usage/options/ for more information about options.
at buildUnknownError (/Users/andy/Development/oa-content/app/node_modules/@babel/core/lib/config/validation/options.js:98:11)
at /Users/andy/Development/oa-content/app/node_modules/@babel/core/lib/config/validation/options.js:84:57
at Array.forEach (<anonymous>)
at validate (/Users/andy/Development/oa-content/app/node_modules/@babel/core/lib/config/validation/options.js:62:21)
at loadPrivatePartialConfig (/Users/andy/Development/oa-content/app/node_modules/@babel/core/lib/config/partial.js:28:48)
at loadFullConfig (/Users/andy/Development/oa-content/app/node_modules/@babel/core/lib/config/full.js:33:37)
at loadOptions (/Users/andy/Development/oa-content/app/node_modules/@babel/core/lib/config/index.js:18:34)
at OptionManager.init (/Users/andy/Development/oa-content/app/node_modules/@babel/core/lib/config/index.js:28:12)
at compile (/Users/andy/Development/oa-content/app/node_modules/@babel/register/lib/node.js:61:42)
at compileHook (/Users/andy/Development/oa-content/app/node_modules/@babel/register/lib/node.js:102:12)

I checked through the code and @babel/register adds the "caller" to the transformOpts which is then passed to the transform function so I really don't know what's going on here. For some reason I just can't get it to work and it's not making a lot of sense.

Expected behavior/code

The next require statement should just work.

Environment

Babel version(s): ```

├─ @babel/cli@7.0.0-rc.3

├─ @babel/code-frame@7.0.0-beta.42

├─ @babel/core@7.0.0-beta.42

├─ @babel/generator@7.0.0-beta.42

├─ @babel/helper-annotate-as-pure@7.0.0-beta.42

├─ @babel/helper-builder-binary-assignment-operator-visitor@7.0.0-beta.42

├─ @babel/helper-builder-react-jsx@7.0.0-beta.42

├─ @babel/helper-call-delegate@7.0.0-beta.42

├─ @babel/helper-define-map@7.0.0-beta.42

├─ @babel/helper-explode-assignable-expression@7.0.0-beta.42

├─ @babel/helper-function-name@7.0.0-beta.42

├─ @babel/helper-get-function-arity@7.0.0-beta.42

├─ @babel/helper-hoist-variables@7.0.0-beta.42

├─ @babel/helper-module-imports@7.0.0-beta.42

├─ @babel/helper-module-transforms@7.0.0-beta.42

├─ @babel/helper-optimise-call-expression@7.0.0-beta.42

├─ @babel/helper-plugin-utils@7.0.0-beta.42

├─ @babel/helper-regex@7.0.0-beta.42

├─ @babel/helper-remap-async-to-generator@7.0.0-beta.42

├─ @babel/helper-replace-supers@7.0.0-beta.42

├─ @babel/helper-simple-access@7.0.0-beta.42

├─ @babel/helper-split-export-declaration@7.0.0-beta.42

├─ @babel/helper-wrap-function@7.0.0-beta.42

├─ @babel/helpers@7.0.0-beta.42

├─ @babel/highlight@7.0.0-beta.42

├─ @babel/node@7.0.0-rc.3

├─ @babel/plugin-proposal-async-generator-functions@7.0.0-beta.42

├─ @babel/plugin-proposal-class-properties@7.0.0-beta.42

├─ @babel/plugin-proposal-object-rest-spread@7.0.0-beta.42

├─ @babel/plugin-proposal-optional-catch-binding@7.0.0-beta.42

├─ @babel/plugin-proposal-unicode-property-regex@7.0.0-beta.42

├─ @babel/plugin-syntax-async-generators@7.0.0-beta.42

├─ @babel/plugin-syntax-class-properties@7.0.0-beta.42

├─ @babel/plugin-syntax-dynamic-import@7.0.0-beta.42

├─ @babel/plugin-syntax-jsx@7.0.0-beta.42

├─ @babel/plugin-syntax-object-rest-spread@7.0.0-beta.42

├─ @babel/plugin-syntax-optional-catch-binding@7.0.0-beta.42

├─ @babel/plugin-transform-arrow-functions@7.0.0-beta.42

├─ @babel/plugin-transform-async-to-generator@7.0.0-beta.42

├─ @babel/plugin-transform-block-scoped-functions@7.0.0-beta.42

├─ @babel/plugin-transform-block-scoping@7.0.0-beta.42

├─ @babel/plugin-transform-classes@7.0.0-beta.42

├─ @babel/plugin-transform-computed-properties@7.0.0-beta.42

├─ @babel/plugin-transform-destructuring@7.0.0-beta.42

├─ @babel/plugin-transform-dotall-regex@7.0.0-beta.42

├─ @babel/plugin-transform-duplicate-keys@7.0.0-beta.42

├─ @babel/plugin-transform-exponentiation-operator@7.0.0-beta.42

├─ @babel/plugin-transform-for-of@7.0.0-beta.42

├─ @babel/plugin-transform-function-name@7.0.0-beta.42

├─ @babel/plugin-transform-literals@7.0.0-beta.42

├─ @babel/plugin-transform-modules-amd@7.0.0-beta.42

├─ @babel/plugin-transform-modules-commonjs@7.0.0-beta.42

├─ @babel/plugin-transform-modules-systemjs@7.0.0-beta.42

├─ @babel/plugin-transform-modules-umd@7.0.0-beta.42

├─ @babel/plugin-transform-new-target@7.0.0-beta.42

├─ @babel/plugin-transform-object-super@7.0.0-beta.42

├─ @babel/plugin-transform-parameters@7.0.0-beta.42

├─ @babel/plugin-transform-react-display-name@7.0.0-beta.42

├─ @babel/plugin-transform-react-jsx-self@7.0.0-beta.42

├─ @babel/plugin-transform-react-jsx-source@7.0.0-beta.42

├─ @babel/plugin-transform-react-jsx@7.0.0-beta.42

├─ @babel/plugin-transform-regenerator@7.0.0-beta.42

├─ @babel/plugin-transform-runtime@7.0.0-beta.42

├─ @babel/plugin-transform-shorthand-properties@7.0.0-beta.42

├─ @babel/plugin-transform-spread@7.0.0-beta.42

├─ @babel/plugin-transform-sticky-regex@7.0.0-beta.42

├─ @babel/plugin-transform-template-literals@7.0.0-beta.42

├─ @babel/plugin-transform-typeof-symbol@7.0.0-beta.42

├─ @babel/plugin-transform-unicode-regex@7.0.0-beta.42

├─ @babel/polyfill@7.0.0-rc.3

├─ @babel/preset-env@7.0.0-beta.42

├─ @babel/preset-react@7.0.0-beta.42

├─ @babel/register@7.0.0-rc.3

├─ @babel/runtime@7.0.0-beta.42

├─ @babel/template@7.0.0-beta.42

├─ @babel/traverse@7.0.0-beta.42

├─ @babel/types@7.0.0-beta.42

└─ babel-eslint@8.2.5

├─ @babel/code-frame@7.0.0-beta.44

├─ @babel/generator@7.0.0-beta.44

├─ @babel/helper-function-name@7.0.0-beta.44

├─ @babel/helper-get-function-arity@7.0.0-beta.44

├─ @babel/helper-split-export-declaration@7.0.0-beta.44

├─ @babel/highlight@7.0.0-beta.44

├─ @babel/template@7.0.0-beta.44

├─ @babel/traverse@7.0.0-beta.44

└─ @babel/types@7.0.0-beta.44

and

├─ babel-code-frame@6.26.0

├─ babel-core@7.0.0-bridge.0

├─ babel-eslint@8.2.5

├─ babel-generator@6.26.1

├─ babel-helper-builder-binary-assignment-operator-visitor@6.24.1

├─ babel-helper-builder-react-jsx@6.26.0

├─ babel-helper-call-delegate@6.24.1

├─ babel-helper-define-map@6.26.0

├─ babel-helper-explode-assignable-expression@6.24.1

├─ babel-helper-function-name@6.24.1

├─ babel-helper-get-function-arity@6.24.1

├─ babel-helper-hoist-variables@6.24.1

├─ babel-helper-optimise-call-expression@6.24.1

├─ babel-helper-regex@6.26.0

├─ babel-helper-remap-async-to-generator@6.24.1

├─ babel-helper-replace-supers@6.24.1

├─ babel-helpers@6.24.1

├─ babel-loader@8.0.0-beta.3

├─ babel-messages@6.23.0

├─ babel-plugin-check-es2015-constants@6.22.0

├─ babel-plugin-react-require@3.0.0

├─ babel-plugin-syntax-async-functions@6.13.0

├─ babel-plugin-syntax-class-properties@6.13.0

├─ babel-plugin-syntax-exponentiation-operator@6.13.0

├─ babel-plugin-syntax-flow@6.18.0

├─ babel-plugin-syntax-jsx@6.18.0

├─ babel-plugin-syntax-object-rest-spread@7.0.0-beta.3

├─ babel-plugin-syntax-trailing-function-commas@6.22.0

├─ babel-plugin-transform-async-to-generator@6.24.1

├─ babel-plugin-transform-class-properties@6.24.1

├─ babel-plugin-transform-es2015-arrow-functions@6.22.0

├─ babel-plugin-transform-es2015-block-scoped-functions@6.22.0

├─ babel-plugin-transform-es2015-block-scoping@6.26.0

├─ babel-plugin-transform-es2015-classes@6.24.1

├─ babel-plugin-transform-es2015-computed-properties@6.24.1

├─ babel-plugin-transform-es2015-destructuring@6.23.0

├─ babel-plugin-transform-es2015-duplicate-keys@6.24.1

├─ babel-plugin-transform-es2015-for-of@6.23.0

├─ babel-plugin-transform-es2015-function-name@6.24.1

├─ babel-plugin-transform-es2015-literals@6.22.0

├─ babel-plugin-transform-es2015-modules-amd@6.24.1

├─ babel-plugin-transform-es2015-modules-commonjs@6.26.2

├─ babel-plugin-transform-es2015-modules-systemjs@6.24.1

├─ babel-plugin-transform-es2015-modules-umd@6.24.1

├─ babel-plugin-transform-es2015-object-super@6.24.1

├─ babel-plugin-transform-es2015-parameters@6.24.1

├─ babel-plugin-transform-es2015-shorthand-properties@6.24.1

├─ babel-plugin-transform-es2015-spread@6.22.0

├─ babel-plugin-transform-es2015-sticky-regex@6.24.1

├─ babel-plugin-transform-es2015-template-literals@6.22.0

├─ babel-plugin-transform-es2015-typeof-symbol@6.23.0

├─ babel-plugin-transform-es2015-unicode-regex@6.24.1

├─ babel-plugin-transform-exponentiation-operator@6.24.1

├─ babel-plugin-transform-flow-strip-types@6.22.0

├─ babel-plugin-transform-object-assign@6.22.0

├─ babel-plugin-transform-object-rest-spread@7.0.0-beta.3

├─ babel-plugin-transform-react-display-name@6.25.0

├─ babel-plugin-transform-react-jsx-self@6.22.0

├─ babel-plugin-transform-react-jsx-source@6.22.0

├─ babel-plugin-transform-react-jsx@6.24.1

├─ babel-plugin-transform-react-remove-prop-types@0.4.13

├─ babel-plugin-transform-regenerator@6.26.0

├─ babel-plugin-transform-strict-mode@6.24.1

├─ babel-preset-env@1.7.0

├─ babel-preset-flow@6.23.0

├─ babel-preset-react@6.24.1

├─ babel-register@6.26.0

│ └─ babel-core@6.26.3

├─ babel-runtime@6.26.0

├─ babel-template@6.26.0

├─ babel-traverse@6.26.0

├─ babel-types@6.26.0

└─ netlify-lambda@0.4.0

├─ babel-core@6.26.3

└─ babel-loader@7.1.4

Parts of my project use ```@babel/*``` and parts of is use ```babel-*```
- Node/npm version: 9.11.1
- OS: Mac OS X 10.13.6 (17G65)
- Monorepo no
- How you are using Babel: register

**Possible Solution**
I guess it should internally ignore "caller" since it adds it internally.

Issue 2:
Bug Report

I would like to work on a fix!

Current behavior

Code

declare global { namespace globalThis { var i18n: any; } }

export class i18n {}

trigger an scope error:

TypeError: Duplicate declaration "i18n"
1 | declare global { namespace globalThis { var i18n: any; } }
2 |
> 3 | export class i18n {}
| ^^^^

249 | }
250 |
> 251 | return new Error(msg);
| ^
252 | }
253 |
254 | }

at File.buildCodeFrameError (packages/babel-core/lib/transformation/file/file.js:251:12)
at Scope.checkBlockScopedCollisions (packages/babel-traverse/lib/scope/index.js:422:22)
at Scope.registerBinding (packages/babel-traverse/lib/scope/index.js:582:16)
at Scope.registerDeclaration (packages/babel-traverse/lib/scope/index.js:527:12)
at Object.BlockScoped (packages/babel-traverse/lib/scope/index.js:250:12)
at Object.newFn (packages/babel-traverse/lib/visitors.js:216:17)
at NodePath._call (packages/babel-traverse/lib/path/context.js:55:20)
at NodePath.call (packages/babel-traverse/lib/path/context.js:38:14)
at NodePath.visit (packages/babel-traverse/lib/path/context.js:90:31)
at TraversalContext.visitQueue (packages/babel-traverse/lib/context.js:116:16)

REPL

Input Code

As described above.

Expected behavior

This piece of code is valid in TypeScript.

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

Filename: babel.config.js

{
"presets": ["@babel/preset-typescript"]
}

Environment

Babel version(s): [e.g. v7.12.0]

Node/npm version: [e.g. Node 12/npm 7]

OS: [e.g. macOS 10.15.4, Windows 10]

Monorepo: [e.g. yes/no/Lerna]

How you are using Babel: [e.g. webpack, rollup, parcel, babel-register]

Possible Solution

Additional context