Skip to content

Commit

Permalink
Merge pull request #122 from aaronshaf/eslint-cleanup
Browse files Browse the repository at this point in the history
eslint cleanup; trailing comma fix for IE
  • Loading branch information
mjackson committed Jul 25, 2014
2 parents 154c074 + d420439 commit b35a894
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
18 changes: 18 additions & 0 deletions eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"env": {
"browser": true,
"node": true
},
"rules": {
"quotes": 0,
"no-comma-dangle": 2,
"no-underscore-dangle": 0,
"curly": 0,
"strict": 0,
"no-use-before-define": 0,
"no-cond-assign": 0,
"consistent-return": 0,
"new-cap": 0,
"no-unused-vars": 0
}
}
10 changes: 5 additions & 5 deletions modules/components/Route.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
var React = require('react');
var warning = require('react/lib/warning');
var invariant = require('react/lib/invariant');
var ExecutionEnvironment = require('react/lib/ExecutionEnvironment');
var mergeProperties = require('../helpers/mergeProperties');
var goBack = require('../helpers/goBack');
Expand Down Expand Up @@ -34,7 +33,7 @@ var REF_NAME = '__activeRoute__';
/**
* <Route> components specify components that are rendered to the page when the
* URL matches a given pattern.
*
*
* Routes are arranged in a nested tree structure. When a new URL is requested,
* the tree is searched depth-first to find a route whose path matches the URL.
* When one is found, all routes in the tree that lead to it are considered
Expand Down Expand Up @@ -117,7 +116,7 @@ var Route = React.createClass({
location: React.PropTypes.oneOf([ 'hash', 'history' ]).isRequired,
handler: React.PropTypes.any.isRequired,
path: React.PropTypes.string,
name: React.PropTypes.string,
name: React.PropTypes.string
},

getDefaultProps: function () {
Expand Down Expand Up @@ -265,6 +264,7 @@ function Redirect(to, params, query) {

function findMatches(path, route) {
var children = route.props.children, matches;
var params;

// Check the subtree first to find the most deeply-nested match.
if (Array.isArray(children)) {
Expand All @@ -277,7 +277,7 @@ function findMatches(path, route) {

if (matches) {
var rootParams = getRootMatch(matches).params;
var params = {};
params = {};

Path.extractParamNames(route.props.path).forEach(function (paramName) {
params[paramName] = rootParams[paramName];
Expand All @@ -289,7 +289,7 @@ function findMatches(path, route) {
}

// No routes in the subtree matched, so check this route.
var params = Path.extractParams(route.props.path, path);
params = Path.extractParams(route.props.path, path);

if (params)
return [ makeMatch(route, params) ];
Expand Down

0 comments on commit b35a894

Please sign in to comment.