fix(api): clean up this slice's own lint violations
Fixed five prettier/prettier formatting errors in the three spec files Slice 0.10 wrote or edited (world-discovery.service.spec.ts, local-location-interaction.spec.ts, vertical-slice.seed.spec.ts). Scoped by hand to just those locations so the pre-existing errors elsewhere in the workspace, unrelated to this slice, are left alone. Also corrects the implementation notes, which previously understated the lint state as entirely pre-existing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1284,9 +1284,7 @@ describe('seedVisibleVerticalSlice', () => {
|
|||||||
|
|
||||||
await seedVisibleVerticalSlice(dataSource);
|
await seedVisibleVerticalSlice(dataSource);
|
||||||
|
|
||||||
const hide = itemRepository.rows.find(
|
const hide = itemRepository.rows.find((row) => row.key === 'scorched-hide');
|
||||||
(row) => row.key === 'scorched-hide',
|
|
||||||
);
|
|
||||||
const mark = itemRepository.rows.find(
|
const mark = itemRepository.rows.find(
|
||||||
(row) => row.key === 'raider-warband-mark',
|
(row) => row.key === 'raider-warband-mark',
|
||||||
);
|
);
|
||||||
@@ -1334,9 +1332,7 @@ describe('seedVisibleVerticalSlice', () => {
|
|||||||
)?.silverReward as number;
|
)?.silverReward as number;
|
||||||
|
|
||||||
// The longer trip has to pay, or §10's loop has no pull (slice §6).
|
// The longer trip has to pay, or §10's loop has no pull (slice §6).
|
||||||
expect(silverFor('scorched-hide')).toBeGreaterThan(
|
expect(silverFor('scorched-hide')).toBeGreaterThan(silverFor('tough-hide'));
|
||||||
silverFor('tough-hide'),
|
|
||||||
);
|
|
||||||
expect(silverFor('raider-warband-mark')).toBeGreaterThan(
|
expect(silverFor('raider-warband-mark')).toBeGreaterThan(
|
||||||
silverFor('bandit-insignia'),
|
silverFor('bandit-insignia'),
|
||||||
);
|
);
|
||||||
@@ -1569,9 +1565,7 @@ describe('seedVisibleVerticalSlice', () => {
|
|||||||
|
|
||||||
await seedVisibleVerticalSlice(dataSource);
|
await seedVisibleVerticalSlice(dataSource);
|
||||||
|
|
||||||
const ashPit = locationRepository.rows.find(
|
const ashPit = locationRepository.rows.find((row) => row.key === 'ash-pit');
|
||||||
(row) => row.key === 'ash-pit',
|
|
||||||
);
|
|
||||||
const pool = locationMonsterRepository.rows.filter(
|
const pool = locationMonsterRepository.rows.filter(
|
||||||
(row) => row.locationId === ASH_PIT_ID,
|
(row) => row.locationId === ASH_PIT_ID,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -46,7 +46,9 @@ function buildService(options: {
|
|||||||
|
|
||||||
const locationRepository = {
|
const locationRepository = {
|
||||||
findOneBy: jest.fn(({ key }: { key: string }) =>
|
findOneBy: jest.fn(({ key }: { key: string }) =>
|
||||||
Promise.resolve(locations.find((location) => location.key === key) ?? null),
|
Promise.resolve(
|
||||||
|
locations.find((location) => location.key === key) ?? null,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
} as unknown as Repository<LocationDefinition>;
|
} as unknown as Repository<LocationDefinition>;
|
||||||
|
|
||||||
|
|||||||
@@ -111,9 +111,11 @@ function buildService(options: {
|
|||||||
alreadyDiscovered?: boolean;
|
alreadyDiscovered?: boolean;
|
||||||
}) {
|
}) {
|
||||||
const currentLocation = location(BURNED_ROAD_ID, options.pointsOfInterest);
|
const currentLocation = location(BURNED_ROAD_ID, options.pointsOfInterest);
|
||||||
const discover = jest.fn().mockResolvedValue(
|
const discover = jest
|
||||||
options.alreadyDiscovered ? null : { key: 'ash-pit', name: 'Ash Pit' },
|
.fn()
|
||||||
);
|
.mockResolvedValue(
|
||||||
|
options.alreadyDiscovered ? null : { key: 'ash-pit', name: 'Ash Pit' },
|
||||||
|
);
|
||||||
const worldDiscovery = {
|
const worldDiscovery = {
|
||||||
discover,
|
discover,
|
||||||
isTravelAllowed: () => Promise.resolve(true),
|
isTravelAllowed: () => Promise.resolve(true),
|
||||||
|
|||||||
@@ -283,6 +283,18 @@ None of these were judged to change behavior a player can hit; they are
|
|||||||
seams a future slice's tests should tighten, most likely whichever slice
|
seams a future slice's tests should tighten, most likely whichever slice
|
||||||
next touches the combat engine or the seed's encounter-pool weights.
|
next touches the combat engine or the seed's encounter-pool weights.
|
||||||
|
|
||||||
|
**Lint state.** `npm run lint --workspace=@ashen-realms/api` (scoped to the
|
||||||
|
whole API workspace) fails: roughly a hundred `@typescript-eslint` and
|
||||||
|
`prettier/prettier` errors remain, all in the quest system, the rewards
|
||||||
|
service, the shops module, migration-runner specs and other files this
|
||||||
|
slice never touched — confirmed pre-existing by `git blame` timestamps
|
||||||
|
predating this branch's base commit. This slice's own files pass lint
|
||||||
|
cleanly; the five formatting violations `eslint --fix` originally found in
|
||||||
|
`world-discovery.service.spec.ts`, `local-location-interaction.spec.ts` and
|
||||||
|
`vertical-slice.seed.spec.ts` were fixed by hand, scoped to just those
|
||||||
|
locations. The pre-existing errors are left alone, out of this slice's
|
||||||
|
scope and the AGENTS.md rule against unrelated refactoring.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 7. Outstanding manual verification
|
## 7. Outstanding manual verification
|
||||||
|
|||||||
Reference in New Issue
Block a user