Skip to content

Commit

Permalink
Turn on 'consistent-return'
Browse files Browse the repository at this point in the history
  • Loading branch information
darthtrevino committed Jan 25, 2017
1 parent b128097 commit f8fc637
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"react/react-in-jsx-scope": 2,
"react/jsx-filename-extension": "off",
"react/sort-comp": "off",
"class-methods-use-this": "off",
"consistent-return": "off"
"class-methods-use-this": "off"
}
}
5 changes: 2 additions & 3 deletions examples/00 Chessboard/Tutorial App/Board.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ export default class Board extends Component {

renderPiece(x, y) {
const [knightX, knightY] = this.props.knightPosition;
if (x === knightX && y === knightY) {
return <Knight />;
}
const isKnightHere = x === knightX && y === knightY;
return isKnightHere ? <Knight /> : null;
}

render() {
Expand Down
2 changes: 1 addition & 1 deletion src/createTargetFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default function createTargetFactory(spec) {

drop() {
if (!spec.drop) {
return;
return undefined;
}

const dropResult = spec.drop(this.props, this.monitor, this.component);
Expand Down
2 changes: 1 addition & 1 deletion src/wrapConnectorHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function wrapHookToRecognizeElement(hook) {
if (!isValidElement(elementOrNode)) {
const node = elementOrNode;
hook(node, options);
return;
return undefined;
}

// If passed a ReactElement, clone it and attach this function as a ref.
Expand Down

0 comments on commit f8fc637

Please sign in to comment.