Add eslint rule to require parentheses in arrow functions

[MAILPOET-2162]
This commit is contained in:
Ján Mikláš
2019-07-31 10:58:56 +02:00
committed by Jack Kitterhing
parent a1bf7ec23f
commit a78562c774
78 changed files with 158 additions and 155 deletions

View File

@@ -1,10 +1,10 @@
import PropTypes from 'prop-types';
import React from 'react';
const KeyValueTable = props => (
const KeyValueTable = (props) => (
<table className="widefat fixed" style={{ maxWidth: props.max_width }}>
<tbody>
{props.rows.map(row => (
{props.rows.map((row) => (
<tr key={`row_${row.key}`}>
<td className="row-title">{ row.key }</td>
<td>{ row.value }</td>

View File

@@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
import React from 'react';
import MailPoet from 'mailpoet';
const PrintBoolean = props => (
const PrintBoolean = (props) => (
<span>
{(props.children === true && props.truthy)
|| (props.children === false && props.falsy)

View File

@@ -8,7 +8,7 @@ const SteppedProgressBar = (props) => {
return (
<div className="mailpoet_stepped_progress_bar">
{
[...Array(props.steps_count).keys()].map(step => (
[...Array(props.steps_count).keys()].map((step) => (
<div
className={`
mailpoet_stepped_progress_bar_step ${(step < props.step ? 'active' : '')} ${(step === (props.step - 1) ? 'current' : '')}

View File

@@ -21,7 +21,7 @@ export const fromDom = async (element) => {
* @param {String} url
* @return {Promise<String>} DataURL of the generated image.
*/
export const fromUrl = url => new Promise((resolve, reject) => {
export const fromUrl = (url) => new Promise((resolve, reject) => {
const iframe = document.createElement('iframe');
const protocol = document.location.href.startsWith('https://') ? 'https:' : 'http:';
iframe.src = protocol + url.replace(/^https?:/, '');
@@ -59,7 +59,7 @@ export const fromUrl = url => new Promise((resolve, reject) => {
* @param {Object} data
* @return {Promise<String>} DataURL of the generated image.
*/
export const fromNewsletter = data => new Promise((resolve, reject) => {
export const fromNewsletter = (data) => new Promise((resolve, reject) => {
const json = data;
if (!_.isUndefined(json.body)) {
json.body = JSON.stringify(json.body);
@@ -69,7 +69,7 @@ export const fromNewsletter = data => new Promise((resolve, reject) => {
endpoint: 'newsletters',
action: 'showPreview',
data: json,
}).done(response => fromUrl(response.meta.preview_url)
}).done((response) => fromUrl(response.meta.preview_url)
.then(resolve)
.catch(reject)).fail(response => reject(response.errors));
.catch(reject)).fail((response) => reject(response.errors));
});