Skip to content

Commit

Permalink
No implicit anys (mattermost#977)
Browse files Browse the repository at this point in the history
* removed implicitany
  • Loading branch information
reflog authored Nov 12, 2019
1 parent 41e409d commit d4b6552
Show file tree
Hide file tree
Showing 89 changed files with 1,203 additions and 727 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ clean: pre-run
pre-run:
@echo Make sure no previous build are in the folder

@rm -rf build/* actions client constants reducers selectors store utils types mattermost.client4* index.* mattermost.websocket_client*
@rm -rf build/* action_types actions client constants reducers selectors store utils types mattermost.client4* index.* mattermost.websocket_client*

test: check-style
npm test
Expand Down
22 changes: 19 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"redux-thunk": "2.3.0",
"remote-redux-devtools": "0.5.16",
"reselect": "4.0.0",
"serialize-error": "2.1.0",
"serialize-error": "5.0.0",
"shallow-equals": "1.0.0"
},
"husky": {
Expand All @@ -56,6 +56,7 @@
"@babel/preset-env": "7.6.0",
"@babel/preset-typescript": "7.6.0",
"@babel/runtime": "7.6.0",
"@types/shallow-equals": "1.0.0",
"@typescript-eslint/eslint-plugin": "2.3.1",
"@typescript-eslint/parser": "2.3.1",
"@types/jest": "24.0.18",
Expand Down
13 changes: 7 additions & 6 deletions src/actions/bots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import {BotTypes} from 'action_types';
import {bindClientFunc} from './helpers';

import {ActionFunc} from 'types/actions';
import {Bot, BotPatch} from 'types/bots';

const BOTS_PER_PAGE_DEFAULT = 20;

export function createBot(bot): ActionFunc {
export function createBot(bot: Bot): ActionFunc {
return bindClientFunc({
clientFunc: Client4.createBot,
onSuccess: BotTypes.RECEIVED_BOT_ACCOUNT,
Expand All @@ -19,7 +20,7 @@ export function createBot(bot): ActionFunc {
});
}

export function patchBot(botUserId, botPatch): ActionFunc {
export function patchBot(botUserId: string, botPatch: BotPatch): ActionFunc {
return bindClientFunc({
clientFunc: Client4.patchBot,
onSuccess: BotTypes.RECEIVED_BOT_ACCOUNT,
Expand All @@ -30,7 +31,7 @@ export function patchBot(botUserId, botPatch): ActionFunc {
});
}

export function loadBot(botUserId): ActionFunc {
export function loadBot(botUserId: string): ActionFunc {
return bindClientFunc({
clientFunc: Client4.getBot,
onSuccess: BotTypes.RECEIVED_BOT_ACCOUNT,
Expand All @@ -51,7 +52,7 @@ export function loadBots(page = 0, perPage = BOTS_PER_PAGE_DEFAULT): ActionFunc
});
}

export function disableBot(botUserId): ActionFunc {
export function disableBot(botUserId: string): ActionFunc {
return bindClientFunc({
clientFunc: Client4.disableBot,
onSuccess: BotTypes.RECEIVED_BOT_ACCOUNT,
Expand All @@ -61,7 +62,7 @@ export function disableBot(botUserId): ActionFunc {
});
}

export function enableBot(botUserId): ActionFunc {
export function enableBot(botUserId: string): ActionFunc {
return bindClientFunc({
clientFunc: Client4.enableBot,
onSuccess: BotTypes.RECEIVED_BOT_ACCOUNT,
Expand All @@ -71,7 +72,7 @@ export function enableBot(botUserId): ActionFunc {
});
}

export function assignBot(botUserId, newOwnerId): ActionFunc {
export function assignBot(botUserId: string, newOwnerId: string): ActionFunc {
return bindClientFunc({
clientFunc: Client4.assignBot,
onSuccess: BotTypes.RECEIVED_BOT_ACCOUNT,
Expand Down
2 changes: 1 addition & 1 deletion src/actions/channels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ export function getMyChannelMembers(teamId: string): ActionFunc {

export function getChannelMembers(channelId: string, page = 0, perPage: number = General.CHANNELS_CHUNK_SIZE): ActionFunc {
return async (dispatch: DispatchFunc, getState: GetStateFunc) => {
let channelMembers;
let channelMembers: ChannelMembership[];

try {
const channelMembersRequest = Client4.getChannelMembers(channelId, page, perPage);
Expand Down
4 changes: 2 additions & 2 deletions src/actions/errors.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {ErrorTypes} from 'action_types';
import serializeError from 'serialize-error';
import {serializeError, ErrorObject} from 'serialize-error';
import {Client4} from 'client';
import EventEmitter from 'utils/event_emitter';
import {DispatchFunc, ActionFunc} from 'types/actions';
Expand All @@ -22,7 +22,7 @@ export function dismissError(index: number): ActionFunc {
};
}

export function getLogErrorAction(error: serializeError.ErrorObject, displayable = false) {
export function getLogErrorAction(error: ErrorObject, displayable = false) {
return {
type: ErrorTypes.LOG_ERROR,
displayable,
Expand Down
3 changes: 2 additions & 1 deletion src/actions/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {Action, batchActions, DispatchFunc, GetStateFunc, ActionFunc} from 'type

import {logError} from './errors';
import {bindClientFunc, forceLogoutIfNecessary} from './helpers';
import {FileUploadResponse} from 'types/files';

export function getFilesForPost(postId: string): ActionFunc {
return async (dispatch: DispatchFunc, getState: GetStateFunc) => {
Expand Down Expand Up @@ -34,7 +35,7 @@ export function uploadFile(channelId: string, rootId: string, clientIds: Array<s
return async (dispatch: DispatchFunc, getState: GetStateFunc) => {
dispatch({type: FileTypes.UPLOAD_FILES_REQUEST, data: {}}, getState);

let files;
let files: FileUploadResponse;
try {
files = await Client4.uploadFile(fileFormData, formBoundary);
} catch (error) {
Expand Down
Loading

0 comments on commit d4b6552

Please sign in to comment.