From 26bcfe6e0eab02e92b14bef9662cdbdd21fce5ac Mon Sep 17 00:00:00 2001 From: greenkeeperio-bot Date: Mon, 4 Jan 2016 22:35:44 +0000 Subject: [PATCH 1/3] chore(package): update eslint-config-airbnb to version 3.0.0 http://greenkeeper.io/ --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 570be8f..c81eea4 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "babel-preset-react": "6.3.13", "coveralls": "2.11.6", "eslint": "1.10.3", - "eslint-config-airbnb": "2.1.1", + "eslint-config-airbnb": "3.0.0", "eslint-plugin-react": "3.14.0", "istanbul": "0.4.1", "mocha": "2.3.4", From f4676818f22b9173218697b8de4e47f8d537abb0 Mon Sep 17 00:00:00 2001 From: Craig Bilner Date: Fri, 8 Jan 2016 20:44:36 +0000 Subject: [PATCH 2/3] Lint files --- src/index.js | 15 ++++++++++----- tests/components/stamp/stamp-smart.js | 4 +++- tests/index.js | 15 ++++++++++----- tests/stand-alone/link-list/link-list.js | 10 +++++++--- .../stand-alone/unordered-list/unordered-list.js | 12 ++++++++++-- tests/webpack.config.test.js | 2 +- 6 files changed, 41 insertions(+), 17 deletions(-) diff --git a/src/index.js b/src/index.js index 5103dc1..091995b 100644 --- a/src/index.js +++ b/src/index.js @@ -57,14 +57,15 @@ const flavourComponent = stampit() /* eslint-disable no-use-before-define */ const reduceChildren = function (parentComponent, reactClass, parentIndx, childMap, child, indx) { + const thisMap = _.assign({}, childMap); const childIsElement = TestUtils.isElement(child); const id = parseInt(parentIndx, 10) >= 0 ? parentIndx + '.' + indx : indx; if (childIsElement) { - childMap[id] = flavourComponent(_.assign({}, child, { parentComponent, reactClass })); + thisMap[id] = flavourComponent(_.assign({}, child, { parentComponent, reactClass })); _.assign( - childMap, + thisMap, convertAndReduce( parentComponent, reactClass, @@ -73,12 +74,12 @@ const reduceChildren = ) ); } else { - childMap[id] = { + thisMap[id] = { value: child, }; } - return childMap; + return thisMap; }; /* eslint-enable no-use-before-define */ @@ -114,7 +115,11 @@ const flavourInit = function (opts) { } this.type = output.type; - this.childMap = convertAndReduce(this.component, opts.instance.reactClass, output.props.children); + this.childMap = convertAndReduce( + this.component, + opts.instance.reactClass, + output.props.children + ); } else { this.type = output; this.childMap = []; diff --git a/tests/components/stamp/stamp-smart.js b/tests/components/stamp/stamp-smart.js index 3118b42..a807192 100644 --- a/tests/components/stamp/stamp-smart.js +++ b/tests/components/stamp/stamp-smart.js @@ -11,6 +11,8 @@ export default class StampSmartComponent extends Component { this.state = props.state || { type: stampTypes.NONE, }; + + this.handleOnClick = this.handleOnClick.bind(this); } getNextStampType(types, currentType) { @@ -44,7 +46,7 @@ export default class StampSmartComponent extends Component { ); } diff --git a/tests/index.js b/tests/index.js index 00c677d..603f329 100644 --- a/tests/index.js +++ b/tests/index.js @@ -3,11 +3,16 @@ import ReactDOM from 'react-dom'; import App from './components/app/app'; const comingFrom = 'Welcome from some sort of React holiday'; -const message = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec commodo venenatis tortor, ' + - 'in viverra libero ullamcorper quis. Nam blandit volutpat ante sit amet sagittis. Cras ultrices augue sem, ' + - 'id congue felis efficitur a. Mauris luctus, nisl eu dignissim molestie, sem libero fringilla ex, ' + - 'id faucibus ligula justo et nibh. Donec posuere rhoncus leo eget fringilla. Nulla ex arcu, ' + - 'gravida nec malesuada sit amet, faucibus ut lectus. Donec elementum sapien a lorem tristique egestas. ' + +const message = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. ' + + 'Donec commodo venenatis tortor, ' + + 'in viverra libero ullamcorper quis. Nam blandit volutpat ante sit amet sagittis. ' + + 'Cras ultrices augue sem, ' + + 'id congue felis efficitur a. Mauris luctus, nisl eu dignissim molestie, ' + + 'sem libero fringilla ex, ' + + 'id faucibus ligula justo et nibh. Donec posuere rhoncus leo eget fringilla. ' + + 'Nulla ex arcu, ' + + 'gravida nec malesuada sit amet, faucibus ut lectus. ' + + 'Donec elementum sapien a lorem tristique egestas. ' + 'Etiam a orci tincidunt, interdum leo blandit, consequat risus.'; const signature = 'John Smith'; const addressee = 'Mrs. Joanne Bloggs'; diff --git a/tests/stand-alone/link-list/link-list.js b/tests/stand-alone/link-list/link-list.js index 2176396..16e5b05 100644 --- a/tests/stand-alone/link-list/link-list.js +++ b/tests/stand-alone/link-list/link-list.js @@ -4,6 +4,10 @@ import Link from './link'; export default class LinkListComponent extends Component { constructor(props) { super(props); + + this.handleLink1Click = this.handleLink1Click.bind(this); + this.handleLink2Click = this.handleLink1Click.bind(this); + this.handleLink3Click = this.handleLink1Click.bind(this); } handleLink1Click() { @@ -22,13 +26,13 @@ export default class LinkListComponent extends Component { const { links } = this.props; return (
    -
  • +
  • -
  • +
  • -
  • +
diff --git a/tests/stand-alone/unordered-list/unordered-list.js b/tests/stand-alone/unordered-list/unordered-list.js index 1e55793..d1b0393 100644 --- a/tests/stand-alone/unordered-list/unordered-list.js +++ b/tests/stand-alone/unordered-list/unordered-list.js @@ -36,13 +36,21 @@ export default class UnorderedListComponent extends Component { } render() { - const { i18n = {}, links = [], rlinks = [], drlinkssrc = [], randomString = '', email = '' } = this.props; + const { + i18n = {}, + links = [], + rlinks = [], + drlinkssrc = [], + randomString = '', + email = '', + } = this.props; const drlinks = email ? this.getDrlinks(i18n, email, drlinkssrc, randomString) : []; return (