feat: eslint 적용 및 관련 코드 일괄 수정

This commit is contained in:
2026-01-05 15:46:47 +00:00
parent cb312f02b3
commit c965b1120f
387 changed files with 39808 additions and 38800 deletions
+33 -24
View File
@@ -1,11 +1,6 @@
import { describe, expect, it } from 'vitest';
import {
DEFAULT_WAR_TERM,
DIPLOMACY_STATE,
processDiplomacyMonth,
type DiplomacyEntry,
} from '@sammo-ts/logic';
import { DEFAULT_WAR_TERM, DIPLOMACY_STATE, processDiplomacyMonth, type DiplomacyEntry } from '@sammo-ts/logic';
const buildEntry = (
fromNationId: number,
@@ -28,7 +23,13 @@ describe('diplomacy month processing', () => {
buildEntry(1, 2, DIPLOMACY_STATE.DECLARATION, 1),
buildEntry(2, 1, DIPLOMACY_STATE.DECLARATION, 1),
];
const result = processDiplomacyMonth(entries, new Map([[1, 1], [2, 1]]));
const result = processDiplomacyMonth(
entries,
new Map([
[1, 1],
[2, 1],
])
);
for (const entry of result) {
expect(entry.state).toBe(DIPLOMACY_STATE.WAR);
@@ -37,11 +38,14 @@ describe('diplomacy month processing', () => {
});
it('ends war when both terms reach zero without casualties', () => {
const entries = [
buildEntry(1, 2, DIPLOMACY_STATE.WAR, 1),
buildEntry(2, 1, DIPLOMACY_STATE.WAR, 1),
];
const result = processDiplomacyMonth(entries, new Map([[1, 1], [2, 1]]));
const entries = [buildEntry(1, 2, DIPLOMACY_STATE.WAR, 1), buildEntry(2, 1, DIPLOMACY_STATE.WAR, 1)];
const result = processDiplomacyMonth(
entries,
new Map([
[1, 1],
[2, 1],
])
);
for (const entry of result) {
expect(entry.state).toBe(DIPLOMACY_STATE.TRADE);
@@ -50,18 +54,17 @@ describe('diplomacy month processing', () => {
});
it('extends war term based on accumulated casualties', () => {
const entries = [
buildEntry(1, 2, DIPLOMACY_STATE.WAR, 3, 400),
buildEntry(2, 1, DIPLOMACY_STATE.WAR, 3, 0),
];
const result = processDiplomacyMonth(entries, new Map([[1, 2], [2, 2]]));
const entries = [buildEntry(1, 2, DIPLOMACY_STATE.WAR, 3, 400), buildEntry(2, 1, DIPLOMACY_STATE.WAR, 3, 0)];
const result = processDiplomacyMonth(
entries,
new Map([
[1, 2],
[2, 2],
])
);
const forward = result.find(
(entry) => entry.fromNationId === 1 && entry.toNationId === 2
);
const reverse = result.find(
(entry) => entry.fromNationId === 2 && entry.toNationId === 1
);
const forward = result.find((entry) => entry.fromNationId === 1 && entry.toNationId === 2);
const reverse = result.find((entry) => entry.fromNationId === 2 && entry.toNationId === 1);
expect(forward?.term).toBe(4);
expect(forward?.dead).toBe(0);
expect(reverse?.term).toBe(2);
@@ -72,7 +75,13 @@ describe('diplomacy month processing', () => {
buildEntry(1, 2, DIPLOMACY_STATE.NON_AGGRESSION, 1),
buildEntry(2, 1, DIPLOMACY_STATE.NON_AGGRESSION, 1),
];
const result = processDiplomacyMonth(entries, new Map([[1, 1], [2, 1]]));
const result = processDiplomacyMonth(
entries,
new Map([
[1, 1],
[2, 1],
])
);
for (const entry of result) {
expect(entry.state).toBe(DIPLOMACY_STATE.TRADE);