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
+5 -20
View File
@@ -6,13 +6,7 @@ import type { MapDefinition } from '@sammo-ts/logic';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const DEFAULT_MAP_ROOT = path.resolve(
__dirname,
'..',
'..',
'resources',
'map'
);
const DEFAULT_MAP_ROOT = path.resolve(__dirname, '..', '..', 'resources', 'map');
export interface MapLoaderOptions {
mapRoot?: string;
@@ -24,28 +18,19 @@ const readJsonFile = async (filePath: string): Promise<unknown> => {
return JSON.parse(raw) as unknown;
};
const resolveMapRoot = (options?: MapLoaderOptions): string =>
options?.mapRoot ?? DEFAULT_MAP_ROOT;
const resolveMapRoot = (options?: MapLoaderOptions): string => options?.mapRoot ?? DEFAULT_MAP_ROOT;
export const resolveMapDefinitionPath = (
mapName: string,
options?: MapLoaderOptions
): string => {
export const resolveMapDefinitionPath = (mapName: string, options?: MapLoaderOptions): string => {
const prefix = options?.filePrefix ?? 'map_';
return path.resolve(resolveMapRoot(options), `${prefix}${mapName}.json`);
};
export const loadMapDefinition = async (
mapPath: string
): Promise<MapDefinition> => {
export const loadMapDefinition = async (mapPath: string): Promise<MapDefinition> => {
const raw = await readJsonFile(mapPath);
return raw as MapDefinition;
};
export const loadMapDefinitionByName = async (
mapName: string,
options?: MapLoaderOptions
): Promise<MapDefinition> => {
export const loadMapDefinitionByName = async (mapName: string, options?: MapLoaderOptions): Promise<MapDefinition> => {
const mapPath = resolveMapDefinitionPath(mapName, options);
return loadMapDefinition(mapPath);
};