Skip to content

Commit

Permalink
lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lelandrichardson committed Aug 15, 2017
1 parent 3cc005d commit 04c4a67
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
11 changes: 8 additions & 3 deletions docs/future/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ cases.

For example, consider the following example:

<!-- eslint react/prop-types: 0 -->
```js
import React from 'react';
import Icon from './path/to/Icon';
Expand All @@ -71,7 +72,7 @@ const ICONS = {
failure: <Icon name="exclamation-mark" />,
};

const StatusLabel = ({ id, label }) => <div>{ICONS[id]}{label}{ICONS[id]}</div>
const StatusLabel = ({ id, label }) => <div>{ICONS[id]}{label}{ICONS[id]}</div>;
```

```js
Expand Down Expand Up @@ -101,6 +102,7 @@ Enzyme has a `.children()` method which is intended to return the rendered child
When using `mount(...)`, it can sometimes be unclear exactly what this would mean. Consider for
example the following react components:

<!-- eslint react/prop-types: 0, react/prefer-stateless-function: 0 -->
```js
class Box extends React.Component {
render() {
Expand Down Expand Up @@ -147,7 +149,7 @@ class CurrentTime extends React.Component {
this.timer = setTimeout(tick, 0);
}
render() {
return <span>{this.state.now}</span>
return <span>{this.state.now}</span>;
}
}
```
Expand Down Expand Up @@ -271,6 +273,7 @@ return the actual ref, which I believe is more intuitive.

Consider the following simple react component:

<!-- eslint react/no-string-refs: 0 -->
```js
class Box extends React.Component {
render() {
Expand Down Expand Up @@ -301,6 +304,7 @@ expect(wrapper.ref('abc')).toBeInstanceOf(Element);
Similarly, if you have a ref on a composite component, the `ref(...)` method will return an instance
of that element:

<!-- eslint react/no-string-refs: 0 -->
```js
class Bar extends React.Component {
render() {
Expand Down Expand Up @@ -354,9 +358,10 @@ The initially returned wrapper used to be around the element passed
into the `mount` API, and for `shallow` it was around the root node of the rendered output of the element passed in. After the upgrade, the
two APIs are now symmetrical, starting off

<!-- eslint react/prop-types: 0 -->
```js
const x = 'x';
const Foo = props => <div inner={props.outer} />
const Foo = props => <div inner={props.outer} />;
const wrapper = mount(<Foo outer={x} />);
```

Expand Down
1 change: 0 additions & 1 deletion src/Utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint no-use-before-define:0 */
import isEqual from 'lodash/isEqual';
import React from 'react';
import is from 'object-is';
import uuidv4 from 'uuid/v4';
import entries from 'object.entries';
Expand Down
2 changes: 1 addition & 1 deletion src/adapters/ReactThirteenAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
import values from 'object.values';
import EnzymeAdapter from './EnzymeAdapter';
import elementToTree from './elementToTree';
import mapNativeEventNames from './ReactThirteenMapNativeEventNames'
import mapNativeEventNames from './ReactThirteenMapNativeEventNames';
import {
propFromEvent,
withSetStateAllowed,
Expand Down

0 comments on commit 04c4a67

Please sign in to comment.