-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
area: typescriptoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: parser
Description
Bug Report
Current Behavior
Babel does not report error on empty typeParameters and typeArguments
Input Code
const foo: Foo<>function f1<>() {}Expected behavior/code
babel should throw errors:
Type parameter list cannot be empty.
Type argument list cannot be empty.
Babel Configuration (.babelrc, package.json, cli command)
const babel = require('@babel/parser');
const plugins: ParserPlugin[] = [
'typescript',
'objectRestSpread',
'decorators-legacy',
'classProperties',
'asyncGenerators',
'dynamicImport',
'estree',
'bigInt',
'importMeta'
];
if (jsx) {
plugins.push('jsx');
}
return babel.parse(text, {
sourceType: 'unambiguous',
allowImportExportEverywhere: true,
allowReturnOutsideFunction: true,
ranges: true,
plugins
});Environment
- Babel version(s): 7.3.2
- Node/npm version: 6-11
- OS: ----
- Monorepo: ---
- How you are using Babel: @babel/parser ->
parse
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: typescriptoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: parser