Fix eslint6 object-shorthand

[MAILPOET-1140]
This commit is contained in:
Pavel Dohnal
2018-03-15 11:55:57 +00:00
parent d3250030ba
commit 783f33b092
12 changed files with 27 additions and 28 deletions

View File

@ -31,7 +31,6 @@
"react/jsx-boolean-value": 0,
"react/jsx-no-bind": 0,
"react/no-array-index-key": 0,
"object-shorthand": 0,
"space-unary-ops": 0,
"space-infix-ops": 0,
"no-irregular-whitespace": 0

View File

@ -94,7 +94,7 @@ define([
if (this.props.field.fields !== undefined) {
field = this.props.field.fields.map((subfield, index) => this.renderField({
index: index,
index,
field: subfield,
item: this.props.item,
onValueChange: this.props.onValueChange || false,

View File

@ -71,7 +71,7 @@ define(
endpoint: this.props.endpoint,
action: 'get',
data: {
id: id,
id,
},
}).done((response) => {
this.setState({
@ -153,7 +153,7 @@ define(
item[field] = e.target.value;
this.setState({
item: item,
item,
});
return true;
},

View File

@ -516,7 +516,7 @@ const Listing = React.createClass({
endpoint: this.props.endpoint,
action: 'restore',
data: {
id: id,
id,
},
}).done((response) => {
if (
@ -544,7 +544,7 @@ const Listing = React.createClass({
endpoint: this.props.endpoint,
action: 'trash',
data: {
id: id,
id,
},
}).done((response) => {
if (
@ -572,7 +572,7 @@ const Listing = React.createClass({
endpoint: this.props.endpoint,
action: 'delete',
data: {
id: id,
id,
},
}).done((response) => {
if (
@ -637,7 +637,7 @@ const Listing = React.createClass({
api_version: window.mailpoet_api_version,
endpoint: this.props.endpoint,
action: 'bulkAction',
data: data,
data,
}).done(() => {
this.getItems();
}).fail((response) => {
@ -651,7 +651,7 @@ const Listing = React.createClass({
},
handleSearch: function handleSearch(search) {
this.setState({
search: search,
search,
page: 1,
selection: false,
selected_ids: [],
@ -684,7 +684,7 @@ const Listing = React.createClass({
}
this.setState({
selection: selection,
selection,
selected_ids: selectedIds,
});
},
@ -729,7 +729,7 @@ const Listing = React.createClass({
jQuery('#search_input').val('');
this.setState({
group: group,
group,
filter: {},
search: '',
page: 1,
@ -739,7 +739,7 @@ const Listing = React.createClass({
},
handleSetPage: function handleSetPage(page) {
this.setState({
page: page,
page,
selection: false,
selected_ids: [],
}, () => {

View File

@ -36,7 +36,7 @@ define(
];
return {
step: null,
steps: steps,
steps,
};
},
render: function render() {

View File

@ -34,7 +34,7 @@ const getAutomaticEmailsRoutes = () => {
name: automaticEmail.slug,
component: AutomaticEmailEventsList,
data: {
automaticEmail: automaticEmail,
automaticEmail,
},
}));
};

View File

@ -73,7 +73,7 @@ define(
endpoint: 'newsletters',
action: 'get',
data: {
id: id,
id,
},
}).done((response) => {
this.setState({
@ -101,7 +101,7 @@ define(
newsletter_id: response.data.id,
name: response.data.subject,
description: response.data.preheader,
thumbnail: thumbnail,
thumbnail,
body: JSON.stringify(response.data.body),
categories: '["recent"]',
},
@ -309,7 +309,7 @@ define(
item[field] = e.target.value;
this.setState({
item: item,
item,
});
return true;
},

View File

@ -102,13 +102,13 @@ define(
// Transform string format to Date object
return MailPoet.Date.toDate(value, {
parseFormat: dateDisplayFormat,
format: format,
format,
});
};
jQuery.datepicker.formatDate = function formatDate(format, value) {
// Transform Date object to string format
const newValue = MailPoet.Date.format(value, {
format: format,
format,
});
return newValue;
};
@ -120,7 +120,7 @@ define(
that.onChange({
target: {
name: that.getFieldName(),
value: value,
value,
},
});
},
@ -205,8 +205,8 @@ define(
const value = props.value || defaultDateTime;
const [date, time] = value.split(this.DATE_TIME_SEPARATOR);
return {
date: date,
time: time,
date,
time,
};
},
handleChange: function handleChange(event) {

View File

@ -144,7 +144,7 @@ class NewsletterTemplates extends React.Component {
}).always(() => {
this.setState({
templates: this.templates,
selectedTab: selectedTab,
selectedTab,
loading: false,
});
});

View File

@ -25,7 +25,7 @@ class TemplateBox extends React.Component {
endpoint: 'newsletterTemplates',
action: 'delete',
data: {
id: id,
id,
},
}).done(() => {
afterDelete(true, id);
@ -44,7 +44,7 @@ class TemplateBox extends React.Component {
message: MailPoet.I18n.t('confirmTemplateDeletion').replace('%$1s', name),
confirmLabel: MailPoet.I18n.t('confirmLabel'),
cancelLabel: MailPoet.I18n.t('cancelLabel'),
onConfirm: onConfirm,
onConfirm,
onCancel: () => {},
});
}
@ -78,7 +78,7 @@ class TemplateBox extends React.Component {
action: 'save',
data: {
id: newsletterId,
body: body,
body,
},
}).done((response) => {
afterSelect(true, response.data.id);

View File

@ -38,7 +38,7 @@ define(
endpoint: 'newsletters',
action: 'create',
data: {
type: type,
type,
subject: MailPoet.I18n.t('draftNewsletterTitle'),
},
}).done((response) => {

View File

@ -36,7 +36,7 @@ define(
endpoint: 'newsletters',
action: 'create',
data: {
type: type,
type,
subject: MailPoet.I18n.t('draftNewsletterTitle'),
},
}).done((response) => {