TypeScript/tests/cases/fourslash/tsxGoToDefinitionStatelessFunction2.ts
Wesley Wigham 7b5ef64e76
Unify JSX And Normal Call Checking Codepaths (#27627)
* Unify JSX Call Checking Codepaths

* Add tests for fixed issues

* Fix lint, move all error checking into the only-run-once resolveSignature call

* Remove unused (unreachable?) code path

* Consolidate a little more duplicated logic into signature checking

* Fix #19775 a bit more

* Cosmetic changes from CR
2018-10-16 20:16:00 -04:00

41 lines
1.5 KiB
TypeScript

/// <reference path='fourslash.ts' />
//@Filename: file.tsx
// @jsx: preserve
// @noLib: true
//// declare module JSX {
//// interface Element { }
//// interface IntrinsicElements {
//// }
//// interface ElementAttributesProperty { props; }
//// }
//// interface ClickableProps {
//// children?: string;
//// className?: string;
//// }
//// interface ButtonProps extends ClickableProps {
//// onClick(event?: React.MouseEvent<HTMLButtonElement>): void;
//// }
//// interface LinkProps extends ClickableProps {
//// goTo: string;
//// }
//// declare function /*firstSource*/MainButton(buttonProps: ButtonProps): JSX.Element;
//// declare function /*secondSource*/MainButton(linkProps: LinkProps): JSX.Element;
//// declare function /*thirdSource*/MainButton(props: ButtonProps | LinkProps): JSX.Element;
//// let opt = <[|Main/*firstTarget*/Button|] />;
//// let opt = <[|Main/*secondTarget*/Button|] children="chidlren" />;
//// let opt = <[|Main/*thirdTarget*/Button|] onClick={()=>{}} />;
//// let opt = <[|Main/*fourthTarget*/Button|] onClick={()=>{}} ignore-prop />;
//// let opt = <[|Main/*fifthTarget*/Button|] goTo="goTo" />;
//// let opt = <[|Main/*sixthTarget*/Button|] wrong />;
verify.goToDefinition({
firstTarget: "firstSource",
secondTarget: "firstSource",
thirdTarget: "firstSource",
fourthTarget: "firstSource",
fifthTarget: "secondSource",
sixthTarget: "firstSource"
});