From 0a2e42f4412047bdd881077c7e26eaaa9ea7698a Mon Sep 17 00:00:00 2001 From: Boris Sergeyev Date: Tue, 20 Nov 2018 22:48:28 +0100 Subject: [PATCH] [react-redux] used whitespace consistently (no tabs) --- types/react-redux/react-redux-tests.tsx | 352 ++++++++++++------------ 1 file changed, 176 insertions(+), 176 deletions(-) diff --git a/types/react-redux/react-redux-tests.tsx b/types/react-redux/react-redux-tests.tsx index 6758f1a4a8..aff8515e87 100644 --- a/types/react-redux/react-redux-tests.tsx +++ b/types/react-redux/react-redux-tests.tsx @@ -523,7 +523,7 @@ const ATestComponent: React.ComponentClass = TestComponent; // $Expec interface HelloMessageProps { dispatch: Dispatch; name: string; - } +} const HelloMessage: React.StatelessComponent = (props) => { return
Hello {props.name}
; }; @@ -777,68 +777,68 @@ function TestControlledComponentWithoutDispatchProp() { } function TestDispatchToPropsAsObject() { - const onClick: ActionCreator<{}> = () => ({}); - const mapStateToProps = (state: any) => { - return { - title: state.app.title as string, - }; - }; - const dispatchToProps = { - onClick, - }; + const onClick: ActionCreator<{}> = () => ({}); + const mapStateToProps = (state: any) => { + return { + title: state.app.title as string, + }; + }; + const dispatchToProps = { + onClick, + }; - type Props = { title: string; } & typeof dispatchToProps; - const HeaderComponent: React.StatelessComponent = (props) => { - return

{props.title}

; - }; + type Props = { title: string; } & typeof dispatchToProps; + const HeaderComponent: React.StatelessComponent = (props) => { + return

{props.title}

; + }; - const Header = connect(mapStateToProps, dispatchToProps)(HeaderComponent); + const Header = connect(mapStateToProps, dispatchToProps)(HeaderComponent);
; } function TestInferredFunctionalComponentWithExplicitOwnProps() { - interface Props { - title: string; - extraText: string; - onClick: () => void; - } + interface Props { + title: string; + extraText: string; + onClick: () => void; + } - const Header = connect( - ( - { app: { title }}: { app: { title: string }}, - { extraText }: { extraText: string } - ) => ({ - title, - extraText - }), - (dispatch) => ({ - onClick: () => dispatch({ type: 'test' }) - }) - )(({ title, extraText, onClick }: Props) => { - return

{title} {extraText}

; - }); + const Header = connect( + ( + { app: { title }}: { app: { title: string }}, + { extraText }: { extraText: string } + ) => ({ + title, + extraText + }), + (dispatch) => ({ + onClick: () => dispatch({ type: 'test' }) + }) + )(({ title, extraText, onClick }: Props) => { + return

{title} {extraText}

; + });
; } function TestInferredFunctionalComponentWithImplicitOwnProps() { - interface Props { - title: string; - extraText: string; - onClick: () => void; - } + interface Props { + title: string; + extraText: string; + onClick: () => void; + } - const Header = connect( - ( - { app: { title }}: { app: { title: string }}, - ) => ({ - title, - }), - (dispatch) => ({ - onClick: () => dispatch({ type: 'test' }) - }) - )(({ title, extraText, onClick }: Props) => { - return

{title} {extraText}

; - }); + const Header = connect( + ( + { app: { title }}: { app: { title: string }}, + ) => ({ + title, + }), + (dispatch) => ({ + onClick: () => dispatch({ type: 'test' }) + }) + )(({ title, extraText, onClick }: Props) => { + return

{title} {extraText}

; + });
; } @@ -993,164 +993,164 @@ function ProviderAcceptsStoreWithCustomAction() { } function TestOptionalPropsMergedCorrectly() { - interface OptionalDecorationProps { - foo: string; - bar: number; - optionalProp?: boolean; - dependsOnDispatch?: () => void; - } + interface OptionalDecorationProps { + foo: string; + bar: number; + optionalProp?: boolean; + dependsOnDispatch?: () => void; + } - class Component extends React.Component { - render() { - return
; - } - } + class Component extends React.Component { + render() { + return
; + } + } - interface MapStateProps { - foo: string; - bar: number; - optionalProp: boolean; - } + interface MapStateProps { + foo: string; + bar: number; + optionalProp: boolean; + } - interface MapDispatchProps { - dependsOnDispatch: () => void; - } + interface MapDispatchProps { + dependsOnDispatch: () => void; + } - function mapStateToProps(state: any): MapStateProps { - return { - foo: 'foo', - bar: 42, - optionalProp: true, - }; - } + function mapStateToProps(state: any): MapStateProps { + return { + foo: 'foo', + bar: 42, + optionalProp: true, + }; + } - function mapDispatchToProps(dispatch: any): MapDispatchProps { - return { - dependsOnDispatch: () => {} - }; - } + function mapDispatchToProps(dispatch: any): MapDispatchProps { + return { + dependsOnDispatch: () => {} + }; + } - connect(mapStateToProps, mapDispatchToProps)(Component); + connect(mapStateToProps, mapDispatchToProps)(Component); } function TestMoreGeneralDecorationProps() { - // connect() should support decoration props that are more permissive - // than the injected props, as long as the injected props can satisfy - // the decoration props. - interface MoreGeneralDecorationProps { - foo: string | number; - bar: number | 'foo'; - optionalProp?: boolean | object; - dependsOnDispatch?: () => void; - } + // connect() should support decoration props that are more permissive + // than the injected props, as long as the injected props can satisfy + // the decoration props. + interface MoreGeneralDecorationProps { + foo: string | number; + bar: number | 'foo'; + optionalProp?: boolean | object; + dependsOnDispatch?: () => void; + } - class Component extends React.Component { - render() { - return
; - } - } + class Component extends React.Component { + render() { + return
; + } + } - interface MapStateProps { - foo: string; - bar: number; - optionalProp: boolean; - } + interface MapStateProps { + foo: string; + bar: number; + optionalProp: boolean; + } - interface MapDispatchProps { - dependsOnDispatch: () => void; - } + interface MapDispatchProps { + dependsOnDispatch: () => void; + } - function mapStateToProps(state: any): MapStateProps { - return { - foo: 'foo', - bar: 42, - optionalProp: true, - }; - } + function mapStateToProps(state: any): MapStateProps { + return { + foo: 'foo', + bar: 42, + optionalProp: true, + }; + } - function mapDispatchToProps(dispatch: any): MapDispatchProps { - return { - dependsOnDispatch: () => {} - }; - } + function mapDispatchToProps(dispatch: any): MapDispatchProps { + return { + dependsOnDispatch: () => {} + }; + } - connect(mapStateToProps, mapDispatchToProps)(Component); + connect(mapStateToProps, mapDispatchToProps)(Component); } function TestFailsMoreSpecificInjectedProps() { - interface MoreSpecificDecorationProps { - foo: string; - bar: number; - dependsOnDispatch: () => void; - } + interface MoreSpecificDecorationProps { + foo: string; + bar: number; + dependsOnDispatch: () => void; + } - class Component extends React.Component { - render() { - return
; - } - } + class Component extends React.Component { + render() { + return
; + } + } - interface MapStateProps { - foo: string | number; - bar: number | 'foo'; - dependsOnDispatch?: () => void; - } + interface MapStateProps { + foo: string | number; + bar: number | 'foo'; + dependsOnDispatch?: () => void; + } - interface MapDispatchProps { - dependsOnDispatch?: () => void; - } + interface MapDispatchProps { + dependsOnDispatch?: () => void; + } - function mapStateToProps(state: any): MapStateProps { - return { - foo: 'foo', - bar: 42, - }; - } + function mapStateToProps(state: any): MapStateProps { + return { + foo: 'foo', + bar: 42, + }; + } - function mapDispatchToProps(dispatch: any): MapDispatchProps { - return { - dependsOnDispatch: () => {} - }; - } + function mapDispatchToProps(dispatch: any): MapDispatchProps { + return { + dependsOnDispatch: () => {} + }; + } - // Since it is possible the injected props could fail to satisfy the decoration props, - // the following line should fail to compile. - connect(mapStateToProps, mapDispatchToProps)(Component); // $ExpectError + // Since it is possible the injected props could fail to satisfy the decoration props, + // the following line should fail to compile. + connect(mapStateToProps, mapDispatchToProps)(Component); // $ExpectError - // Confirm that this also fails with functional components + // Confirm that this also fails with functional components const FunctionalComponent = (props: MoreSpecificDecorationProps) => null; - connect(mapStateToProps, mapDispatchToProps)(Component); // $ExpectError + connect(mapStateToProps, mapDispatchToProps)(Component); // $ExpectError } function TestLibraryManagedAttributes() { - interface OwnProps { - bar: number; - fn: () => void; - } + interface OwnProps { + bar: number; + fn: () => void; + } - interface MapStateProps { - foo: string; - } + interface MapStateProps { + foo: string; + } - class Component extends React.Component { - static defaultProps = { - bar: 0, - }; + class Component extends React.Component { + static defaultProps = { + bar: 0, + }; - render() { - return
; - } - } + render() { + return
; + } + } - function mapStateToProps(state: any): MapStateProps { - return { - foo: 'foo', - }; - } + function mapStateToProps(state: any): MapStateProps { + return { + foo: 'foo', + }; + } - const ConnectedComponent = connect(mapStateToProps)(Component); - {}} />; + const ConnectedComponent = connect(mapStateToProps)(Component); + {}} />; - const ConnectedComponent2 = connect(mapStateToProps)(Component); - {}} />; + const ConnectedComponent2 = connect(mapStateToProps)(Component); + {}} />; }