From 197e49c7663542eb5a841c2dc50a48bf387f3a38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Frank?= Date: Wed, 19 Dec 2018 14:38:58 +0100 Subject: [PATCH] Revert editor auto-indentation. --- types/react-redux/index.d.ts | 20 +++---- types/react-redux/react-redux-tests.tsx | 72 ++++++++++++------------- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index 101c34dea0..1ba25ddd43 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -67,10 +67,10 @@ export type AdvancedComponentDecorator = */ export type Matching = { [P in keyof DecorationTargetProps]: P extends keyof InjectedProps - ? InjectedProps[P] extends DecorationTargetProps[P] - ? DecorationTargetProps[P] - : InjectedProps[P] - : DecorationTargetProps[P]; + ? InjectedProps[P] extends DecorationTargetProps[P] + ? DecorationTargetProps[P] + : InjectedProps[P] + : DecorationTargetProps[P]; }; /** @@ -115,8 +115,8 @@ export type InferableComponentEnhancer = export type InferThunkActionCreatorType any> = TActionCreator extends (...args: infer TParams) => (...args: any[]) => infer TReturn - ? (...args: TParams) => TReturn - : TActionCreator; + ? (...args: TParams) => TReturn + : TActionCreator; export type HandleThunkActionCreator = TActionCreator extends (...args: any[]) => any @@ -127,10 +127,10 @@ export type HandleThunkActionCreator = // https://github.com/reduxjs/redux-thunk#composition export type ResolveThunks = TDispatchProps extends { [key: string]: any } - ? { - [C in keyof TDispatchProps]: HandleThunkActionCreator - } - : TDispatchProps; + ? { + [C in keyof TDispatchProps]: HandleThunkActionCreator + } + : TDispatchProps; /** * Connects a React component to a Redux store. diff --git a/types/react-redux/react-redux-tests.tsx b/types/react-redux/react-redux-tests.tsx index 80545fbcb8..110d53cc1a 100644 --- a/types/react-redux/react-redux-tests.tsx +++ b/types/react-redux/react-redux-tests.tsx @@ -18,7 +18,7 @@ function Empty() { foo: string; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const Test = connect()(TestComponent); @@ -29,7 +29,7 @@ function MapState() { interface OwnProps { foo: string; } interface StateProps { bar: number; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const mapStateToProps = (_: any) => ({ bar: 1 @@ -46,7 +46,7 @@ function MapStateWithDispatchProp() { interface OwnProps { foo: string; } interface StateProps { bar: number; dispatch: Dispatch; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const mapStateToProps = (_: any) => ({ bar: 1 @@ -63,7 +63,7 @@ function MapStateFactory() { interface OwnProps { foo: string; } interface StateProps { bar: number; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const mapStateToProps = () => () => ({ bar: 1 @@ -80,10 +80,10 @@ function MapDispatch() { interface OwnProps { foo: string; } interface DispatchProps { onClick: () => void; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const mapDispatchToProps = () => ({ - onClick: () => { } + onClick: () => {} }); const TestNull = connect( @@ -117,8 +117,8 @@ function MapDispatchWithThunkActionCreators() { interface TestComponentProps extends OwnProps { simpleAction: typeof simpleAction; thunkAction(param1: number, param2: string): Promise; - } - class TestComponent extends React.Component { } + } + class TestComponent extends React.Component {} const mapStateToProps = ({ foo }: { foo: string }) => ({ foo }); const mapDispatchToProps = { simpleAction, thunkAction }; @@ -145,7 +145,7 @@ function MapManualDispatchThatLooksLikeThunk() { } interface TestComponentProps extends OwnProps { remove: (item: string) => () => object; - } + } class TestComponent extends React.Component { render() { return
; @@ -192,7 +192,7 @@ function MapStateAndDispatchObject() { bar: 1 }); - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const Test = connect( mapStateToProps, @@ -206,10 +206,10 @@ function MapDispatchFactory() { interface OwnProps { foo: string; } interface DispatchProps { onClick: () => void; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const mapDispatchToPropsFactory = () => () => ({ - onClick: () => { } + onClick: () => {} }); const TestNull = connect( @@ -232,14 +232,14 @@ function MapStateAndDispatch() { interface StateProps { bar: number; } interface DispatchProps { onClick: () => void; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const mapStateToProps = () => ({ bar: 1 }); const mapDispatchToProps = () => ({ - onClick: () => { } + onClick: () => {} }); const Test = connect( @@ -260,10 +260,10 @@ function MapStateFactoryAndDispatch() { }); const mapDispatchToProps = () => ({ - onClick: () => { } + onClick: () => {} }); - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const Test = connect( mapStateToPropsFactory, @@ -283,10 +283,10 @@ function MapStateFactoryAndDispatchFactory() { }); const mapDispatchToPropsFactory = () => () => ({ - onClick: () => { } + onClick: () => {} }); - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const Test = connect( mapStateToPropsFactory, @@ -301,14 +301,14 @@ function MapStateAndDispatchAndMerge() { interface StateProps { bar: number; } interface DispatchProps { onClick: () => void; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const mapStateToProps = () => ({ bar: 1 }); const mapDispatchToProps = () => ({ - onClick: () => { } + onClick: () => {} }); const mergeProps = (stateProps: StateProps, dispatchProps: DispatchProps) => ( @@ -330,7 +330,7 @@ function MapStateAndOptions() { interface StateProps { bar: number; } interface DispatchProps { dispatch: Dispatch; } - class TestComponent extends React.Component { } + class TestComponent extends React.Component {} const mapStateToProps = (state: State) => ({ bar: 1 @@ -444,9 +444,9 @@ ReactDOM.render(( declare var store: Store; class MyRootComponent extends React.Component { } -class TodoApp extends React.Component { } +class TodoApp extends React.Component {} interface TodoState { - todos: string[] | string; + todos: string[]|string; } interface TodoProps { userId: number; @@ -629,7 +629,7 @@ function TestTOwnPropsInference() { class OwnPropsComponent extends React.Component { render() { - return
; + return
; } } @@ -667,7 +667,7 @@ function TestTOwnPropsInference() { class AllPropsComponent extends React.Component { render() { - return
; + return
; } } @@ -701,7 +701,7 @@ function TestMergedPropsInference() { class MergedPropsComponent extends React.Component { render() { - return
; + return
; } } @@ -747,7 +747,7 @@ function Issue16652() { comments: Array<({ id: string } | undefined)>; } - class CommentList extends React.Component { } + class CommentList extends React.Component {} const mapStateToProps = (state: any, ownProps: PassedProps): GeneratedStateProps => { return { @@ -861,7 +861,7 @@ function TestInferredFunctionalComponentWithExplicitOwnProps() { const Header = connect( ( - { app: { title } }: { app: { title: string } }, + { app: { title }}: { app: { title: string }}, { extraText }: { extraText: string } ) => ({ title, @@ -873,7 +873,7 @@ function TestInferredFunctionalComponentWithExplicitOwnProps() { )(({ title, extraText, onClick }: Props) => { return

{title} {extraText}

; }); -
; +
; } function TestInferredFunctionalComponentWithImplicitOwnProps() { @@ -885,7 +885,7 @@ function TestInferredFunctionalComponentWithImplicitOwnProps() { const Header = connect( ( - { app: { title } }: { app: { title: string } }, + { app: { title }}: { app: { title: string }}, ) => ({ title, }), @@ -895,7 +895,7 @@ function TestInferredFunctionalComponentWithImplicitOwnProps() { )(({ title, extraText, onClick }: Props) => { return

{title} {extraText}

; }); -
; +
; } function TestWrappedComponent() { @@ -1082,7 +1082,7 @@ function TestOptionalPropsMergedCorrectly() { function mapDispatchToProps(dispatch: any): MapDispatchProps { return { - dependsOnDispatch: () => { } + dependsOnDispatch: () => {} }; } @@ -1126,7 +1126,7 @@ function TestMoreGeneralDecorationProps() { function mapDispatchToProps(dispatch: any): MapDispatchProps { return { - dependsOnDispatch: () => { } + dependsOnDispatch: () => {} }; } @@ -1165,7 +1165,7 @@ function TestFailsMoreSpecificInjectedProps() { function mapDispatchToProps(dispatch: any): MapDispatchProps { return { - dependsOnDispatch: () => { } + dependsOnDispatch: () => {} }; } @@ -1205,10 +1205,10 @@ function TestLibraryManagedAttributes() { } const ConnectedComponent = connect(mapStateToProps)(Component); - { }} />; + {}} />; const ConnectedComponent2 = connect(mapStateToProps)(Component); - { }} />; + {}} />; } function TestProviderContext() {