Skip to content

Commit

Permalink
[Dev Deps] update babel-cli, babel-core, babel-eslint, `babel-r…
Browse files Browse the repository at this point in the history
…egister`, `coveralls`, `eslint`, `eslint-config-airbnb`, `eslint-plugin-import`, `eslint-plugin-jsx-a11y`, `eslint-plugin-react`, `rimraf`, `sinon`, `mocha`

 - Fix linter errors
  • Loading branch information
ljharb committed Aug 6, 2016
1 parent b75b32a commit 29757cb
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 43 deletions.
26 changes: 13 additions & 13 deletions package.json
Expand Up @@ -59,29 +59,29 @@
"object.values": "^1.0.3"
},
"devDependencies": {
"babel-cli": "^6.10.1",
"babel-core": "^6.10.4",
"babel-eslint": "^6.1.0",
"babel-cli": "^6.11.4",
"babel-core": "^6.13.2",
"babel-eslint": "^6.1.2",
"babel-preset-airbnb": "^2.0.0",
"babel-register": "^6.9.0",
"babel-register": "^6.11.6",
"chai": "^3.5.0",
"coveralls": "^2.11.9",
"coveralls": "^2.11.12",
"enzyme-example-jest": "^0.1.0",
"enzyme-example-karma": "^0.1.1",
"enzyme-example-karma-webpack": "^0.1.4",
"enzyme-example-mocha": "^0.1.0",
"enzyme-example-react-native": "^0.1.0",
"eslint": "^2.13.1",
"eslint-config-airbnb": "^9.0.1",
"eslint-plugin-import": "^1.10.0",
"eslint-plugin-jsx-a11y": "^1.5.3",
"eslint-plugin-react": "^5.2.2",
"eslint": "^3.2.2",
"eslint-config-airbnb": "^10.0.0",
"eslint-plugin-import": "^1.12.0",
"eslint-plugin-jsx-a11y": "^2.0.1",
"eslint-plugin-react": "^6.0.0",
"gitbook-cli": "^1.0.1",
"istanbul": "^1.0.0-alpha.2",
"jsdom": "^6.1.0",
"mocha": "^2.5.3",
"rimraf": "^2.5.2",
"sinon": "^1.17.4"
"mocha": "^3.0.1",
"rimraf": "^2.5.4",
"sinon": "^1.17.5"
},
"peerDependencies": {
"react": "0.13.x || 0.14.x || ^15.0.0-0"
Expand Down
3 changes: 2 additions & 1 deletion src/ReactWrapper.jsx
@@ -1,9 +1,10 @@
import React from 'react';
import ComplexSelector from './ComplexSelector';
import cheerio from 'cheerio';
import flatten from 'lodash/flatten';
import unique from 'lodash/uniq';
import compact from 'lodash/compact';

import ComplexSelector from './ComplexSelector';
import createWrapperComponent from './ReactWrapperComponent';
import {
instHasClassName,
Expand Down
4 changes: 2 additions & 2 deletions src/ShallowTraversal.js
Expand Up @@ -69,7 +69,7 @@ export function pathToNode(node, root) {
// leaf node. if it isn't the node we are looking for, we pop.
path.pop();
}
queue.push.apply(queue, children);
queue.push(...children);
}

return null;
Expand Down Expand Up @@ -101,7 +101,7 @@ export function nodeHasProperty(node, propKey, stringifiedPropValue) {
return nodePropValue === propValue;
}

return nodeProps.hasOwnProperty(propKey);
return Object.prototype.hasOwnProperty.call(nodeProps, propKey);
}

export function nodeMatchesObjectProps(node, props) {
Expand Down
3 changes: 2 additions & 1 deletion src/ShallowWrapper.js
@@ -1,9 +1,10 @@
import React from 'react';
import ComplexSelector from './ComplexSelector';
import flatten from 'lodash/flatten';
import unique from 'lodash/uniq';
import compact from 'lodash/compact';
import cheerio from 'cheerio';

import ComplexSelector from './ComplexSelector';
import {
nodeEqual,
containsChildrenSubArray,
Expand Down
9 changes: 7 additions & 2 deletions src/react-compat.js
Expand Up @@ -2,11 +2,12 @@
global-require: 0,
import/no-mutable-exports: 0,
import/no-unresolved: 0,
react/no-deprecated: 0
react/no-deprecated: 0,
react/no-render-return-value: 0,
*/

import { REACT013 } from './version';
import objectAssign from 'object.assign';
import { REACT013 } from './version';

let TestUtils;
let createShallowRenderer;
Expand Down Expand Up @@ -71,6 +72,7 @@ if (REACT013) {
let ReactDOM;

try {
// eslint-disable-next-line import/no-extraneous-dependencies
ReactDOM = require('react-dom');
} catch (e) {
// eslint-disable-next-line no-console
Expand All @@ -82,7 +84,9 @@ if (REACT013) {
throw e;
}

// eslint-disable-next-line import/no-extraneous-dependencies
renderToStaticMarkup = require('react-dom/server').renderToStaticMarkup;

findDOMNode = ReactDOM.findDOMNode;
unmountComponentAtNode = ReactDOM.unmountComponentAtNode;
batchedUpdates = ReactDOM.unstable_batchedUpdates;
Expand All @@ -91,6 +95,7 @@ if (REACT013) {
// to list this as a dependency in package.json and have 0.13 work properly.
// As a result, right now this is basically an implicit dependency.
try {
// eslint-disable-next-line import/no-extraneous-dependencies
TestUtils = require('react-addons-test-utils');
} catch (e) {
// eslint-disable-next-line no-console
Expand Down
2 changes: 1 addition & 1 deletion src/render.js
@@ -1,5 +1,5 @@
import { renderToStaticMarkup } from './react-compat';
import cheerio from 'cheerio';
import { renderToStaticMarkup } from './react-compat';

/**
* Renders a react component into static HTML and provides a cheerio wrapper around it. This is
Expand Down
1 change: 1 addition & 0 deletions src/version.js
@@ -1,4 +1,5 @@
import React from 'react';

export const VERSION = React.version;
export const REACT013 = VERSION.slice(0, 4) === '0.13';
export const REACT014 = VERSION.slice(0, 4) === '0.14';
Expand Down
1 change: 1 addition & 0 deletions test/.eslintrc
Expand Up @@ -7,6 +7,7 @@
"react/prefer-es6-class": 0,
"react/prefer-stateless-function": 0,
"react/prop-types": 0,
"react/no-string-refs": 0,
"import/no-extraneous-dependencies": [2, {
"devDependencies": true
}],
Expand Down
15 changes: 8 additions & 7 deletions test/ComplexSelector-spec.jsx
@@ -1,6 +1,7 @@
import { describeWithDOM } from './_helpers';
import React from 'react';
import { expect } from 'chai';

import { describeWithDOM } from './_helpers';
import {
mount,
shallow,
Expand Down Expand Up @@ -29,7 +30,7 @@ describe('ComplexSelector', () => {
<span>inside top div</span>
</div>

<div className="bottom-div"></div>
<div className="bottom-div" />
<span />
</div>
);
Expand All @@ -42,14 +43,14 @@ describe('ComplexSelector', () => {
const wrapper = renderMethod(
<div>
<div className="my-div">
<h1 />
<h1>heading</h1>
<div>
<div className="my-div">
<h1 />
<h1>heading</h1>
</div>
</div>
</div>
<h1 />
<h1>heading</h1>
</div>
);

Expand All @@ -64,12 +65,12 @@ describe('ComplexSelector', () => {
<div className="inner">
<span>
<div className="way-inner">
<h1 />
<h1>heading</h1>
</div>
</span>
</div>
</div>
<h1 />
<h1>heading</h1>
</div>
);

Expand Down
15 changes: 9 additions & 6 deletions test/ReactWrapper-spec.jsx
@@ -1,18 +1,21 @@
/* globals document */

import React from 'react';
import { expect } from 'chai';
import sinon from 'sinon';

import {
describeWithDOM,
describeIf,
itIf,
itWithData,
generateEmptyRenderData,
} from './_helpers';
import React from 'react';
import { expect } from 'chai';
import {
mount,
render,
ReactWrapper,
} from '../src/';
import sinon from 'sinon';
} from '../src';
import { REACT013, REACT15 } from '../src/version';

describeWithDOM('mount', () => {
Expand Down Expand Up @@ -1751,7 +1754,7 @@ describeWithDOM('mount', () => {
render() {
return (
<div>
<span className="foo"></span>
<span className="foo" />
{this.props.items.map(x => x)}
</div>
);
Expand Down Expand Up @@ -1789,7 +1792,7 @@ describeWithDOM('mount', () => {
it('should handle mixed children with and without arrays', () => {
const Foo = (props) => (
<div>
<span className="foo"></span>
<span className="foo" />
{props.items.map(x => x)}
</div>
);
Expand Down
8 changes: 4 additions & 4 deletions test/ShallowTraversal-spec.jsx
Expand Up @@ -225,13 +225,13 @@ describe('ShallowTraversal', () => {

describe('pathToNode', () => {
it('should return trees from the root node', () => {
const node = <label />;
const node = <label htmlFor="foo" />;
const tree = (
<div>
<button />
<nav>
{node}
<input />
<input id="foo" />
</nav>
</div>
);
Expand All @@ -243,13 +243,13 @@ describe('ShallowTraversal', () => {
});

it('should return trees from the root node except the sibling node', () => {
const node = <label />;
const node = <label htmlFor="foo" />;
const tree = (
<div>
<button />
<nav>
{node}
<div><input /></div>
<div><input id="foo" /></div>
</nav>
</div>
);
Expand Down
14 changes: 8 additions & 6 deletions test/ShallowWrapper-spec.jsx
@@ -1,7 +1,8 @@
import React from 'react';
import { expect } from 'chai';
import { shallow, render, ShallowWrapper } from '../src/';
import sinon from 'sinon';

import { shallow, render, ShallowWrapper } from '../src/';
import { describeIf, itIf, itWithData, generateEmptyRenderData } from './_helpers';
import { REACT013, REACT15 } from '../src/version';

Expand Down Expand Up @@ -222,7 +223,7 @@ describe('shallow', () => {
});

it('should throw on invalid argument', () => {
const wrapper = shallow(<div></div>);
const wrapper = shallow(<div />);

expect(() => wrapper.contains({})).to.throw(
Error,
Expand Down Expand Up @@ -377,8 +378,8 @@ describe('shallow', () => {
<div>
<input className="foo" />
<button className="bar">Button</button>
<textarea className="magic"></textarea>
<select className="reality"></select>
<textarea className="magic" />
<select className="reality" />
</div>
);
expect(wrapper.find('input').props().className).to.equal('foo');
Expand Down Expand Up @@ -509,6 +510,7 @@ describe('shallow', () => {

it('should not find key or ref via property selector', () => {
const arrayOfComponents = [<div key="1" />, <div key="2" />];

const wrapper = shallow(
<div>
<div ref="foo" />
Expand Down Expand Up @@ -1609,7 +1611,7 @@ describe('shallow', () => {
render() {
return (
<div>
<span className="foo"></span>
<span className="foo" />
{this.props.items.map(x => x)}
</div>
);
Expand Down Expand Up @@ -1647,7 +1649,7 @@ describe('shallow', () => {
it('should handle mixed children with and without arrays', () => {
const Foo = (props) => (
<div>
<span className="foo"></span>
<span className="foo" />
{props.items.map(x => x)}
</div>
);
Expand Down

0 comments on commit 29757cb

Please sign in to comment.