Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Commit

Permalink
function space paren: always
Browse files Browse the repository at this point in the history
  • Loading branch information
collin committed Jun 8, 2016
1 parent a2cd356 commit c07e191
Show file tree
Hide file tree
Showing 100 changed files with 393 additions and 393 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
"sort-vars": 0,
"space-after-keywords": 0,
"space-before-blocks": [1, "always"],
"space-before-function-paren": [1, "never"],
"space-before-function-paren": [1, "always"],
"space-in-parens": [1, "never"],
"space-infix-ops": 1,
"space-unary-ops": 0,
Expand Down
4 changes: 2 additions & 2 deletions elements/bulbs-poll/bulbs-poll-cms.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {

let promiseCache = {};
let previewDataCache = {};
function getPreviewData(src, callback) {
function getPreviewData (src, callback) {
promiseCache[src] || (promiseCache[src] = fetch(src).then((response) => response.json()));
promiseCache[src].then((data) => {
previewDataCache[src] = data;
Expand All @@ -14,7 +14,7 @@ function getPreviewData(src, callback) {
}

class EmbeddedBulbsPoll extends EmbededCMSElement {
get embedContentPreview() {
get embedContentPreview () {
let src = this.getAttribute('src');
let title = '';
if (src) {
Expand Down
4 changes: 2 additions & 2 deletions elements/bulbs-poll/bulbs-poll.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import BulbsPollRoot from './components/root';
import './bulbs-poll.scss';

class BulbsPoll extends BulbsElement {
initialDispatch() {
initialDispatch () {
this.store.actions.setSrc(this.props.src);
this.store.actions.fetchPollData(this.props.src);
this.store.actions.getCachedVoteData(this.props.src);
}

render() {
render () {
return (
<div data-track-action='Poll'>
<BulbsPollRoot
Expand Down
10 changes: 5 additions & 5 deletions elements/bulbs-poll/bulbs-poll.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import fetchMock from 'fetch-mock';
import testElement from 'bulbs-elements/test/element';
import './bulbs-poll';

testElement('<bulbs-poll> <BulbsPoll>', function() {
testElement('<bulbs-poll> <BulbsPoll>', function () {
let setSrcSpy;
let fetchPollDataSpy;
let getCachedVoteDataSpy;
let pollEndpoint;

beforeEach(function(done) {
beforeEach(function (done) {
pollEndpoint = 'http://example.tld/api/polls/1';
fetchMock.mock(pollEndpoint, {
body: {
Expand Down Expand Up @@ -42,15 +42,15 @@ testElement('<bulbs-poll> <BulbsPoll>', function() {
});
});

it('invokes setSrc', function() {
it('invokes setSrc', function () {
expect(setSrcSpy).to.have.been.calledWith(pollEndpoint);
});

it('invokes fetchPollData', function() {
it('invokes fetchPollData', function () {
expect(fetchPollDataSpy).to.have.been.calledWith(pollEndpoint);
});

it('invokes getCachedVoteData', function() {
it('invokes getCachedVoteData', function () {
expect(getCachedVoteDataSpy).to.have.been.calledWith(pollEndpoint);
});
});
4 changes: 2 additions & 2 deletions elements/bulbs-poll/components/answer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import classnames from 'classnames';
import SelectionMarker from './selection-marker';

export default class Answer extends React.Component {
selectAnswer() {
selectAnswer () {
this.props.selectAnswer(this.props.answer);
}

render() {
render () {
let {
answer,
selectedAnswer,
Expand Down
14 changes: 7 additions & 7 deletions elements/bulbs-poll/components/answer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { shallow } from 'enzyme';
import Answer from './answer';
import SelectionMarker from './selection-marker';

describe('<bulbs-poll> <Answer>', function() {
context('answer is not the selected answer', function() {
it('renders answer as not selected', function() {
describe('<bulbs-poll> <Answer>', function () {
context('answer is not the selected answer', function () {
it('renders answer as not selected', function () {
let answer = { answer_text: 'Answer', id: 1 };
let otherAnswer = { answer_text: 'Another', id: 2 };
let selectAnswer = function() {};
let selectAnswer = function () {};
let props = {
answer,
selectedAnswer: otherAnswer,
Expand All @@ -31,10 +31,10 @@ describe('<bulbs-poll> <Answer>', function() {
});
});

context('answer is the selected answer', function() {
it('renders answer as selected', function() {
context('answer is the selected answer', function () {
it('renders answer as selected', function () {
let answer = { answer_text: 'Answer', id: 1 };
let selectAnswer = function() {};
let selectAnswer = function () {};
let props = {
answer,
selectedAnswer: answer,
Expand Down
2 changes: 1 addition & 1 deletion elements/bulbs-poll/components/answers.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Answer from './answer';
import ImageAnswer from './image-answer';
import classnames from 'classnames';

export default function Answers(props) {
export default function Answers (props) {
let AnswerType = Answer;
let listClassName = 'bulbs-poll-answers';
if (props.poll.data.answer_type === 'imageText') {
Expand Down
20 changes: 10 additions & 10 deletions elements/bulbs-poll/components/answers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import Answers from './answers';
import Answer from './answer';
import ImageAnswer from './image-answer';

describe('<bulbs-poll> <Answers>', function() {
context('with no answers', function() {
it('renders no answers', function() {
describe('<bulbs-poll> <Answers>', function () {
context('with no answers', function () {
it('renders no answers', function () {
let answers = [];
let selectAnswer = function() {};
let selectAnswer = function () {};
let props = {
answers,
selectAnswer,
Expand All @@ -23,16 +23,16 @@ describe('<bulbs-poll> <Answers>', function() {
});
});

context('with list of answers', function() {
it('renders a list of answers', function() {
context('with list of answers', function () {
it('renders a list of answers', function () {
let answer1 = {};
let answer2 = {};
let answers = [
answer1,
answer2,
];

let selectAnswer = function() {};
let selectAnswer = function () {};

let props = {
answers,
Expand All @@ -56,16 +56,16 @@ describe('<bulbs-poll> <Answers>', function() {
});
});

context('answer_type is imageAnswer', function() {
it('renders answer images', function() {
context('answer_type is imageAnswer', function () {
it('renders answer images', function () {
let answer1 = {};
let answer2 = {};
let answers = [
answer1,
answer2,
];

let selectAnswer = function() {};
let selectAnswer = function () {};

let props = {
answers,
Expand Down
2 changes: 1 addition & 1 deletion elements/bulbs-poll/components/coming-soon.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import VoteButton from './vote-button';

export default function ComingSoon() {
export default function ComingSoon () {
return (
<div className='bulbs-poll-coming-soon'>
<div className='bulbs-poll-coming-soon-message'>Poll Coming Soon</div>
Expand Down
6 changes: 3 additions & 3 deletions elements/bulbs-poll/components/coming-soon.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { shallow } from 'enzyme';
import ComingSoon from './coming-soon';
import VoteButton from './vote-button';

describe('<bulbs-poll> <ComingSoon>', function() {
context('default', function() {
it('renders', function() {
describe('<bulbs-poll> <ComingSoon>', function () {
context('default', function () {
it('renders', function () {
let props = {};

expect(shallow(<ComingSoon {...props} />).equals(
Expand Down
2 changes: 1 addition & 1 deletion elements/bulbs-poll/components/cover.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { PropTypes } from 'react';

export default function Cover(props) {
export default function Cover (props) {
let { poll } = props;
return (
<header className="bulbs-poll-cover">
Expand Down
4 changes: 2 additions & 2 deletions elements/bulbs-poll/components/cover.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { shallow } from 'enzyme';

import Cover from './cover';

describe('<bulbs-poll> <Cover>', function() {
it('renders a cover without a thumbnail', function() {
describe('<bulbs-poll> <Cover>', function () {
it('renders a cover without a thumbnail', function () {
let poll = {
data: {
question_text: 'Question?',
Expand Down
2 changes: 1 addition & 1 deletion elements/bulbs-poll/components/ended.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { PropTypes } from 'react';
import Cover from './cover';
import ResultsList from './results-list';

export default function Ended(props) {
export default function Ended (props) {
let {
poll,
winningAnswers,
Expand Down
6 changes: 3 additions & 3 deletions elements/bulbs-poll/components/ended.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import PollEnded from './ended';
import Cover from './cover';
import ResultsList from './results-list';

describe('<bulbs-poll> <PollEnded>', function() {
context('default', function() {
it('renders', function() {
describe('<bulbs-poll> <PollEnded>', function () {
context('default', function () {
it('renders', function () {
let poll = {};
let winningAnswers = [];
let vote = {};
Expand Down
4 changes: 2 additions & 2 deletions elements/bulbs-poll/components/image-answer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import classnames from 'classnames';
import SelectionMarker from './selection-marker';

export default class ImageAnswer extends React.Component {
selectAnswer() {
selectAnswer () {
this.props.selectAnswer(this.props.answer);
}

render() {
render () {
let {
answer,
selectedAnswer,
Expand Down
14 changes: 7 additions & 7 deletions elements/bulbs-poll/components/image-answer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ import { shallow } from 'enzyme';
import ImageAnswer from './image-answer';
import SelectionMarker from './selection-marker';

describe('<bulbs-poll> <ImageAnswer>', function() {
context('answer is not the selected answer', function() {
it('renders anser as not selected', function() {
describe('<bulbs-poll> <ImageAnswer>', function () {
context('answer is not the selected answer', function () {
it('renders anser as not selected', function () {
let answer = {
answer_text: 'Answer',
id: 1,
answer_image_url: 'www.suckitjerks.com',
};
let otherAnswer = { answer_text: 'Another', id: 2 };
let selectAnswer = function() {};
let selectAnswer = function () {};
let props = {
answer,
selectedAnswer: otherAnswer,
Expand All @@ -37,14 +37,14 @@ describe('<bulbs-poll> <ImageAnswer>', function() {
});
});

context('answer is the selected answer', function() {
it('renders answer as selected', function() {
context('answer is the selected answer', function () {
it('renders answer as selected', function () {
let answer = {
answer_text: 'Answer',
id: 1,
answer_image_url: 'www.suckitjerks.com',
};
let selectAnswer = function() {};
let selectAnswer = function () {};
let props = {
answer,
selectedAnswer: answer,
Expand Down
2 changes: 1 addition & 1 deletion elements/bulbs-poll/components/image-result.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import classnames from 'classnames';
import SelectionMarker from './selection-marker';
import find from 'array-find';

export default function ImageResult(props) {
export default function ImageResult (props) {
let {
answer,
poll,
Expand Down
18 changes: 9 additions & 9 deletions elements/bulbs-poll/components/image-result.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { shallow } from 'enzyme';
import ImageResult from './image-result';
import SelectionMarker from './selection-marker';

describe('<bulbs-poll> <ImageResult>', function() {
context('normal vote', function() {
it('renders plain answer + image', function() {
describe('<bulbs-poll> <ImageResult>', function () {
context('normal vote', function () {
it('renders plain answer + image', function () {
let props = {
answer: {
answer_text: 'the answer',
Expand Down Expand Up @@ -49,8 +49,8 @@ describe('<bulbs-poll> <ImageResult>', function() {
});
});

context('no votes cast', function() {
it('renders 0% vote', function() {
context('no votes cast', function () {
it('renders 0% vote', function () {
let props = {
answer: {
answer_text: 'the answer',
Expand Down Expand Up @@ -92,8 +92,8 @@ describe('<bulbs-poll> <ImageResult>', function() {
)).to.be.true;
});
});
context('winning vote', function() {
it('renders winning answer + image', function() {
context('winning vote', function () {
it('renders winning answer + image', function () {
let props = {
answer: {
answer_text: 'the answer',
Expand Down Expand Up @@ -139,8 +139,8 @@ describe('<bulbs-poll> <ImageResult>', function() {
});
});

context('selected vote', function() {
it('renders answer as selected', function() {
context('selected vote', function () {
it('renders answer as selected', function () {
let props = {
answer: {
answer_text: 'the answer',
Expand Down
2 changes: 1 addition & 1 deletion elements/bulbs-poll/components/loading.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

export default function Loading() {
export default function Loading () {
return (
<div className='bulbs-poll-loading'>
Loading Poll...
Expand Down
6 changes: 3 additions & 3 deletions elements/bulbs-poll/components/loading.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { shallow } from 'enzyme';

import Loading from './loading';

describe('<bulbs-poll> <Loading>', function() {
context('default', function() {
it('renders', function() {
describe('<bulbs-poll> <Loading>', function () {
context('default', function () {
it('renders', function () {
expect(shallow(<Loading/>).equals(
<div className='bulbs-poll-loading'>
Loading Poll...
Expand Down
2 changes: 1 addition & 1 deletion elements/bulbs-poll/components/question.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Answers from './answers';
import VoteButton from './vote-button';
import RequestError from './request-error';

export default function Question(props) {
export default function Question (props) {
let {
selectAnswer,
makeVoteRequest,
Expand Down
Loading

0 comments on commit c07e191

Please sign in to comment.