replaced eslint:recommended with prettier

This commit is contained in:
Wyatt Johnson
2018-01-11 20:00:34 -07:00
parent d56c19016a
commit 0abc2ca243
649 changed files with 16235 additions and 13008 deletions
@@ -1,13 +1,13 @@
import React from 'react';
import {gql} from 'react-apollo';
import {connect} from 'react-redux';
import { gql } from 'react-apollo';
import { connect } from 'react-redux';
import Comment from 'coral-admin/src/routes/Moderation/containers/Comment';
import {getDefinitionName} from 'coral-framework/utils';
import { getDefinitionName } from 'coral-framework/utils';
import truncate from 'lodash/truncate';
import t from 'coral-framework/services/i18n';
function prepareNotificationText(text) {
return truncate(text, {length: 50}).replace('\n', ' ');
return truncate(text, { length: 50 }).replace('\n', ' ');
}
class ModSubscription extends React.Component {
@@ -20,14 +20,18 @@ class ModSubscription extends React.Component {
variables: {
assetId: this.props.data.variables.asset_id,
},
updateQuery: (prev, {subscriptionData: {data: {commentFeatured: {user, comment}}}}) => {
const notifyText = this.props.user.id === user.id
? ''
: t(
'talk-plugin-featured-comments.notify_featured',
user.username,
prepareNotificationText(comment.body),
);
updateQuery: (
prev,
{ subscriptionData: { data: { commentFeatured: { user, comment } } } }
) => {
const notifyText =
this.props.user.id === user.id
? ''
: t(
'talk-plugin-featured-comments.notify_featured',
user.username,
prepareNotificationText(comment.body)
);
return this.props.handleCommentChange(prev, comment, notifyText);
},
},
@@ -36,23 +40,33 @@ class ModSubscription extends React.Component {
variables: {
assetId: this.props.data.variables.asset_id,
},
updateQuery: (prev, {subscriptionData: {data: {commentUnfeatured: {user, comment}}}}) => {
const notify = this.props.user.id === user.id
? ''
: t(
'talk-plugin-featured-comments.notify_unfeatured',
user.username,
prepareNotificationText(comment.body),
);
updateQuery: (
prev,
{
subscriptionData: {
data: { commentUnfeatured: { user, comment } },
},
}
) => {
const notify =
this.props.user.id === user.id
? ''
: t(
'talk-plugin-featured-comments.notify_unfeatured',
user.username,
prepareNotificationText(comment.body)
);
return this.props.handleCommentChange(prev, comment, notify);
}
},
},
];
this.subscriptions = configs.map((config) => this.props.data.subscribeToMore(config));
this.subscriptions = configs.map(config =>
this.props.data.subscribeToMore(config)
);
}
componentWillUnmount() {
this.subscriptions.forEach((unsubscribe) => unsubscribe());
this.subscriptions.forEach(unsubscribe => unsubscribe());
}
render() {
@@ -98,7 +112,7 @@ const COMMENT_UNFEATURED_SUBSCRIPTION = gql`
${Comment.fragments.comment}
`;
const mapStateToProps = (state) => ({
const mapStateToProps = state => ({
user: state.auth.user,
});