Skip to content

Commit

Permalink
remove parens added by my prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
jshaw22 committed Apr 21, 2021
1 parent 28b1b18 commit 796a615
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class ReactTooltip extends React.Component {
* For unify the bind and unbind listener
*/
bind(methodArray) {
methodArray.forEach((method) => {
methodArray.forEach(method => {
this[method] = this[method].bind(this);
});
}
Expand All @@ -152,7 +152,7 @@ class ReactTooltip extends React.Component {
static getDerivedStateFromProps(nextProps, prevState) {
const { ariaProps } = prevState;
const newAriaProps = parseAria(nextProps);
const isChanged = Object.keys(newAriaProps).some((props) => {
const isChanged = Object.keys(newAriaProps).some(props => {
return newAriaProps[props] !== ariaProps[props];
});
if (!isChanged) {
Expand Down Expand Up @@ -247,8 +247,8 @@ class ReactTooltip extends React.Component {

// Scan document for shadow DOM elements
nodeListToArray(document.getElementsByTagName('*'))
.filter((element) => element.shadowRoot)
.forEach((element) => {
.filter(element => element.shadowRoot)
.forEach(element => {
targetArray = targetArray.concat(
nodeListToArray(element.shadowRoot.querySelectorAll(selector))
);
Expand All @@ -266,7 +266,7 @@ class ReactTooltip extends React.Component {
const { id, globalEventOff, isCapture } = this.props;
const targetArray = this.getTargetArray(id);

targetArray.forEach((target) => {
targetArray.forEach(target => {
if (target.getAttribute('currentItem') === null) {
target.setAttribute('currentItem', 'false');
}
Expand All @@ -279,7 +279,7 @@ class ReactTooltip extends React.Component {
if (this.isBodyMode()) {
this.bindBodyListener(targetArray);
} else {
targetArray.forEach((target) => {
targetArray.forEach(target => {
const isCaptureMode = this.isCapture(target);
const effect = this.getEffect(target);
if (this.isCustomEvent(target)) {
Expand Down Expand Up @@ -320,7 +320,7 @@ class ReactTooltip extends React.Component {
this.unbindBodyListener();
} else {
const targetArray = this.getTargetArray(id);
targetArray.forEach((target) => {
targetArray.forEach(target => {
this.unbindBasicListener(target);
if (this.isCustomEvent(target)) this.customUnbindListener(target);
});
Expand Down Expand Up @@ -382,7 +382,7 @@ class ReactTooltip extends React.Component {
if (isGlobalCall) {
// Don't trigger other elements belongs to other ReactTooltip
const targetArray = this.getTargetArray(this.props.id);
const isMyElement = targetArray.some((ele) => ele === e.currentTarget);
const isMyElement = targetArray.some(ele => ele === e.currentTarget);
if (!isMyElement) return;
}
// Get the tooltip content
Expand Down Expand Up @@ -624,7 +624,7 @@ class ReactTooltip extends React.Component {
if (hasTarget) {
// Don't trigger other elements belongs to other ReactTooltip
const targetArray = this.getTargetArray(this.props.id);
const isMyElement = targetArray.some((ele) => ele === e.currentTarget);
const isMyElement = targetArray.some(ele => ele === e.currentTarget);
if (!isMyElement || !this.state.show) return;
}

Expand Down Expand Up @@ -742,7 +742,7 @@ class ReactTooltip extends React.Component {
hasCustomColors() {
return Boolean(
Object.keys(this.state.customColors).find(
(color) => color !== 'border' && this.state.customColors[color]
color => color !== 'border' && this.state.customColors[color]
) ||
(this.state.border && this.state.customColors['border'])
);
Expand Down Expand Up @@ -786,7 +786,7 @@ class ReactTooltip extends React.Component {
<Wrapper
className={`${wrapperClassName}`}
id={this.props.id || uuid}
ref={(ref) => (this.tooltipRef = ref)}
ref={ref => (this.tooltipRef = ref)}
{...ariaProps}
data-id="tooltip"
dangerouslySetInnerHTML={{ __html: htmlContent }}
Expand All @@ -798,7 +798,7 @@ class ReactTooltip extends React.Component {
className={`${wrapperClassName}`}
id={this.props.id || uuid}
{...ariaProps}
ref={(ref) => (this.tooltipRef = ref)}
ref={ref => (this.tooltipRef = ref)}
data-id="tooltip"
>
<style dangerouslySetInnerHTML={{ __html: style }} />
Expand Down

0 comments on commit 796a615

Please sign in to comment.