Skip to content

Commit

Permalink
Fix indent errors
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickcr committed May 8, 2017
1 parent 1bcaee0 commit 0a2c510
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 27 deletions.
3 changes: 2 additions & 1 deletion lib/rules/display-name.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ module.exports = {
node.type === 'ObjectExpression' &&
node.parent &&
node.parent.parent &&
node.parent.parent.type === 'AssignmentExpression' && (
node.parent.parent.type === 'AssignmentExpression' &&
(
!node.parent.parent.left.object ||
node.parent.parent.left.object.name !== 'module' ||
node.parent.parent.left.property.name !== 'exports'
Expand Down
20 changes: 10 additions & 10 deletions lib/rules/jsx-indent.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@ module.exports = {
return startLine !== endLine;
}

/**
* Check if the node is the right member of a logical expression
* @param {ASTNode} node The node to check
* @return {Boolean} true if its the case, false if not
*/
/**
* Check if the node is the right member of a logical expression
* @param {ASTNode} node The node to check
* @return {Boolean} true if its the case, false if not
*/
function isRightInLogicalExp(node) {
return (
node.parent &&
Expand All @@ -183,11 +183,11 @@ module.exports = {
);
}

/**
* Check if the node is the alternate member of a conditional expression
* @param {ASTNode} node The node to check
* @return {Boolean} true if its the case, false if not
*/
/**
* Check if the node is the alternate member of a conditional expression
* @param {ASTNode} node The node to check
* @return {Boolean} true if its the case, false if not
*/
function isAlternateInConditionalExp(node) {
return (
node.parent &&
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/jsx-no-literals.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = {

Literal: function(node) {
if (
!/^[\s]+$/.test(node.value) &&
!/^[\s]+$/.test(node.value) &&
node.parent &&
node.parent.type !== 'JSXExpressionContainer' &&
node.parent.type !== 'JSXAttribute' &&
Expand Down
14 changes: 7 additions & 7 deletions lib/rules/no-unused-prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,8 @@ module.exports = {
);
// let {firstname} = props
var genericDestructuring = isPropAttributeName(node) && (
utils.getParentStatelessComponent() ||
isInLifeCycleMethod(node)
utils.getParentStatelessComponent() ||
isInLifeCycleMethod(node)
);

if (thisDestructuring) {
Expand Down Expand Up @@ -751,9 +751,9 @@ module.exports = {
if (prop.node && !isPropUsed(component, prop)) {
context.report(
prop.node,
UNUSED_MESSAGE, {
name: prop.fullName
}
UNUSED_MESSAGE, {
name: prop.fullName
}
);
}

Expand Down Expand Up @@ -842,8 +842,8 @@ module.exports = {
var thisDestructuring = destructuring && node.init.type === 'ThisExpression';
// let {firstname} = props
var statelessDestructuring = destructuring && isPropAttributeName(node) && (
utils.getParentStatelessComponent() ||
isInLifeCycleMethod(node)
utils.getParentStatelessComponent() ||
isInLifeCycleMethod(node)
);

if (!thisDestructuring && !statelessDestructuring) {
Expand Down
5 changes: 3 additions & 2 deletions lib/rules/prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,9 @@ module.exports = {
name: name,
allNames: allNames,
node: (
!isDirectProp && !inConstructor() && !inComponentWillReceiveProps() ? node.parent.property :
node.property
!isDirectProp && !inConstructor() && !inComponentWillReceiveProps() ?
node.parent.property :
node.property
)
});
break;
Expand Down
8 changes: 4 additions & 4 deletions lib/rules/require-optimization.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ module.exports = {
}

return Boolean(
node &&
node.key.name === 'mixins' &&
hasPR
);
node &&
node.key.name === 'mixins' &&
hasPR
);
};

/**
Expand Down
5 changes: 3 additions & 2 deletions lib/util/Components.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,9 @@ function componentRule(rule, context) {
node[property].alternate.type === 'JSXElement'
;
var returnsConditionalJSX =
strict ? (returnsConditionalJSXConsequent && returnsConditionalJSXAlternate) :
(returnsConditionalJSXConsequent || returnsConditionalJSXAlternate);
strict ?
(returnsConditionalJSXConsequent && returnsConditionalJSXAlternate) :
(returnsConditionalJSXConsequent || returnsConditionalJSXAlternate);

var returnsJSX =
node[property] &&
Expand Down

0 comments on commit 0a2c510

Please sign in to comment.