Skip to content

Commit

Permalink
[eslint] enable and autofix semi-style
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed May 19, 2019
1 parent ddd9b22 commit 08e57f8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 14 deletions.
1 change: 0 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"no-case-declarations": 1,
"no-underscore-dangle": 1,
"no-mixed-operators": 1,
"semi-style": 1,
"no-void": 1,
"no-continue": 1,
"no-tabs": 1,
Expand Down
4 changes: 1 addition & 3 deletions lib/rules/no-find-dom-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ module.exports = {

const isfindDOMNode =
(callee.name === 'findDOMNode') ||
(callee.property && callee.property.name === 'findDOMNode')
;

(callee.property && callee.property.name === 'findDOMNode');
if (!isfindDOMNode) {
return;
}
Expand Down
3 changes: 1 addition & 2 deletions lib/rules/prefer-stateless-function.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,7 @@ module.exports = {
const defaultProps = name === 'defaultProps';
const isUselessConstructor =
property.kind === 'constructor' &&
isRedundantSuperCall(property.value.body.body, property.value.params)
;
isRedundantSuperCall(property.value.body.body, property.value.params);
const isRender = name === 'render';
return !isDisplayName && !isPropTypes && !contextTypes && !defaultProps && !isUselessConstructor && !isRender;
});
Expand Down
3 changes: 1 addition & 2 deletions lib/rules/prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ module.exports = {

const isDeclared =
component && component.confidence === 2 &&
_isDeclaredInComponent(component.declaredPropTypes || {}, names)
;
_isDeclaredInComponent(component.declaredPropTypes || {}, names);
if (isDeclared) {
return true;
}
Expand Down
9 changes: 3 additions & 6 deletions lib/util/Components.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,22 +366,19 @@ function componentRule(rule, context) {
const returnsConditionalJSXConsequent =
node[property] &&
node[property].type === 'ConditionalExpression' &&
jsxUtil.isJSX(node[property].consequent)
;
jsxUtil.isJSX(node[property].consequent);
const returnsConditionalJSXAlternate =
node[property] &&
node[property].type === 'ConditionalExpression' &&
jsxUtil.isJSX(node[property].alternate)
;
jsxUtil.isJSX(node[property].alternate);
const returnsConditionalJSX =
strict ?
(returnsConditionalJSXConsequent && returnsConditionalJSXAlternate) :
(returnsConditionalJSXConsequent || returnsConditionalJSXAlternate);

const returnsJSX =
node[property] &&
jsxUtil.isJSX(node[property])
;
jsxUtil.isJSX(node[property]);
const returnsPragmaCreateElement = this.isCreateElement(node[property]);

return Boolean(
Expand Down

0 comments on commit 08e57f8

Please sign in to comment.