style: apply eslint rules

This commit is contained in:
Lukas Obermann
2023-10-02 14:08:01 +02:00
parent a9487c349d
commit 105b9151fc
3 changed files with 29 additions and 23 deletions
@@ -21,15 +21,25 @@ import { assertExhaustive } from "../../utils/typeSafety.ts"
import { getAttributeValue } from "../attribute.ts"
import { getCombatTechniqueValue } from "../combatTechnique.ts"
import { getLiturgicalChantValue } from "../liturgicalChant.ts"
import {
ActivatableRatedWithEnhancementsMap,
RatedDependency,
RatedMap,
compareWithRestriction,
} from "../ratedEntry.ts"
import { RatedDependency, compareWithRestriction } from "../rated/ratedDependency.ts"
import { ActivatableRatedWithEnhancementsMap, RatedMap } from "../ratedEntry.ts"
import { getSkillValue } from "../skill.ts"
import { getSpellValue } from "../spell.ts"
/**
* An object containing all rated entries of a character.
*/
type RatedMaps = {
attributes: RatedMap
skills: RatedMap
closeCombatTechniques: RatedMap
rangedCombatTechniques: RatedMap
spells: ActivatableRatedWithEnhancementsMap
rituals: ActivatableRatedWithEnhancementsMap
liturgicalChants: ActivatableRatedWithEnhancementsMap
ceremonies: ActivatableRatedWithEnhancementsMap
}
/**
* `flattenDependencies` flattens the list of dependencies to usable values.
* That means, optional dependencies (objects) will be evaluated and will be
@@ -38,16 +48,7 @@ import { getSpellValue } from "../spell.ts"
* dependencies.
*/
export const filterApplyingRatedDependencies =
(ratedMaps: {
attributes: RatedMap
skills: RatedMap
closeCombatTechniques: RatedMap
rangedCombatTechniques: RatedMap
spells: ActivatableRatedWithEnhancementsMap
rituals: ActivatableRatedWithEnhancementsMap
liturgicalChants: ActivatableRatedWithEnhancementsMap
ceremonies: ActivatableRatedWithEnhancementsMap
}) =>
(ratedMaps: RatedMaps) =>
(dependencies: RatedDependency[]): RatedDependency[] =>
dependencies.filter(dep => {
if (dep.otherTargets) {
+2 -2
View File
@@ -3,9 +3,9 @@ import { FC, ForwardRefRenderFunction, PropsWithChildren } from "react"
/**
* Functional Component with children
*/
export type FCC<P = {}> = FC<PropsWithChildren<P>>
export type FCC<P = object> = FC<PropsWithChildren<P>>
/**
* Functional Component with children and ref
*/
export type FRRFC<T, P = {}> = ForwardRefRenderFunction<T, PropsWithChildren<P>>
export type FRRFC<T, P = object> = ForwardRefRenderFunction<T, PropsWithChildren<P>>
+10 -5
View File
@@ -1,7 +1,7 @@
import { Action, AnyAction, OutputSelector, createSelector } from "@reduxjs/toolkit"
import { Draft, isDraft, nothing, produce } from "immer"
type Indexed = { [key: string | number]: any }
type Indexed = { [key: string | number]: unknown }
/**
* Creates a selector from an object-selecting selector that selects only a
@@ -20,9 +20,9 @@ export const createPropertySelector = <S, O extends Indexed, K extends keyof O>(
* A reducer type with possible additional parameters.
*/
export type Reducer<
S = any,
S = unknown,
A extends Action = AnyAction,
P extends any[] = [],
P extends unknown[] = [],
IS extends S | undefined = S,
> = (state: IS, action: A, ...additionalParams: P) => S
@@ -45,7 +45,12 @@ const ensureDraftState = <S>(
* state.
*/
export const reduceReducers =
<S = any, A extends Action = AnyAction, P extends any[] = [], IS extends S | undefined = S>(
<
S = unknown,
A extends Action = AnyAction,
P extends unknown[] = [],
IS extends S | undefined = S,
>(
initialReducer: Reducer<S, A, P, IS>,
...reducers: Reducer<S, A, P>[]
): Reducer<S, A, P, IS> =>
@@ -67,7 +72,7 @@ type ValidReducerReturnType<State> =
* @returns The enhanced reducing function.
*/
export const createImmerReducer =
<S = any, A extends Action = AnyAction, P extends any[] = []>(
<S = unknown, A extends Action = AnyAction, P extends unknown[] = []>(
reducer: (
state: Draft<S>,
action: A,