Skip to content

Commit

Permalink
fix eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
sbertal committed Sep 27, 2018
1 parent cd253e1 commit e7b877a
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module.exports = {
"env": {
"browser": true,
"es6": true,
"mocha": true,
"node": true
},
"extends": ["eslint:recommended", "plugin:react/recommended"],
Expand Down
2 changes: 1 addition & 1 deletion packages/fluxible-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"pretest": "npm run dist",
"test": "../../node_modules/.bin/mocha tests/unit/ --opts ../../mocha.opts",
"cover": "BABEL_ENV=test ../../node_modules/.bin/nyc ../../node_modules/.bin/_mocha tests/unit/ --opts ../../mocha.opts",
"lint": "../../node_modules/.bin/eslint *.js */*.js"
"lint": "../../node_modules/.bin/eslint **/*.js"
},
"author": "Lingyan Zhu <[email protected]>",
"licenses": [
Expand Down
8 changes: 8 additions & 0 deletions packages/fluxible-router/tests/mocks/MockAppComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ var MockAppComponent = createReactClass({
contextTypes: {
getStore: PropTypes.func.isRequired
},
propTypes: {
children: PropTypes.object,
currentRoute: PropTypes.object
},
render: function () {
if (!this.props.children) {
return null;
Expand Down Expand Up @@ -42,6 +46,10 @@ module.exports.createDecoratedMockAppComponent = function createDecoratedMockApp
static contextTypes = {
getStore: PropTypes.func.isRequired
};
static propTypes = {
children: PropTypes.object,
currentRoute: PropTypes.object
};
constructor(props, context) {
super(props, context);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright 2015, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
/*globals describe,it,before,beforeEach */

var HistoryWithHash = require('../../../dist/addons/HistoryWithHash'),
expect = require('chai').expect,
_ = require('lodash'),
Expand Down
2 changes: 1 addition & 1 deletion packages/fluxible-router/tests/unit/lib/History-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright 2015, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
/*globals describe,it,before,beforeEach */

var History = require('../../../dist/lib/History'),
expect = require('chai').expect,
_ = require('lodash'),
Expand Down
10 changes: 5 additions & 5 deletions packages/fluxible-router/tests/unit/lib/NavLink-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright 2015, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
/*globals describe,it,before,beforeEach */
/* eslint react/no-find-dom-node:0 */

var JSDOM = require('jsdom').JSDOM;
var expect = require('chai').expect;
Expand Down Expand Up @@ -265,9 +265,9 @@ describe('NavLink', function () {
};
var navParams = {a: 1, b: true};
var link = ReactTestUtils.renderIntoDocument(
<MockAppComponent context={mockContext} onClick={propagateFail}>
<NavLink href='/foo' stopPropagation={true} navParams={navParams} />
</MockAppComponent>
<MockAppComponent context={mockContext} onClick={propagateFail}>
<NavLink href='/foo' stopPropagation={true} navParams={navParams} />
</MockAppComponent>
);
ReactTestUtils.Simulate.click(ReactDOM.findDOMNode(link), {button: 0});
window.setTimeout(function () {
Expand Down Expand Up @@ -622,7 +622,7 @@ describe('NavLink', function () {
<MockAppComponent context={mockContext}>
<NavLink href='/foo' activeClass='active' />
</MockAppComponent>
, div);
, div);
var routeStore = mockContext.getStore('RouteStore');
expect(routeStore.listeners('change').length).to.equal(2);
ReactDOM.unmountComponentAtNode(div);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
* Copyright 2015, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
/*globals describe,it,before,beforeEach,afterEach,window,document,navigator */

var expect = require('chai').expect;
var JSDOM = require('jsdom').JSDOM;
var PropTypes = require('prop-types');
var React;
var ReactDOM;
var createReactClass;
Expand Down Expand Up @@ -161,6 +162,9 @@ describe('handleHistory', function () {
routeStore._handleNavigateStart({url: '/foo', method: 'GET'});
var Child = createReactClass({
displayName: 'Child',
propTypes: {
currentRoute: PropTypes.object
},
render: function () {
rendered = true;
expect(this.props.currentRoute).to.be.an('object');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright 2015, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
/*globals describe,it,before,beforeEach,afterEach,window,document,navigator */

var expect = require('chai').expect;
var JSDOM = require('jsdom').JSDOM;
var React;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright 2015, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
/*globals describe,it,before,beforeEach */

var expect = require('chai').expect;
var navigateAction = require('../../../dist/lib/navigateAction');
var createMockActionContext = require('fluxible/utils/createMockActionContext');
Expand Down

0 comments on commit e7b877a

Please sign in to comment.