Skip to content

Cleanup: remove dead isDefaultValue method from StartupMigrator #456

@lonix

Description

@lonix

Problem

src/services/startup-migrator.ts contains a private isDefaultValue(key: string, value: any): boolean method (line 239) that is never called anywhere — not within the class, not in tests, not in any other file:

private isDefaultValue(key: string, value: any): boolean {
  const defaultValues: Record<string, any> = {
    "voicechannels.enabled": true,
    "voicechannels.category.name": "Voice Channels",
    // ...
  };
  return defaultValues[key] === value;
}

There are two additional problems:

  1. It uses the any type, which is forbidden by the project's ESLint config (@typescript-eslint/no-explicit-any).
  2. Its own inline default-value map is already duplicated (and diverges from) defaultConfig in config-schema.ts.

A comment on line 54 — // Fixed: match isDefaultValue method — implies the method was once intended for use but the plan changed. Because the method is private and unreachable it is pure dead weight that misleads future contributors.

Suggested fix

  1. Delete the isDefaultValue method entirely.
  2. Remove the stale comment on line 54 (// Fixed: match isDefaultValue method).

If a default-value lookup is genuinely needed in the future, derive it from defaultConfig in config-schema.ts rather than maintaining a third copy.

Affected file

src/services/startup-migrator.ts lines 54 and 239–261

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions