mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -07:00
Add ESLint & Run it against the system (#4470)
This commit is contained in:
parent
43eee6b32e
commit
f789e02096
106 changed files with 1235 additions and 20242 deletions
|
|
@ -1,5 +1,5 @@
|
|||
export { Actions } from "./server.actions";
|
||||
export { Dispatch } from "./server.dispatch";
|
||||
export * from "./server.reducer";
|
||||
export { Selectors } from "./server.selectors";
|
||||
export * from "./server.types";
|
||||
export { Actions } from './server.actions';
|
||||
export { Dispatch } from './server.dispatch';
|
||||
export * from './server.reducer';
|
||||
export { Selectors } from './server.selectors';
|
||||
export * from './server.types';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Types } from "./server.types";
|
||||
import { Types } from './server.types';
|
||||
|
||||
export const Actions = {
|
||||
clearStore: () => ({
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { reset } from 'redux-form';
|
||||
import { Actions } from "./server.actions";
|
||||
import { store } from "store";
|
||||
import { Actions } from './server.actions';
|
||||
import { store } from 'store';
|
||||
|
||||
export const Dispatch = {
|
||||
clearStore: () => {
|
||||
|
|
@ -62,4 +62,4 @@ export const Dispatch = {
|
|||
serverMessage: message => {
|
||||
store.dispatch(Actions.serverMessage(message));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Log, SortBy, User, UserSortField } from "types";
|
||||
import { Log, SortBy, User, UserSortField } from 'types';
|
||||
|
||||
export interface ServerConnectParams {
|
||||
host: string;
|
||||
|
|
@ -71,4 +71,4 @@ export interface ServerStateSortUsersBy extends SortBy {
|
|||
|
||||
export interface RequestPasswordSaltParams {
|
||||
user: string;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { SortDirection, StatusEnum, UserSortField } from "types";
|
||||
import { SortDirection, StatusEnum, UserSortField } from 'types';
|
||||
|
||||
import { SortUtil } from "../common";
|
||||
import { SortUtil } from '../common';
|
||||
|
||||
import { ServerState } from "./server.interfaces"
|
||||
import { Types } from "./server.types";
|
||||
import { ServerState } from './server.interfaces'
|
||||
import { Types } from './server.types';
|
||||
|
||||
const initialState: ServerState = {
|
||||
buddyList: [],
|
||||
|
|
@ -32,7 +32,7 @@ const initialState: ServerState = {
|
|||
};
|
||||
|
||||
export const serverReducer = (state = initialState, action: any) => {
|
||||
switch(action.type) {
|
||||
switch (action.type) {
|
||||
case Types.CLEAR_STORE: {
|
||||
return {
|
||||
...initialState,
|
||||
|
|
@ -67,7 +67,7 @@ export const serverReducer = (state = initialState, action: any) => {
|
|||
const { user } = action;
|
||||
const { sortUsersBy } = state;
|
||||
|
||||
const buddyList = [ ...state.buddyList ];
|
||||
const buddyList = [...state.buddyList];
|
||||
|
||||
buddyList.push(user);
|
||||
SortUtil.sortUsersByField(buddyList, sortUsersBy);
|
||||
|
|
@ -103,7 +103,7 @@ export const serverReducer = (state = initialState, action: any) => {
|
|||
const { user } = action;
|
||||
const { sortUsersBy } = state;
|
||||
|
||||
const ignoreList = [ ...state.ignoreList ];
|
||||
const ignoreList = [...state.ignoreList];
|
||||
|
||||
ignoreList.push(user);
|
||||
SortUtil.sortUsersByField(ignoreList, sortUsersBy);
|
||||
|
|
@ -116,7 +116,7 @@ export const serverReducer = (state = initialState, action: any) => {
|
|||
case Types.REMOVE_FROM_IGNORE_LIST: {
|
||||
const { userName } = action;
|
||||
const ignoreList = state.ignoreList.filter(user => user.name !== userName);
|
||||
|
||||
|
||||
return {
|
||||
...state,
|
||||
ignoreList
|
||||
|
|
@ -125,7 +125,7 @@ export const serverReducer = (state = initialState, action: any) => {
|
|||
case Types.UPDATE_INFO: {
|
||||
const { name, version } = action.info;
|
||||
const { info } = state;
|
||||
|
||||
|
||||
return {
|
||||
...state,
|
||||
info: { ...info, name, version }
|
||||
|
|
@ -151,7 +151,7 @@ export const serverReducer = (state = initialState, action: any) => {
|
|||
}
|
||||
}
|
||||
case Types.UPDATE_USERS: {
|
||||
const users = [ ...action.users ];
|
||||
const users = [...action.users];
|
||||
const { sortUsersBy } = state;
|
||||
|
||||
|
||||
|
|
@ -174,7 +174,7 @@ export const serverReducer = (state = initialState, action: any) => {
|
|||
|
||||
return {
|
||||
...state,
|
||||
users
|
||||
users
|
||||
};
|
||||
}
|
||||
case Types.USER_LEFT: {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { ServerState } from "./server.interfaces";
|
||||
import { ServerState } from './server.interfaces';
|
||||
|
||||
interface State {
|
||||
server: ServerState
|
||||
|
|
@ -15,4 +15,4 @@ export const Selectors = {
|
|||
getLogs: ({ server }: State) => server.logs,
|
||||
getBuddyList: ({ server }: State) => server.buddyList,
|
||||
getIgnoreList: ({ server }: State) => server.ignoreList
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
export const Types = {
|
||||
CLEAR_STORE: "[Server] Clear Store",
|
||||
CONNECTION_CLOSED: "[Server] Connection Closed",
|
||||
SERVER_MESSAGE: "[Server] Server Message",
|
||||
UPDATE_BUDDY_LIST: "[Server] Update Buddy List",
|
||||
ADD_TO_BUDDY_LIST: "[Server] Add to Buddy List",
|
||||
REMOVE_FROM_BUDDY_LIST: "[Server] Remove from Buddy List",
|
||||
UPDATE_IGNORE_LIST: "[Server] Update Ignore List",
|
||||
ADD_TO_IGNORE_LIST: "[Server] Add to Ignore List",
|
||||
REMOVE_FROM_IGNORE_LIST: "[Server] Remove from Ignore List",
|
||||
UPDATE_INFO: "[Server] Update Info",
|
||||
UPDATE_STATUS: "[Server] Update Status",
|
||||
UPDATE_USER: "[Server] Update User",
|
||||
UPDATE_USERS: "[Server] Update Users",
|
||||
USER_JOINED: "[Server] User Joined",
|
||||
USER_LEFT: "[Server] User Left",
|
||||
VIEW_LOGS: "[Server] View Logs",
|
||||
CLEAR_LOGS: "[Server] Clear Logs"
|
||||
CLEAR_STORE: '[Server] Clear Store',
|
||||
CONNECTION_CLOSED: '[Server] Connection Closed',
|
||||
SERVER_MESSAGE: '[Server] Server Message',
|
||||
UPDATE_BUDDY_LIST: '[Server] Update Buddy List',
|
||||
ADD_TO_BUDDY_LIST: '[Server] Add to Buddy List',
|
||||
REMOVE_FROM_BUDDY_LIST: '[Server] Remove from Buddy List',
|
||||
UPDATE_IGNORE_LIST: '[Server] Update Ignore List',
|
||||
ADD_TO_IGNORE_LIST: '[Server] Add to Ignore List',
|
||||
REMOVE_FROM_IGNORE_LIST: '[Server] Remove from Ignore List',
|
||||
UPDATE_INFO: '[Server] Update Info',
|
||||
UPDATE_STATUS: '[Server] Update Status',
|
||||
UPDATE_USER: '[Server] Update User',
|
||||
UPDATE_USERS: '[Server] Update Users',
|
||||
USER_JOINED: '[Server] User Joined',
|
||||
USER_LEFT: '[Server] User Left',
|
||||
VIEW_LOGS: '[Server] View Logs',
|
||||
CLEAR_LOGS: '[Server] Clear Logs'
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue