Skip to content

Commit b9eaba1

Browse files
committed
Fix all JSHint warnings in examples
1 parent 332a3a9 commit b9eaba1

File tree

9 files changed

+17
-18
lines changed

9 files changed

+17
-18
lines changed

examples/auth-flow/app.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,19 +128,19 @@ var Logout = React.createClass({
128128

129129
var auth = {
130130
login: function (email, pass, cb) {
131-
var cb = arguments[arguments.length - 1];
131+
cb = arguments[arguments.length - 1];
132132
if (localStorage.token) {
133-
cb && cb(true);
133+
if (cb) cb(true);
134134
this.onChange(true);
135135
return;
136136
}
137137
pretendRequest(email, pass, function (res) {
138138
if (res.authenticated) {
139139
localStorage.token = res.token;
140-
cb && cb(true);
140+
if (cb) cb(true);
141141
this.onChange(true);
142142
} else {
143-
cb && cb(false);
143+
if (cb) cb(false);
144144
this.onChange(false);
145145
}
146146
}.bind(this));
@@ -152,7 +152,7 @@ var auth = {
152152

153153
logout: function (cb) {
154154
delete localStorage.token;
155-
cb && cb();
155+
if (cb) cb();
156156
this.onChange(false);
157157
},
158158

examples/data-flow/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var App = React.createClass({
3333

3434
render: function () {
3535
var links = this.state.tacos.map(function (taco) {
36-
return <li><Link to="taco" params={taco}>{taco.name}</Link></li>
36+
return <li><Link to="taco" params={taco}>{taco.name}</Link></li>;
3737
});
3838
return (
3939
<div className="App">

examples/dynamic-segments/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,5 @@ var routes = (
5959
);
6060

6161
Router.run(routes, function (Handler) {
62-
React.render(<Handler/>, document.getElementById('example'))
62+
React.render(<Handler/>, document.getElementById('example'));
6363
});

examples/master-detail/app.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var App = React.createClass({
4141

4242
render: function () {
4343
var contacts = this.state.contacts.map(function (contact) {
44-
return <li key={contact.id}><Link to="contact" params={contact}>{contact.first}</Link></li>
44+
return <li key={contact.id}><Link to="contact" params={contact}>{contact.first}</Link></li>;
4545
});
4646
return (
4747
<div className="App">
@@ -71,7 +71,7 @@ var Contact = React.createClass({
7171
mixins: [ Router.Navigation, Router.State ],
7272

7373
getStateFromStore: function (id) {
74-
var id = this.getParams().id;
74+
id = this.getParams().id;
7575
return {
7676
contact: ContactStore.getContact(id)
7777
};
@@ -97,7 +97,7 @@ var Contact = React.createClass({
9797
if (!this.isMounted())
9898
return;
9999

100-
this.setState(this.getStateFromStore())
100+
this.setState(this.getStateFromStore());
101101
},
102102

103103
destroy: function () {

examples/partial-app-loading/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ var PreDashboard = React.createClass({
3535
mixins: [ AsyncElement ],
3636
bundle: require('bundle?lazy!./dashboard.js'),
3737
preRender: function () {
38-
return <div>Loading dashboard...</div>
38+
return <div>Loading dashboard...</div>;
3939
}
4040
});
4141

4242
var PreInbox = React.createClass({
4343
mixins: [ AsyncElement ],
4444
bundle: require('bundle?lazy!./inbox.js'),
4545
preRender: function () {
46-
return <div>Loading inbox...</div>
46+
return <div>Loading inbox...</div>;
4747
}
4848
});
4949

examples/rx/app.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var React = require('react');
22
var Router = require('react-router');
3-
var { Route, Redirect, RouteHandler, Link } = Router;
3+
var { Route, RouteHandler, Link } = Router;
44
var Rx = require('rx');
55

66
var App = React.createClass({
@@ -41,6 +41,5 @@ var source = Rx.Observable.fromEventPattern(function(h) {
4141
});
4242

4343
source.subscribe(function (Handler) {
44-
React.render(<Handler/>, document.getElementById('example'))
44+
React.render(<Handler/>, document.getElementById('example'));
4545
});
46-

examples/simple-master-detail/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var { Route, DefaultRoute, RouteHandler, Link } = Router;
44

55
var App = React.createClass({
66
getInitialState: function () {
7-
return { states: findStates() }
7+
return { states: findStates() };
88
},
99

1010
render: function () {

examples/transitions/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var Home = React.createClass({
2424

2525
var Dashboard = React.createClass({
2626
render: function () {
27-
return <h1>Dashboard</h1>
27+
return <h1>Dashboard</h1>;
2828
}
2929
});
3030

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"scripts": {
1616
"test": "scripts/test --browsers Firefox --single-run",
17-
"lint": "jsxhint modules"
17+
"lint": "jsxhint examples modules"
1818
},
1919
"authors": [
2020
"Ryan Florence",

0 commit comments

Comments
 (0)