lint 로직 변경
This commit is contained in:
@@ -1,14 +1,10 @@
|
||||
import { sha512 as sha512Noble } from '@noble/hashes/sha2.js';
|
||||
|
||||
import type { createHash } from 'node:crypto';
|
||||
import type { BytesLike } from './BytesLike.js';
|
||||
import { convertBytesLikeToUint8Array } from './convertBytesLikeToUint8Array.js';
|
||||
|
||||
type NodeHash = {
|
||||
update(data: Uint8Array): NodeHash;
|
||||
digest(): Uint8Array;
|
||||
};
|
||||
|
||||
type NodeCreateHash = (algorithm: 'sha512') => NodeHash;
|
||||
type NodeCreateHash = typeof createHash;
|
||||
|
||||
const isNode = typeof process !== 'undefined' && typeof process.versions?.node === 'string';
|
||||
|
||||
@@ -17,7 +13,7 @@ const nodeCryptoSpecifier = 'node:crypto';
|
||||
let nodeCreateHash: NodeCreateHash | null = null;
|
||||
|
||||
if (isNode) {
|
||||
const nodeCrypto = (await import(nodeCryptoSpecifier)) as typeof import('node:crypto');
|
||||
const nodeCrypto = await import(nodeCryptoSpecifier);
|
||||
nodeCreateHash = nodeCrypto.createHash as NodeCreateHash;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable prettier/prettier */
|
||||
import type { GeneralTriggerState, Nation } from '@sammo-ts/logic/domain/entities.js';
|
||||
import type { Constraint, ConstraintContext } from '@sammo-ts/logic/constraints/types.js';
|
||||
import { beNeutral } from '@sammo-ts/logic/constraints/presets.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { RandUtil } from '@sammo-ts/common';
|
||||
import type { RandUtil } from '@sammo-ts/common';
|
||||
import { TraitRequirement, TraitWeightType } from './requirements.js';
|
||||
import type { TraitModule } from './types.js';
|
||||
import type { ScenarioStatBlock } from '../../scenario/types.js';
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { TriggerValue } from '@sammo-ts/logic/domain/entities.js';
|
||||
import type { GeneralActionContext } from '@sammo-ts/logic/triggers/general.js';
|
||||
import type { GeneralStatName, WarStatName } from '@sammo-ts/logic/triggers/types.js';
|
||||
import type { WarActionContext } from '@sammo-ts/logic/war/actions.js';
|
||||
@@ -5,7 +6,7 @@ import type { TraitModule } from '@sammo-ts/logic/triggers/special/types.js';
|
||||
import { TraitRequirement, TraitWeightType } from '../requirements.js';
|
||||
import { getMetaNumber } from '@sammo-ts/logic/war/utils.js';
|
||||
|
||||
import { WarUnit } from '@sammo-ts/logic/war/units.js';
|
||||
import type { WarUnit } from '@sammo-ts/logic/war/units.js';
|
||||
|
||||
type WarUnitWithGeneral = WarUnit & { getGeneral: () => { meta: Record<string, unknown> } };
|
||||
|
||||
@@ -53,7 +54,7 @@ export const traitModule: TraitModule = {
|
||||
// In a real scenario, we should check if unit is WarUnitGeneral.
|
||||
if (hasGeneral(unit)) {
|
||||
const killnum = getMetaNumber(
|
||||
unit.getGeneral().meta as Record<string, import('@sammo-ts/logic/domain/entities.js').TriggerValue>,
|
||||
unit.getGeneral().meta as Record<string, TriggerValue>,
|
||||
'rank_killnum',
|
||||
0
|
||||
);
|
||||
|
||||
@@ -12,9 +12,9 @@ import type { ActionLogger } from '@sammo-ts/logic/logging/actionLogger.js';
|
||||
import { LogFormat } from '@sammo-ts/logic/logging/types.js';
|
||||
import type { WarStatName } from '@sammo-ts/logic/triggers/types.js';
|
||||
import { getTechAbility, getTechCost } from '@sammo-ts/logic/world/unitSet.js';
|
||||
import { WarActionPipeline, type WarActionContext } from './actions.js';
|
||||
import type { WarActionPipeline, WarActionContext } from './actions.js';
|
||||
import type { WarEngineConfig } from './types.js';
|
||||
import { WarCrewType } from './crewType.js';
|
||||
import type { WarCrewType } from './crewType.js';
|
||||
import {
|
||||
clamp,
|
||||
clampMin,
|
||||
|
||||
Reference in New Issue
Block a user