Fix semi eslint rule

[MAILPOET-985]
This commit is contained in:
Pavel Dohnal
2017-07-05 09:28:38 +01:00
parent 5b65a8f0ac
commit 6dc1bf4e95
35 changed files with 192 additions and 193 deletions

View File

@ -49,7 +49,6 @@
"prefer-template": 0,
"eol-last": 0,
"no-unused-vars": 0,
"semi": 0,
"keyword-spacing": 0,
"default-case": 0,
"quote-props": 0,

View File

@ -105,7 +105,7 @@ define([
year: '',
month: '',
day: ''
}
};
}
componentDidMount() {
this.extractDateParts();

View File

@ -1,5 +1,5 @@
import React from 'react'
import _ from 'underscore'
import React from 'react';
import _ from 'underscore';
const FormFieldSelect = React.createClass({
render() {
@ -38,7 +38,7 @@ const FormFieldSelect = React.createClass({
(item) => item[0]
);
} else {
keys = Object.keys(this.props.field.values)
keys = Object.keys(this.props.field.values);
}
const options = keys.map(

View File

@ -1,4 +1,4 @@
import React from 'react'
import React from 'react';
const FormFieldText = React.createClass({
render() {

View File

@ -1,14 +1,14 @@
import React from 'react'
import ReactDOM from 'react-dom'
import { Router, Route, IndexRoute, Link, useRouterHistory } from 'react-router'
import { createHashHistory } from 'history'
import FormList from 'forms/list.jsx'
import React from 'react';
import ReactDOM from 'react-dom';
import { Router, Route, IndexRoute, Link, useRouterHistory } from 'react-router';
import { createHashHistory } from 'history';
import FormList from 'forms/list.jsx';
const history = useRouterHistory(createHashHistory)({ queryKey: false });
const App = React.createClass({
render() {
return this.props.children
return this.props.children;
}
});

View File

@ -1,9 +1,9 @@
import React from 'react'
import ReactDOM from 'react-dom'
import { Router, Link } from 'react-router'
import Listing from 'listing/listing.jsx'
import classNames from 'classnames'
import MailPoet from 'mailpoet'
import React from 'react';
import ReactDOM from 'react-dom';
import { Router, Link } from 'react-router';
import Listing from 'listing/listing.jsx';
import classNames from 'classnames';
import MailPoet from 'mailpoet';
const columns = [
{

View File

@ -1,10 +1,10 @@
import React from 'react'
import ReactDOM from 'react-dom'
import { Router, Route, IndexRedirect, useRouterHistory } from 'react-router'
import { createHashHistory } from 'history'
import React from 'react';
import ReactDOM from 'react-dom';
import { Router, Route, IndexRedirect, useRouterHistory } from 'react-router';
import { createHashHistory } from 'history';
import KnowledgeBase from 'help/knowledge_base.jsx'
import SystemInfo from 'help/system_info.jsx'
import KnowledgeBase from 'help/knowledge_base.jsx';
import SystemInfo from 'help/system_info.jsx';
const history = useRouterHistory(createHashHistory)({ queryKey: false });

View File

@ -1,7 +1,7 @@
import React from 'react'
import MailPoet from 'mailpoet'
import React from 'react';
import MailPoet from 'mailpoet';
import Tabs from './tabs.jsx'
import Tabs from './tabs.jsx';
function KnowledgeBase() {

View File

@ -1,8 +1,8 @@
import React from 'react'
import MailPoet from 'mailpoet'
import _ from 'underscore'
import React from 'react';
import MailPoet from 'mailpoet';
import _ from 'underscore';
import Tabs from './tabs.jsx'
import Tabs from './tabs.jsx';
function handleFocus(event) {
event.target.select();

View File

@ -1,7 +1,7 @@
import React from 'react'
import { Link } from 'react-router'
import classNames from 'classnames'
import MailPoet from 'mailpoet'
import React from 'react';
import { Link } from 'react-router';
import classNames from 'classnames';
import MailPoet from 'mailpoet';
const tabs = [
{

View File

@ -11,7 +11,7 @@ function(
return {
action: false,
extra: false
}
};
},
handleChangeAction: function(e) {
this.setState({

View File

@ -12,7 +12,7 @@ function(
handleFilterAction: function() {
let filters = {};
this.getAvailableFilters().map((filter, i) => {
filters[this.refs['filter-'+i].name] = this.refs['filter-'+i].value
filters[this.refs['filter-'+i].name] = this.refs['filter-'+i].value;
});
return this.props.onSelectFilter(filters);
},

View File

@ -1,6 +1,6 @@
import MailPoet from 'mailpoet'
import React from 'react'
import classNames from 'classnames'
import MailPoet from 'mailpoet';
import React from 'react';
import classNames from 'classnames';
const ListingHeader = React.createClass({
handleSelectItems: function() {

View File

@ -1,15 +1,15 @@
import MailPoet from 'mailpoet'
import jQuery from 'jquery'
import React from 'react'
import _ from 'underscore'
import { Router, Link } from 'react-router'
import classNames from 'classnames'
import ListingBulkActions from 'listing/bulk_actions.jsx'
import ListingHeader from 'listing/header.jsx'
import ListingPages from 'listing/pages.jsx'
import ListingSearch from 'listing/search.jsx'
import ListingGroups from 'listing/groups.jsx'
import ListingFilters from 'listing/filters.jsx'
import MailPoet from 'mailpoet';
import jQuery from 'jquery';
import React from 'react';
import _ from 'underscore';
import { Router, Link } from 'react-router';
import classNames from 'classnames';
import ListingBulkActions from 'listing/bulk_actions.jsx';
import ListingHeader from 'listing/header.jsx';
import ListingPages from 'listing/pages.jsx';
import ListingSearch from 'listing/search.jsx';
import ListingGroups from 'listing/groups.jsx';
import ListingFilters from 'listing/filters.jsx';
const ListingItem = React.createClass({
getInitialState: function() {
@ -324,8 +324,8 @@ const Listing = React.createClass({
case 'filter':
let filters = {};
value.split('&').map(function(pair) {
let [k, v] = pair.split('=')
filters[k] = v
let [k, v] = pair.split('=');
filters[k] = v;
}
);
@ -380,21 +380,21 @@ const Listing = React.createClass({
'sort_by',
'sort_order'
].indexOf(key) !== -1
)
);
})
.map(key => {
let value = this.state[key];
if (value === Object(value)) {
value = jQuery.param(value)
value = jQuery.param(value);
} else if (value === Boolean(value)) {
value = value.toString()
value = value.toString();
}
if (value !== '' && value !== null) {
return `${key}[${value}]`
return `${key}[${value}]`;
}
})
.filter(key => { return (key !== undefined) })
.filter(key => { return (key !== undefined); })
.join('/');
// set url
@ -616,7 +616,7 @@ const Listing = React.createClass({
filter: this.state.filter,
group: this.state.group,
search: this.state.search
}
};
if (selected_ids !== 'all') {
data.listing.selection = selected_ids;
}

View File

@ -12,7 +12,7 @@ define([
getInitialState: function() {
return {
page: null
}
};
},
setPage: function(page) {
this.setState({

View File

@ -14,7 +14,7 @@ define([
);
},
componentWillReceiveProps: function(nextProps) {
this.refs.search.value = nextProps.search
this.refs.search.value = nextProps.search;
},
render: function() {
if(this.props.search === false) {

View File

@ -1,6 +1,6 @@
import React from 'react'
import classNames from 'classnames'
import ReactTooltip from 'react-tooltip'
import React from 'react';
import classNames from 'classnames';
import ReactTooltip from 'react-tooltip';
class Badge extends React.Component {
render() {

View File

@ -1,7 +1,7 @@
import MailPoet from 'mailpoet'
import React from 'react'
import MailPoet from 'mailpoet';
import React from 'react';
import Badge from './badge.jsx'
import Badge from './badge.jsx';
const badges = {
excellent: {

View File

@ -1,13 +1,13 @@
import React from 'react'
import ReactDOM from 'react-dom'
import ReactStringReplace from 'react-string-replace'
import { Link } from 'react-router'
import MailPoet from 'mailpoet'
import classNames from 'classnames'
import moment from 'moment'
import jQuery from 'jquery'
import Hooks from 'wp-js-hooks'
import StatsBadge from 'newsletters/badges/stats.jsx'
import React from 'react';
import ReactDOM from 'react-dom';
import ReactStringReplace from 'react-string-replace';
import { Link } from 'react-router';
import MailPoet from 'mailpoet';
import classNames from 'classnames';
import moment from 'moment';
import jQuery from 'jquery';
import Hooks from 'wp-js-hooks';
import StatsBadge from 'newsletters/badges/stats.jsx';
const _QueueMixin = {
pauseSending: function(newsletter) {
@ -58,14 +58,14 @@ const _QueueMixin = {
} else if (mailer_log.status === 'paused' && newsletter.queue.status !== 'completed') {
return (
<span>{MailPoet.I18n.t('paused')}</span>
)
);
} else {
if (newsletter.queue.status === 'scheduled') {
return (
<span>
{ MailPoet.I18n.t('scheduledFor') } { MailPoet.Date.format(newsletter.queue.scheduled_at) }
</span>
)
);
}
const progressClasses = classNames(
'mailpoet_progress',
@ -149,7 +149,7 @@ const _StatisticsMixin = {
// condition for standard and post notification listings
is_sent = newsletter.statistics
&& newsletter.queue
&& newsletter.queue.status !== 'scheduled'
&& newsletter.queue.status !== 'scheduled';
}
if (!is_sent) {
return (
@ -301,7 +301,7 @@ const _StatisticsMixin = {
</div>
);
}
}
};
const _MailerMixin = {
checkMailerStatus: function(state) {
@ -369,7 +369,7 @@ const _MailerMixin = {
}
});
}
}
};

View File

@ -1,22 +1,22 @@
import React from 'react'
import { Router, Route, IndexRoute, Link, useRouterHistory } from 'react-router'
import { createHashHistory } from 'history'
import React from 'react';
import { Router, Route, IndexRoute, Link, useRouterHistory } from 'react-router';
import { createHashHistory } from 'history';
import Listing from 'listing/listing.jsx'
import ListingTabs from 'newsletters/listings/tabs.jsx'
import Listing from 'listing/listing.jsx';
import ListingTabs from 'newsletters/listings/tabs.jsx';
import { MailerMixin } from 'newsletters/listings/mixins.jsx'
import { MailerMixin } from 'newsletters/listings/mixins.jsx';
import classNames from 'classnames'
import jQuery from 'jquery'
import MailPoet from 'mailpoet'
import classNames from 'classnames';
import jQuery from 'jquery';
import MailPoet from 'mailpoet';
import {
timeOfDayValues,
weekDayValues,
monthDayValues,
nthWeekDayValues
} from 'newsletters/scheduling/common.jsx'
} from 'newsletters/scheduling/common.jsx';
const mailpoet_settings = window.mailpoet_settings || {};
@ -203,7 +203,7 @@ const NewsletterListNotification = React.createClass({
// get list of segments' name
const segments = newsletter.segments.map(function(segment) {
return segment.name
return segment.name;
});
// check if the user has specified segments to send to

View File

@ -1,18 +1,18 @@
import React from 'react'
import { Router, Link } from 'react-router'
import classNames from 'classnames'
import jQuery from 'jquery'
import MailPoet from 'mailpoet'
import Hooks from 'wp-js-hooks'
import React from 'react';
import { Router, Link } from 'react-router';
import classNames from 'classnames';
import jQuery from 'jquery';
import MailPoet from 'mailpoet';
import Hooks from 'wp-js-hooks';
import Listing from 'listing/listing.jsx'
import ListingTabs from 'newsletters/listings/tabs.jsx'
import Listing from 'listing/listing.jsx';
import ListingTabs from 'newsletters/listings/tabs.jsx';
import {
QueueMixin,
StatisticsMixin,
MailerMixin
} from 'newsletters/listings/mixins.jsx'
} from 'newsletters/listings/mixins.jsx';
const mailpoet_tracking_enabled = (!!(window['mailpoet_tracking_enabled']));
const mailpoet_settings = window.mailpoet_settings || {};
@ -61,7 +61,7 @@ const NewsletterListNotificationHistory = React.createClass({
renderSentDate: function(newsletter) {
return (newsletter.queue.status === 'completed')
? ( <abbr>{ MailPoet.Date.format(newsletter.updated_at) }</abbr> )
: MailPoet.I18n.t('notSentYet')
: MailPoet.I18n.t('notSentYet');
},
renderItem: function(newsletter, actions, meta) {
const rowClasses = classNames(
@ -71,7 +71,7 @@ const NewsletterListNotificationHistory = React.createClass({
);
const segments = newsletter.segments.map(function(segment) {
return segment.name
return segment.name;
}).join(', ');
const mailer_log = window.mailpoet_settings.mta_log || {};

View File

@ -1,17 +1,17 @@
import React from 'react'
import { Link } from 'react-router'
import classNames from 'classnames'
import MailPoet from 'mailpoet'
import Hooks from 'wp-js-hooks'
import React from 'react';
import { Link } from 'react-router';
import classNames from 'classnames';
import MailPoet from 'mailpoet';
import Hooks from 'wp-js-hooks';
import Listing from 'listing/listing.jsx'
import ListingTabs from 'newsletters/listings/tabs.jsx'
import Listing from 'listing/listing.jsx';
import ListingTabs from 'newsletters/listings/tabs.jsx';
import {
QueueMixin,
StatisticsMixin,
MailerMixin
} from 'newsletters/listings/mixins.jsx'
} from 'newsletters/listings/mixins.jsx';
const mailpoet_tracking_enabled = (!!(window['mailpoet_tracking_enabled']));
const mailpoet_settings = window.mailpoet_settings || {};
@ -164,7 +164,7 @@ const NewsletterListStandard = React.createClass({
);
const segments = newsletter.segments.map(function(segment) {
return segment.name
return segment.name;
}).join(', ');
return (

View File

@ -1,7 +1,7 @@
import React from 'react'
import { Link } from 'react-router'
import classNames from 'classnames'
import MailPoet from 'mailpoet'
import React from 'react';
import { Link } from 'react-router';
import classNames from 'classnames';
import MailPoet from 'mailpoet';
const ListingTabs = React.createClass({
getInitialState() {

View File

@ -1,17 +1,17 @@
import React from 'react'
import { Router, Route, IndexRoute, Link, useRouterHistory } from 'react-router'
import { createHashHistory } from 'history'
import React from 'react';
import { Router, Route, IndexRoute, Link, useRouterHistory } from 'react-router';
import { createHashHistory } from 'history';
import Listing from 'listing/listing.jsx'
import ListingTabs from 'newsletters/listings/tabs.jsx'
import Listing from 'listing/listing.jsx';
import ListingTabs from 'newsletters/listings/tabs.jsx';
import { StatisticsMixin, MailerMixin } from 'newsletters/listings/mixins.jsx'
import { StatisticsMixin, MailerMixin } from 'newsletters/listings/mixins.jsx';
import classNames from 'classnames'
import jQuery from 'jquery'
import MailPoet from 'mailpoet'
import _ from 'underscore'
import Hooks from 'wp-js-hooks'
import classNames from 'classnames';
import jQuery from 'jquery';
import MailPoet from 'mailpoet';
import _ from 'underscore';
import Hooks from 'wp-js-hooks';
const mailpoet_roles = window.mailpoet_roles || {};
const mailpoet_segments = window.mailpoet_segments || {};

View File

@ -1,20 +1,20 @@
import React from 'react'
import ReactDOM from 'react-dom'
import { Router, Route, IndexRedirect, Link, useRouterHistory } from 'react-router'
import { createHashHistory } from 'history'
import Hooks from 'wp-js-hooks'
import React from 'react';
import ReactDOM from 'react-dom';
import { Router, Route, IndexRedirect, Link, useRouterHistory } from 'react-router';
import { createHashHistory } from 'history';
import Hooks from 'wp-js-hooks';
import NewsletterTypes from 'newsletters/types.jsx'
import NewsletterTemplates from 'newsletters/templates.jsx'
import NewsletterSend from 'newsletters/send.jsx'
import NewsletterTypes from 'newsletters/types.jsx';
import NewsletterTemplates from 'newsletters/templates.jsx';
import NewsletterSend from 'newsletters/send.jsx';
import NewsletterTypeStandard from 'newsletters/types/standard.jsx'
import NewsletterTypeNotification from 'newsletters/types/notification/notification.jsx'
import NewsletterTypeStandard from 'newsletters/types/standard.jsx';
import NewsletterTypeNotification from 'newsletters/types/notification/notification.jsx';
import NewsletterListStandard from 'newsletters/listings/standard.jsx'
import NewsletterListWelcome from 'newsletters/listings/welcome.jsx'
import NewsletterListNotification from 'newsletters/listings/notification.jsx'
import NewsletterListNotificationHistory from 'newsletters/listings/notification_history.jsx'
import NewsletterListStandard from 'newsletters/listings/standard.jsx';
import NewsletterListWelcome from 'newsletters/listings/welcome.jsx';
import NewsletterListNotification from 'newsletters/listings/notification.jsx';
import NewsletterListNotificationHistory from 'newsletters/listings/notification_history.jsx';
const history = useRouterHistory(createHashHistory)({ queryKey: false });

View File

@ -1,5 +1,5 @@
import _ from 'underscore'
import MailPoet from 'mailpoet'
import _ from 'underscore';
import MailPoet from 'mailpoet';
const timeFormat = window.mailpoet_time_format || 'H:i';

View File

@ -206,7 +206,7 @@ define(
},
_buildStateFromProps: function(props) {
let value = props.value || defaultDateTime;
const [date, time] = value.split(this._DATE_TIME_SEPARATOR)
const [date, time] = value.split(this._DATE_TIME_SEPARATOR);
return {
date: date,
time: time,
@ -227,7 +227,7 @@ define(
name: this.props.name || '',
value: this.getDateTime(),
}
})
});
}
},
getDateTime: function() {

View File

@ -53,7 +53,7 @@ define(
<a className="button button-primary" onClick={ this.createNewsletter.bind(null, 'standard') }>
{MailPoet.I18n.t('create')}
</a>
)
);
}.bind(this)()
},
{
@ -67,7 +67,7 @@ define(
{MailPoet.I18n.t('getPremiumVersion')}
</a>
</div>
)
);
}()
},
{
@ -79,7 +79,7 @@ define(
<a className="button button-primary" onClick={ this.setupNewsletter.bind(null, 'notification') }>
{MailPoet.I18n.t('setUp')}
</a>
)
);
}.bind(this)()
}
];
@ -109,7 +109,7 @@ define(
</div>
</div>
</li>
)
);
}, this)}
</ul>
</div>

View File

@ -1,13 +1,13 @@
import _ from 'underscore'
import React from 'react'
import Select from 'form/fields/select.jsx'
import _ from 'underscore';
import React from 'react';
import Select from 'form/fields/select.jsx';
import {
intervalValues,
timeOfDayValues,
weekDayValues,
monthDayValues,
nthWeekDayValues
} from 'newsletters/scheduling/common.jsx'
} from 'newsletters/scheduling/common.jsx';
const intervalField = {
name: 'intervalType',

View File

@ -1,12 +1,12 @@
import _ from 'underscore'
import React from 'react'
import MailPoet from 'mailpoet'
import Select from 'form/fields/select.jsx'
import Text from 'form/fields/text.jsx'
import _ from 'underscore';
import React from 'react';
import MailPoet from 'mailpoet';
import Select from 'form/fields/select.jsx';
import Text from 'form/fields/text.jsx';
import {
timeDelayValues,
intervalValues
} from 'newsletters/scheduling/common.jsx'
} from 'newsletters/scheduling/common.jsx';
const availableRoles = window.mailpoet_roles || {};
const availableSegments = _.filter(

View File

@ -1,10 +1,10 @@
import React from 'react'
import { Router, Link } from 'react-router'
import jQuery from 'jquery'
import MailPoet from 'mailpoet'
import classNames from 'classnames'
import React from 'react';
import { Router, Link } from 'react-router';
import jQuery from 'jquery';
import MailPoet from 'mailpoet';
import classNames from 'classnames';
import Listing from 'listing/listing.jsx'
import Listing from 'listing/listing.jsx';
var columns = [
{

View File

@ -1,16 +1,16 @@
import React from 'react'
import ReactDOM from 'react-dom'
import { Router, Route, IndexRoute, Link, useRouterHistory } from 'react-router'
import { createHashHistory } from 'history'
import React from 'react';
import ReactDOM from 'react-dom';
import { Router, Route, IndexRoute, Link, useRouterHistory } from 'react-router';
import { createHashHistory } from 'history';
import SegmentList from 'segments/list.jsx'
import SegmentForm from 'segments/form.jsx'
import SegmentList from 'segments/list.jsx';
import SegmentForm from 'segments/form.jsx';
const history = useRouterHistory(createHashHistory)({ queryKey: false });
const App = React.createClass({
render() {
return this.props.children
return this.props.children;
}
});

View File

@ -175,7 +175,7 @@ define(
</strong> { MailPoet.I18n.t('customFieldsTip') }
</p>
);
}
};
var Link = Router.Link;

View File

@ -1,12 +1,12 @@
import React from 'react'
import { Router, Route, Link } from 'react-router'
import React from 'react';
import { Router, Route, Link } from 'react-router';
import jQuery from 'jquery'
import MailPoet from 'mailpoet'
import classNames from 'classnames'
import jQuery from 'jquery';
import MailPoet from 'mailpoet';
import classNames from 'classnames';
import Listing from 'listing/listing.jsx'
import Selection from 'form/fields/selection.jsx'
import Listing from 'listing/listing.jsx';
import Selection from 'form/fields/selection.jsx';
const columns = [
{
@ -123,7 +123,7 @@ const bulk_actions = [
getData: function() {
return {
segment_id: ~~(jQuery('#move_to_segment').val())
}
};
},
onSuccess: function(response) {
MailPoet.Notice.success(
@ -155,7 +155,7 @@ const bulk_actions = [
getData: function() {
return {
segment_id: ~~(jQuery('#add_to_segment').val())
}
};
},
onSuccess: function(response) {
MailPoet.Notice.success(
@ -187,7 +187,7 @@ const bulk_actions = [
getData: function() {
return {
segment_id: ~~(jQuery('#remove_from_segment').val())
}
};
},
onSuccess: function(response) {
MailPoet.Notice.success(
@ -377,7 +377,7 @@ const SubscriberList = React.createClass({
sort_order={ 'desc' }
/>
</div>
)
);
}
});

View File

@ -1,9 +1,9 @@
import React from 'react'
import ReactDOM from 'react-dom'
import { Router, Route, IndexRoute, Link, useRouterHistory } from 'react-router'
import { createHashHistory } from 'history'
import SubscriberList from 'subscribers/list.jsx'
import SubscriberForm from 'subscribers/form.jsx'
import React from 'react';
import ReactDOM from 'react-dom';
import { Router, Route, IndexRoute, Link, useRouterHistory } from 'react-router';
import { createHashHistory } from 'history';
import SubscriberList from 'subscribers/list.jsx';
import SubscriberForm from 'subscribers/form.jsx';
const history = useRouterHistory(createHashHistory)({ queryKey: false });
@ -13,7 +13,7 @@ const App = React.createClass({
}
});
const container = document.getElementById('subscribers_container')
const container = document.getElementById('subscribers_container');
if(container) {
ReactDOM.render((