Implemented strict mode for the project (broken tests, hundreds of @ts-ignore and new errors are included) [skip ci]

This commit is contained in:
ErickSkrauch
2020-01-17 23:37:52 +03:00
committed by SleepWalker
parent 10e8b77acf
commit 96049ad4ad
151 changed files with 2470 additions and 1869 deletions

View File

@@ -91,9 +91,7 @@ export default class Box {
endY: number;
}> = [];
// eslint-disable-next-line guard-for-in
for (const i in boxPoints) {
const point = boxPoints[i];
Object.values(boxPoints).forEach(point => {
const angle = Math.atan2(light.y - point.y, light.x - point.x);
const endX = point.x + shadowLength * Math.sin(-angle - Math.PI / 2);
const endY = point.y + shadowLength * Math.cos(-angle - Math.PI / 2);
@@ -103,7 +101,7 @@ export default class Box {
endX,
endY,
});
}
});
for (let i = points.length - 1; i >= 0; i--) {
const n = i === 3 ? 0 : i + 1;

View File

@@ -18,8 +18,7 @@ class BsodMiddleware implements Middleware {
async catch<T extends Resp<any>>(
resp?: T | InternalServerError | Error,
): Promise<T> {
const { originalResponse }: { originalResponse?: Resp<any> } = (resp ||
{}) as InternalServerError;
const { originalResponse } = (resp || {}) as InternalServerError;
if (
resp &&

View File

@@ -1,9 +1,13 @@
import { Action } from 'redux';
import { Action as ReduxAction } from 'redux';
export const BSOD = 'BSOD';
interface BSoDAction extends ReduxAction {
type: 'BSOD';
}
export function bsod(): Action {
export function bsod(): BSoDAction {
return {
type: BSOD,
type: 'BSOD',
};
}
export type Action = BSoDAction;

View File

@@ -1,9 +1,9 @@
import { BSOD } from './actions';
import { Action } from './actions';
export type State = boolean;
export default function(state: State = false, { type }): State {
if (type === BSOD) {
export default function(state: State = false, { type }: Action): State {
if (type === 'BSOD') {
return true;
}