TypeScript: Support type arguments on JSX opening and self-closing tags (#7799)

This commit is contained in:
Andy
2018-07-10 15:19:42 -07:00
committed by Brian Ng
parent 19a1705293
commit 301db1b921
17 changed files with 356 additions and 16 deletions

View File

@@ -1,7 +1,7 @@
// @flow
import type { Options } from "../options";
import type { File } from "../types";
import type { File, JSXOpeningElement } from "../types";
import type { PluginList } from "../plugin-utils";
import { getOptions } from "../options";
import StatementParser from "./statement";
@@ -11,6 +11,11 @@ export type PluginsMap = {
};
export default class Parser extends StatementParser {
// Forward-declaration so typescript plugin can override jsx plugin
+jsxParseOpeningElementAfterName: (
node: JSXOpeningElement,
) => JSXOpeningElement;
constructor(options: ?Options, input: string) {
options = getOptions(options);
super(options, input);