Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Commit

Permalink
infra - Run prettier across files
Browse files Browse the repository at this point in the history
  • Loading branch information
blainekasten committed Dec 5, 2018
1 parent 2e5bb94 commit 08f5571
Show file tree
Hide file tree
Showing 35 changed files with 484 additions and 479 deletions.
File renamed without changes.
27 changes: 17 additions & 10 deletions examples/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ class HoverMessage extends React.Component {
<button key="button" style={{display: 'flex', ':hover': {}}}>
Hover me!
</button>
{getState(this.state, 'button', ':hover')
? <span>{' '}Hovering!</span>
: null}
{getState(this.state, 'button', ':hover') ? (
<span> Hovering!</span>
) : null}
</div>
);
}
Expand All @@ -42,7 +42,8 @@ HoverMessage = Radium(HoverMessage);
//
// Radium with ES7 decorator
//
@Radium class TwoSquares extends React.Component {
@Radium
class TwoSquares extends React.Component {
render() {
return (
<div>
Expand Down Expand Up @@ -120,20 +121,26 @@ class App extends React.Component {
<StyleRoot>
<VisitedLink />

<p /><HoverMessage />
<p />
<HoverMessage />

<p /><TwoSquares />
<p />
<TwoSquares />

<p /><Spinner />
<p />
<Spinner />

<p /><MultiSpinner />
<p />
<MultiSpinner />

<p />
<Button onClick={this._remount.bind(this)}>Unmount and remount</Button>

<p /><Button>Button</Button>
<p />
<Button>Button</Button>

<p /><Button color="red">Button</Button>
<p />
<Button color="red">Button</Button>

<p />
<Button
Expand Down
3 changes: 2 additions & 1 deletion examples/components/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import React from 'react';
import PropTypes from 'prop-types';
import Radium from '../../src';

@Radium class Button extends React.Component {
@Radium
class Button extends React.Component {
render() {
return (
<button
Expand Down
16 changes: 7 additions & 9 deletions interfaces/inline-style-prefixer.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
declare class InlineStylePrefixer {
static prefixAll: typeof prefixAll,
static prefixAll: typeof prefixAll;

prefixedKeyframes: string,
prefixedKeyframes: string;

constructor(
config: {
keepUnprefixed?: boolean,
userAgent?: ?string
}
): void,
constructor(config: {
keepUnprefixed?: boolean,
userAgent?: ?string
}): void;

prefix(style: Object): Object
prefix(style: Object): Object;
}

declare function prefixAll(style: Object): Object;
Expand Down
6 changes: 1 addition & 5 deletions src/__tests__/enhancer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,7 @@ describe('Enhancer', () => {
return [{color: 'black'}];
}
render() {
return (
<div style={this.getStyles()}>
Hello World!
</div>
);
return <div style={this.getStyles()}>Hello World!</div>;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/get-state-key-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('getStateKey', () => {
it('gets the key if the ref is not a string', () => {
class Test extends React.Component {
render() {
return <div key="myKey" ref={ref => this.ref = ref} />;
return <div key="myKey" ref={ref => (this.ref = ref)} />;
}
}

Expand Down
15 changes: 10 additions & 5 deletions src/__tests__/keyframes-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {expectCSS, getElement} from 'test-helpers';
import React, {Component} from 'react';
import TestUtils from 'react-dom/test-utils';

const CHROME_14_USER_AGENT = 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.1 ' +
const CHROME_14_USER_AGENT =
'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.1 ' +
'(KHTML, like Gecko) Chrome/14.0.812.0 Safari/535.1';

describe('keyframes', () => {
Expand Down Expand Up @@ -243,13 +244,15 @@ describe('keyframes', () => {
'SlideFromLeft'
);

@Radium class ChildComponent extends Component {
@Radium
class ChildComponent extends Component {
render() {
return <div style={{animationName: animation}} />;
}
}

@Radium class TestComponent extends Component {
@Radium
class TestComponent extends Component {
render() {
return (
<StyleRoot>
Expand Down Expand Up @@ -294,13 +297,15 @@ describe('keyframes', () => {
'SlideFromTop'
);

@Radium class ChildComponent extends Component {
@Radium
class ChildComponent extends Component {
render() {
return <div style={{animationName: [animation, animation2]}} />;
}
}

@Radium class TestComponent extends Component {
@Radium
class TestComponent extends Component {
render() {
return (
<StyleRoot>
Expand Down
7 changes: 4 additions & 3 deletions src/__tests__/media-query-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,8 @@ describe('Media query tests', () => {
// we only get called with `(undefined, { componentStack: STUFF })` just accept
// it until we understand more.
expect(catchSpy).to.have.callCount(1);
expect(catchSpy.getCall(0).args[1]).to.have
.property('componentStack')
expect(catchSpy.getCall(0).args[1])
.to.have.property('componentStack')
.that.contains('Component');
});

Expand All @@ -409,7 +409,8 @@ describe('Media query tests', () => {
</div>
));
expect(() =>
TestUtils.renderIntoDocument(<TestComponent />)).not.to.throw();
TestUtils.renderIntoDocument(<TestComponent />)
).not.to.throw();
});

it("doesn't try to setState if not mounted", () => {
Expand Down
Loading

0 comments on commit 08f5571

Please sign in to comment.