Move from prettier-eslint to eslint-plugin-prettier, update dependencies

This commit is contained in:
Maksim Eltyshev
2020-02-03 18:42:31 +05:00
parent 1f43d4f214
commit 45bde7e7c0
254 changed files with 5539 additions and 5170 deletions

View File

@@ -9,15 +9,13 @@ const mapStateToProps = ({ projectCreateForm: { data: defaultData, isSubmitting
isSubmitting,
});
const mapDispatchToProps = (dispatch) => bindActionCreators(
{
onCreate: createProject,
onClose: closeModal,
},
dispatch,
);
const mapDispatchToProps = dispatch =>
bindActionCreators(
{
onCreate: createProject,
onClose: closeModal,
},
dispatch,
);
export default connect(
mapStateToProps,
mapDispatchToProps,
)(AddProjectModal);
export default connect(mapStateToProps, mapDispatchToProps)(AddProjectModal);

View File

@@ -10,15 +10,13 @@ const mapStateToProps = ({ userCreateForm: { data: defaultData, isSubmitting, er
error,
});
const mapDispatchToProps = (dispatch) => bindActionCreators(
{
onCreate: createUser,
onMessageDismiss: clearUserCreateError,
},
dispatch,
);
const mapDispatchToProps = dispatch =>
bindActionCreators(
{
onCreate: createUser,
onMessageDismiss: clearUserCreateError,
},
dispatch,
);
export default connect(
mapStateToProps,
mapDispatchToProps,
)(AddUserPopup);
export default connect(mapStateToProps, mapDispatchToProps)(AddUserPopup);

View File

@@ -4,7 +4,7 @@ import { currentModalSelector } from '../selectors';
import ModalTypes from '../constants/ModalTypes';
import App from '../components/App';
const mapStateToProps = (state) => {
const mapStateToProps = state => {
const currentModal = currentModalSelector(state);
return {

View File

@@ -3,7 +3,7 @@ import { connect } from 'react-redux';
import { isAppInitializingSelector } from '../selectors';
import AppWrapper from '../components/AppWrapper';
const mapStateToProps = (state) => {
const mapStateToProps = state => {
const isAppInitializing = isAppInitializingSelector(state);
return {

View File

@@ -23,7 +23,7 @@ import {
} from '../actions/entry';
import Board from '../components/Board';
const mapStateToProps = (state) => {
const mapStateToProps = state => {
const { cardId } = pathSelector(state);
const allProjectMemberships = membershipsForCurrentProjectSelector(state);
const listIds = listIdsForCurrentBoardSelector(state);
@@ -41,23 +41,21 @@ const mapStateToProps = (state) => {
};
};
const mapDispatchToProps = (dispatch) => bindActionCreators(
{
onListCreate: createListInCurrentBoard,
onCardMove: moveCard,
onListMove: moveList,
onUserToFilterAdd: addUserToFilterInCurrentBoard,
onUserFromFilterRemove: removeUserFromFilterInCurrentBoard,
onLabelToFilterAdd: addLabelToFilterInCurrentBoard,
onLabelFromFilterRemove: removeLabelFromFilterInCurrentBoard,
onLabelCreate: createLabelInCurrentBoard,
onLabelUpdate: updateLabel,
onLabelDelete: deleteLabel,
},
dispatch,
);
const mapDispatchToProps = dispatch =>
bindActionCreators(
{
onListCreate: createListInCurrentBoard,
onCardMove: moveCard,
onListMove: moveList,
onUserToFilterAdd: addUserToFilterInCurrentBoard,
onUserFromFilterRemove: removeUserFromFilterInCurrentBoard,
onLabelToFilterAdd: addLabelToFilterInCurrentBoard,
onLabelFromFilterRemove: removeLabelFromFilterInCurrentBoard,
onLabelCreate: createLabelInCurrentBoard,
onLabelUpdate: updateLabel,
onLabelDelete: deleteLabel,
},
dispatch,
);
export default connect(
mapStateToProps,
mapDispatchToProps,
)(Board);
export default connect(mapStateToProps, mapDispatchToProps)(Board);

View File

@@ -3,7 +3,7 @@ import { connect } from 'react-redux';
import { currentBoardSelector } from '../selectors';
import BoardWrapper from '../components/BoardWrapper';
const mapStateToProps = (state) => {
const mapStateToProps = state => {
const { isFetching } = currentBoardSelector(state);
return {

View File

@@ -2,12 +2,10 @@ import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { boardsForCurrentProjectSelector, currentUserSelector, pathSelector } from '../selectors';
import {
createBoardInCurrentProject, deleteBoard, moveBoard, updateBoard,
} from '../actions/entry';
import { createBoardInCurrentProject, deleteBoard, moveBoard, updateBoard } from '../actions/entry';
import Boards from '../components/Boards';
const mapStateToProps = (state) => {
const mapStateToProps = state => {
const { boardId } = pathSelector(state);
const { isAdmin } = currentUserSelector(state);
const boards = boardsForCurrentProjectSelector(state);
@@ -19,17 +17,15 @@ const mapStateToProps = (state) => {
};
};
const mapDispatchToProps = (dispatch) => bindActionCreators(
{
onCreate: createBoardInCurrentProject,
onUpdate: updateBoard,
onMove: moveBoard,
onDelete: deleteBoard,
},
dispatch,
);
const mapDispatchToProps = dispatch =>
bindActionCreators(
{
onCreate: createBoardInCurrentProject,
onUpdate: updateBoard,
onMove: moveBoard,
onDelete: deleteBoard,
},
dispatch,
);
export default connect(
mapStateToProps,
mapDispatchToProps,
)(Boards);
export default connect(mapStateToProps, mapDispatchToProps)(Boards);

View File

@@ -34,9 +34,7 @@ const makeMapStateToProps = () => {
const allProjectMemberships = membershipsForCurrentProjectSelector(state);
const allLabels = labelsForCurrentBoardSelector(state);
const {
name, dueDate, timer, isPersisted,
} = cardByIdSelector(state, id);
const { name, dueDate, timer, isPersisted } = cardByIdSelector(state, id);
const users = usersByCardIdSelector(state, id);
const labels = labelsByCardIdSelector(state, id);
@@ -60,22 +58,20 @@ const makeMapStateToProps = () => {
};
};
const mapDispatchToProps = (dispatch, { id }) => bindActionCreators(
{
onUpdate: (data) => updateCard(id, data),
onDelete: () => deleteCard(id),
onUserAdd: (userId) => addUserToCard(userId, id),
onUserRemove: (userId) => removeUserFromCard(userId, id),
onLabelAdd: (labelId) => addLabelToCard(labelId, id),
onLabelRemove: (labelId) => removeLabelFromCard(labelId, id),
onLabelCreate: (data) => createLabelInCurrentBoard(data),
onLabelUpdate: (labelId, data) => updateLabel(labelId, data),
onLabelDelete: (labelId) => deleteLabel(labelId),
},
dispatch,
);
const mapDispatchToProps = (dispatch, { id }) =>
bindActionCreators(
{
onUpdate: data => updateCard(id, data),
onDelete: () => deleteCard(id),
onUserAdd: userId => addUserToCard(userId, id),
onUserRemove: userId => removeUserFromCard(userId, id),
onLabelAdd: labelId => addLabelToCard(labelId, id),
onLabelRemove: labelId => removeLabelFromCard(labelId, id),
onLabelCreate: data => createLabelInCurrentBoard(data),
onLabelUpdate: (labelId, data) => updateLabel(labelId, data),
onLabelDelete: labelId => deleteLabel(labelId),
},
dispatch,
);
export default connect(
makeMapStateToProps,
mapDispatchToProps,
)(Card);
export default connect(makeMapStateToProps, mapDispatchToProps)(Card);

View File

@@ -34,7 +34,7 @@ import {
import Paths from '../constants/Paths';
import CardModal from '../components/CardModal';
const mapStateToProps = (state) => {
const mapStateToProps = state => {
const { isAdmin } = currentUserSelector(state);
const allProjectMemberships = membershipsForCurrentProjectSelector(state);
const allLabels = labelsForCurrentBoardSelector(state);
@@ -74,28 +74,29 @@ const mapStateToProps = (state) => {
};
};
const mapDispatchToProps = (dispatch) => bindActionCreators(
{
onUpdate: updateCurrentCard,
onDelete: deleteCurrentCard,
onUserAdd: addUserToCurrentCard,
onUserRemove: removeUserFromCurrentCard,
onLabelAdd: addLabelToCurrentCard,
onLabelRemove: removeLabelFromCurrentCard,
onLabelCreate: createLabelInCurrentBoard,
onLabelUpdate: updateLabel,
onLabelDelete: deleteLabel,
onTaskCreate: createTaskInCurrentCard,
onTaskUpdate: updateTask,
onTaskDelete: deleteTask,
onActionsFetch: fetchActionsInCurrentCard,
onCommentActionCreate: createCommentActionInCurrentCard,
onCommentActionUpdate: updateCommentAction,
onCommentActionDelete: deleteCommentAction,
push,
},
dispatch,
);
const mapDispatchToProps = dispatch =>
bindActionCreators(
{
onUpdate: updateCurrentCard,
onDelete: deleteCurrentCard,
onUserAdd: addUserToCurrentCard,
onUserRemove: removeUserFromCurrentCard,
onLabelAdd: addLabelToCurrentCard,
onLabelRemove: removeLabelFromCurrentCard,
onLabelCreate: createLabelInCurrentBoard,
onLabelUpdate: updateLabel,
onLabelDelete: deleteLabel,
onTaskCreate: createTaskInCurrentCard,
onTaskUpdate: updateTask,
onTaskDelete: deleteTask,
onActionsFetch: fetchActionsInCurrentCard,
onCommentActionCreate: createCommentActionInCurrentCard,
onCommentActionUpdate: updateCommentAction,
onCommentActionDelete: deleteCommentAction,
push,
},
dispatch,
);
const mergeProps = (stateProps, dispatchProps) => ({
...omit(stateProps, 'boardId'),
@@ -103,8 +104,4 @@ const mergeProps = (stateProps, dispatchProps) => ({
onClose: () => dispatchProps.push(Paths.BOARDS.replace(':id', stateProps.boardId)),
});
export default connect(
mapStateToProps,
mapDispatchToProps,
mergeProps,
)(CardModal);
export default connect(mapStateToProps, mapDispatchToProps, mergeProps)(CardModal);

View File

@@ -15,7 +15,7 @@ import {
} from '../actions/entry';
import Header from '../components/Header';
const mapStateToProps = (state) => {
const mapStateToProps = state => {
const currentUser = currentUserSelector(state);
const notifications = notificationsForCurrentUserSelector(state);
@@ -26,22 +26,20 @@ const mapStateToProps = (state) => {
};
};
const mapDispatchToProps = (dispatch) => bindActionCreators(
{
onUsers: openUsersModal, // TODO: rename
onNotificationDelete: deleteNotification,
onUserUpdate: updateCurrentUser,
onUserAvatarUpload: uploadCurrentUserAvatar,
onUserEmailUpdate: updateCurrentUserEmail,
onUserEmailUpdateMessageDismiss: clearCurrentUserEmailUpdateError,
onUserPasswordUpdate: updateCurrentUserPassword,
onUserPasswordUpdateMessageDismiss: clearCurrentUserPasswordUpdateError,
onLogout: logout,
},
dispatch,
);
const mapDispatchToProps = dispatch =>
bindActionCreators(
{
onUsers: openUsersModal, // TODO: rename
onNotificationDelete: deleteNotification,
onUserUpdate: updateCurrentUser,
onUserAvatarUpload: uploadCurrentUserAvatar,
onUserEmailUpdate: updateCurrentUserEmail,
onUserEmailUpdateMessageDismiss: clearCurrentUserEmailUpdateError,
onUserPasswordUpdate: updateCurrentUserPassword,
onUserPasswordUpdateMessageDismiss: clearCurrentUserPasswordUpdateError,
onLogout: logout,
},
dispatch,
);
export default connect(
mapStateToProps,
mapDispatchToProps,
)(Header);
export default connect(mapStateToProps, mapDispatchToProps)(Header);

View File

@@ -23,16 +23,14 @@ const makeMapStateToProps = () => {
};
};
const mapDispatchToProps = (dispatch, { id }) => bindActionCreators(
{
onUpdate: (data) => updateList(id, data),
onDelete: () => deleteList(id),
onCardCreate: (data) => createCard(id, data),
},
dispatch,
);
const mapDispatchToProps = (dispatch, { id }) =>
bindActionCreators(
{
onUpdate: data => updateList(id, data),
onDelete: () => deleteList(id),
onCardCreate: data => createCard(id, data),
},
dispatch,
);
export default connect(
makeMapStateToProps,
mapDispatchToProps,
)(List);
export default connect(makeMapStateToProps, mapDispatchToProps)(List);

View File

@@ -10,15 +10,13 @@ const mapStateToProps = ({ authenticateForm: { data: defaultData, isSubmitting,
error,
});
const mapDispatchToProps = (dispatch) => bindActionCreators(
{
onAuthenticate: authenticate,
onMessageDismiss: clearAuthenticateError,
},
dispatch,
);
const mapDispatchToProps = dispatch =>
bindActionCreators(
{
onAuthenticate: authenticate,
onMessageDismiss: clearAuthenticateError,
},
dispatch,
);
export default connect(
mapStateToProps,
mapDispatchToProps,
)(Login);
export default connect(mapStateToProps, mapDispatchToProps)(Login);

View File

@@ -15,7 +15,7 @@ import {
} from '../actions/entry';
import Project from '../components/Project';
const mapStateToProps = (state) => {
const mapStateToProps = state => {
const allUsers = allUsersSelector(state);
const { isAdmin } = currentUserSelector(state);
const { name } = currentProjectSelector(state);
@@ -29,17 +29,15 @@ const mapStateToProps = (state) => {
};
};
const mapDispatchToProps = (dispatch) => bindActionCreators(
{
onUpdate: updateCurrentProject,
onDelete: deleteCurrentProject,
onMembershipCreate: createMembershipInCurrentProject,
onMembershipDelete: deleteProjectMembership,
},
dispatch,
);
const mapDispatchToProps = dispatch =>
bindActionCreators(
{
onUpdate: updateCurrentProject,
onDelete: deleteCurrentProject,
onMembershipCreate: createMembershipInCurrentProject,
onMembershipDelete: deleteProjectMembership,
},
dispatch,
);
export default connect(
mapStateToProps,
mapDispatchToProps,
)(Project);
export default connect(mapStateToProps, mapDispatchToProps)(Project);

View File

@@ -3,7 +3,7 @@ import { connect } from 'react-redux';
import { pathSelector } from '../selectors';
import ProjectWrapper from '../components/ProjectWrapper';
const mapStateToProps = (state) => {
const mapStateToProps = state => {
const { cardId, boardId, projectId } = pathSelector(state);
return {

View File

@@ -5,7 +5,7 @@ import { currentUserSelector, pathSelector, projectsForCurrentUserSelector } fro
import { openAddProjectModal } from '../actions/entry';
import Projects from '../components/Projects';
const mapStateToProps = (state) => {
const mapStateToProps = state => {
const { projectId } = pathSelector(state);
const { isAdmin } = currentUserSelector(state);
const projects = projectsForCurrentUserSelector(state);
@@ -17,14 +17,12 @@ const mapStateToProps = (state) => {
};
};
const mapDispatchToProps = (dispatch) => bindActionCreators(
{
onAdd: openAddProjectModal,
},
dispatch,
);
const mapDispatchToProps = dispatch =>
bindActionCreators(
{
onAdd: openAddProjectModal,
},
dispatch,
);
export default connect(
mapStateToProps,
mapDispatchToProps,
)(Projects);
export default connect(mapStateToProps, mapDispatchToProps)(Projects);

View File

@@ -5,7 +5,7 @@ import { allUsersExceptCurrentSelector } from '../selectors';
import { closeModal, deleteUser, updateUser } from '../actions/entry';
import UsersModal from '../components/UsersModal';
const mapStateToProps = (state) => {
const mapStateToProps = state => {
const items = allUsersExceptCurrentSelector(state);
return {
@@ -13,16 +13,14 @@ const mapStateToProps = (state) => {
};
};
const mapDispatchToProps = (dispatch) => bindActionCreators(
{
onUpdate: updateUser,
onDelete: deleteUser,
onClose: closeModal,
},
dispatch,
);
const mapDispatchToProps = dispatch =>
bindActionCreators(
{
onUpdate: updateUser,
onDelete: deleteUser,
onClose: closeModal,
},
dispatch,
);
export default connect(
mapStateToProps,
mapDispatchToProps,
)(UsersModal);
export default connect(mapStateToProps, mapDispatchToProps)(UsersModal);