Skip to content

Commit

Permalink
Fix all JSHint warnings in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
mjackson committed Dec 4, 2014
1 parent 332a3a9 commit b9eaba1
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 18 deletions.
10 changes: 5 additions & 5 deletions examples/auth-flow/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,19 @@ var Logout = React.createClass({

var auth = {
login: function (email, pass, cb) {
var cb = arguments[arguments.length - 1];
cb = arguments[arguments.length - 1];
if (localStorage.token) {
cb && cb(true);
if (cb) cb(true);
this.onChange(true);
return;
}
pretendRequest(email, pass, function (res) {
if (res.authenticated) {
localStorage.token = res.token;
cb && cb(true);
if (cb) cb(true);
this.onChange(true);
} else {
cb && cb(false);
if (cb) cb(false);
this.onChange(false);
}
}.bind(this));
Expand All @@ -152,7 +152,7 @@ var auth = {

logout: function (cb) {
delete localStorage.token;
cb && cb();
if (cb) cb();
this.onChange(false);
},

Expand Down
2 changes: 1 addition & 1 deletion examples/data-flow/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var App = React.createClass({

render: function () {
var links = this.state.tacos.map(function (taco) {
return <li><Link to="taco" params={taco}>{taco.name}</Link></li>
return <li><Link to="taco" params={taco}>{taco.name}</Link></li>;
});
return (
<div className="App">
Expand Down
2 changes: 1 addition & 1 deletion examples/dynamic-segments/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ var routes = (
);

Router.run(routes, function (Handler) {
React.render(<Handler/>, document.getElementById('example'))
React.render(<Handler/>, document.getElementById('example'));
});
6 changes: 3 additions & 3 deletions examples/master-detail/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var App = React.createClass({

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

getStateFromStore: function (id) {
var id = this.getParams().id;
id = this.getParams().id;
return {
contact: ContactStore.getContact(id)
};
Expand All @@ -97,7 +97,7 @@ var Contact = React.createClass({
if (!this.isMounted())
return;

this.setState(this.getStateFromStore())
this.setState(this.getStateFromStore());
},

destroy: function () {
Expand Down
4 changes: 2 additions & 2 deletions examples/partial-app-loading/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ var PreDashboard = React.createClass({
mixins: [ AsyncElement ],
bundle: require('bundle?lazy!./dashboard.js'),
preRender: function () {
return <div>Loading dashboard...</div>
return <div>Loading dashboard...</div>;
}
});

var PreInbox = React.createClass({
mixins: [ AsyncElement ],
bundle: require('bundle?lazy!./inbox.js'),
preRender: function () {
return <div>Loading inbox...</div>
return <div>Loading inbox...</div>;
}
});

Expand Down
5 changes: 2 additions & 3 deletions examples/rx/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var React = require('react');
var Router = require('react-router');
var { Route, Redirect, RouteHandler, Link } = Router;
var { Route, RouteHandler, Link } = Router;
var Rx = require('rx');

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

source.subscribe(function (Handler) {
React.render(<Handler/>, document.getElementById('example'))
React.render(<Handler/>, document.getElementById('example'));
});

2 changes: 1 addition & 1 deletion examples/simple-master-detail/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var { Route, DefaultRoute, RouteHandler, Link } = Router;

var App = React.createClass({
getInitialState: function () {
return { states: findStates() }
return { states: findStates() };
},

render: function () {
Expand Down
2 changes: 1 addition & 1 deletion examples/transitions/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var Home = React.createClass({

var Dashboard = React.createClass({
render: function () {
return <h1>Dashboard</h1>
return <h1>Dashboard</h1>;
}
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"scripts": {
"test": "scripts/test --browsers Firefox --single-run",
"lint": "jsxhint modules"
"lint": "jsxhint examples modules"
},
"authors": [
"Ryan Florence",
Expand Down

0 comments on commit b9eaba1

Please sign in to comment.