Skip to content

Commit

Permalink
[*] [dev deps] update eslint-plugin-react, eslint-plugin-import
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed May 5, 2019
1 parent a9bff0b commit 464c6cb
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 68 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@
"coveralls": "^2.13.3",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-markdown": "^1.0.0",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react": "^7.13.0",
"gitbook-cli": "^1.0.1",
"gitbook-plugin-anchors": "^0.7.1",
"gitbook-plugin-codeblock-disable-glossary": "0.0.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/enzyme-adapter-react-13/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
"enzyme": "^3.0.0",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react": "^7.13.0",
"in-publish": "^2.0.0",
"rimraf": "^2.6.3",
"safe-publish-latest": "^1.1.2"
Expand Down
4 changes: 2 additions & 2 deletions packages/enzyme-adapter-react-14/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
"enzyme": "^3.0.0",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react": "^7.13.0",
"in-publish": "^2.0.0",
"rimraf": "^2.6.3",
"safe-publish-latest": "^1.1.2"
Expand Down
4 changes: 2 additions & 2 deletions packages/enzyme-adapter-react-15.4/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
"enzyme": "^3.0.0",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react": "^7.13.0",
"in-publish": "^2.0.0",
"rimraf": "^2.6.3",
"safe-publish-latest": "^1.1.2"
Expand Down
4 changes: 2 additions & 2 deletions packages/enzyme-adapter-react-15/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
"enzyme": "^3.0.0",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react": "^7.13.0",
"in-publish": "^2.0.0",
"rimraf": "^2.6.3",
"safe-publish-latest": "^1.1.2"
Expand Down
4 changes: 2 additions & 2 deletions packages/enzyme-adapter-react-16.1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
"enzyme": "^3.0.0",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react": "^7.13.0",
"in-publish": "^2.0.0",
"rimraf": "^2.6.3",
"safe-publish-latest": "^1.1.2"
Expand Down
4 changes: 2 additions & 2 deletions packages/enzyme-adapter-react-16.2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
"enzyme": "^3.0.0",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react": "^7.13.0",
"in-publish": "^2.0.0",
"rimraf": "^2.6.3",
"safe-publish-latest": "^1.1.2"
Expand Down
4 changes: 2 additions & 2 deletions packages/enzyme-adapter-react-16.3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
"enzyme": "^3.0.0",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react": "^7.13.0",
"in-publish": "^2.0.0",
"rimraf": "^2.6.3",
"safe-publish-latest": "^1.1.2"
Expand Down
4 changes: 2 additions & 2 deletions packages/enzyme-adapter-react-16/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
"enzyme": "^3.0.0",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react": "^7.13.0",
"in-publish": "^2.0.0",
"rimraf": "^2.6.3",
"safe-publish-latest": "^1.1.2"
Expand Down
4 changes: 2 additions & 2 deletions packages/enzyme-adapter-react-helper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
"enzyme": "^3.0.0",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react": "^7.13.0",
"in-publish": "^2.0.0",
"react": "0.13.x || 0.14.x || ^15.0.0-0 || ^16.0.0-0 || ^16.3.0-0 || ^16.4.0-0",
"safe-publish-latest": "^1.1.2"
Expand Down
4 changes: 2 additions & 2 deletions packages/enzyme-adapter-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
"babel-preset-airbnb": "^2.6.0",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react": "^7.13.0",
"in-publish": "^2.0.0",
"rimraf": "^2.6.3",
"safe-publish-latest": "^1.1.2"
Expand Down
4 changes: 2 additions & 2 deletions packages/enzyme-example-mocha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"babel-register": "^6.26.0",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react": "^7.13.0",
"in-publish": "^2.0.0",
"jsdom": "^11.5.1",
"mocha": "^3.5.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/enzyme-test-suite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
"devDependencies": {
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-mocha": "^5.3.0",
"eslint-plugin-react": "^7.12.4"
"eslint-plugin-react": "^7.13.0"
}
}
66 changes: 26 additions & 40 deletions packages/enzyme-test-suite/test/Adapter-spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ function cleanNode(node) {
}

describe('Adapter', () => {
class RendersNull extends React.Component {
render() {
return null;
}
}

describe('error message', () => {
afterEach(() => {
configure({ adapter });
Expand Down Expand Up @@ -143,12 +149,17 @@ describe('Adapter', () => {
expect(prettyFormat(nodeA)).to.equal(prettyFormat(nodeB));
}

/* eslint react/destructuring-assignment: 0 */
class BamBam extends React.Component {
render() { return (<div>{this.props.children}</div>); }
render() {
const { children } = this.props;
return (<div>{children}</div>);
}
}
class FooBar extends React.Component {
render() { return (<BamBam>{this.props.children}</BamBam>); }
render() {
const { children } = this.props;
return (<BamBam>{children}</BamBam>);
}
}
class One extends React.Component {
render() { return (<FooBar><span><FooBar /></span></FooBar>); }
Expand Down Expand Up @@ -180,9 +191,7 @@ describe('Adapter', () => {
it('treats mixed children correctly', () => {
class Foo extends React.Component {
render() {
return (
<div>hello{4}{'world'}</div>
);
return (<div>hello{4}{'world'}</div>);
}
}

Expand Down Expand Up @@ -219,24 +228,18 @@ describe('Adapter', () => {
});

it('treats null renders correctly', () => {
class Foo extends React.Component {
render() {
return null;
}
}

const options = { mode: 'mount' };
const renderer = adapter.createRenderer(options);

renderer.render(<Foo />);
renderer.render(<RendersNull />);

const node = renderer.getNode();

cleanNode(node);

expect(prettyFormat(node)).to.equal(prettyFormat({
nodeType: 'class',
type: Foo,
type: RendersNull,
props: {},
key: undefined,
ref: null,
Expand Down Expand Up @@ -417,23 +420,17 @@ describe('Adapter', () => {
const options = { mode: 'mount' };
const renderer = adapter.createRenderer(options);

class Foo extends React.Component {
render() {
return null;
}
}

renderer.render(<Foo />);
renderer.render(<RendersNull />);

const node = renderer.getNode();

expect(node.instance).to.be.instanceof(Foo);
expect(node.instance).to.be.instanceof(RendersNull);

cleanNode(node);

expect(prettyFormat(node)).to.equal(prettyFormat({
nodeType: 'class',
type: Foo,
type: RendersNull,
props: {},
key: undefined,
ref: null,
Expand Down Expand Up @@ -675,12 +672,6 @@ describe('Adapter', () => {
});

it('render node with updated props', () => {
class Dummy extends React.Component {
render() {
return null;
}
}

class Counter extends React.Component {
constructor(props) {
super(props);
Expand All @@ -692,7 +683,7 @@ describe('Adapter', () => {
}

render() {
return <Dummy {...this.state} />;
return <RendersNull {...this.state} />;
}
}

Expand All @@ -712,21 +703,19 @@ describe('Adapter', () => {
});

it('renders basic shallow as well', () => {
// eslint-disable-next-line react/require-render-return
class Bar extends React.Component {
constructor(props) {
super(props);
throw new Error('Bar constructor should not be called');
}

render() {
render() { // eslint-disable-line react/require-render-return
throw new Error('Bar render method should not be called');
}
}

// eslint-disable-next-line react/require-render-return
class Foo extends React.Component {
render() {
render() { // eslint-disable-line react/require-render-return
throw new Error('Foo render method should not be called');
}
}
Expand Down Expand Up @@ -801,14 +790,13 @@ describe('Adapter', () => {
});

it('does not erroneously add a key when refs are present', () => {
// eslint-disable-next-line react/require-render-return
class Inner extends React.Component {
constructor(props) {
super(props);
throw new Error('Inner constructor should not be called');
}

render() {
render() { // eslint-disable-line react/require-render-return
throw new Error('Inner render method should not be called');
}
}
Expand Down Expand Up @@ -857,14 +845,13 @@ describe('Adapter', () => {
});

it('adds keys correctly to elements that have them', () => {
// eslint-disable-next-line react/require-render-return
class Inner extends React.Component {
constructor(props) {
super(props);
throw new Error('Inner constructor should not be called');
}

render() {
render() { // eslint-disable-line react/require-render-return
throw new Error('Inner render method should not be called');
}
}
Expand Down Expand Up @@ -904,14 +891,13 @@ describe('Adapter', () => {
});

it('adds null keys to elements correctly', () => {
// eslint-disable-next-line react/require-render-return
class Inner extends React.Component {
constructor(props) {
super(props);
throw new Error('Inner constructor should not be called');
}

render() {
render() { // eslint-disable-line react/require-render-return
throw new Error('Inner render method should not be called');
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/enzyme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@
"babel-preset-airbnb": "^2.6.0",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react": "^7.13.0",
"in-publish": "^2.0.0",
"jsdom": "^6.5.1",
"rimraf": "^2.6.3",
Expand Down

0 comments on commit 464c6cb

Please sign in to comment.