Skip to content

Align TypeScript file naming to industry standard (all kebab-case) #181

Closed

Description

@malibio

Problem

Our current file naming convention uses a mixed approach that differs from modern industry standards:

Current Convention:

  • TypeScript source files: camelCase.ts (e.g., databaseWriteQueue.ts, nodeReferenceService.ts)
  • Test files: kebab-case.test.ts (e.g., database-write-queue.test.ts)
  • Svelte components: kebab-case.svelte

Industry Standard (2024-2025):

  • All TypeScript files: kebab-case.ts
  • Reason: Cross-platform safety, package naming compatibility, framework alignment

Background

Our convention was established in January 2025 during a comprehensive file naming migration (Phase 3). However, recent research shows that kebab-case for all files is now the dominant pattern in modern TypeScript projects due to:

  1. Cross-platform safety: Avoids issues with case-insensitive filesystems (Mac/Windows)
  2. Package naming: npm packages must be lowercase
  3. Framework alignment: SvelteKit, Next.js, and other modern frameworks recommend kebab-case
  4. Ecosystem consistency: Most 2024-2025 TypeScript guides favor kebab-case

References

Proposed Change

Update all TypeScript source files from camelCase.ts to kebab-case.ts:

# Examples:
databaseWriteQueue.ts → database-write-queue.ts
nodeReferenceService.ts → node-reference-service.ts
contentEditableController.ts → content-editable-controller.ts

Scope

Files to Rename (~25-30 files)

  • /src/lib/services/*.ts (~19 files)
  • /src/lib/utils/*.ts (~5 files)
  • Other utility/service TypeScript files

Files Already Correct

  • ✅ All test files (already kebab-case)
  • ✅ All Svelte components (already kebab-case)
  • ✅ Documentation files (already kebab-case)

Implementation Tasks

  • Update file naming convention documentation (/docs/architecture/development/standards/file-naming-conventions.md)
  • Update ESLint rules to enforce kebab-case for TypeScript files
    • Modify eslint.config.js to require kebab-case for .ts files (not just .svelte)
    • Keep exceptions for index.ts, .d.ts, .test.ts
  • Create migration script to rename files using git mv (preserves history)
  • Update all import statements to use new file names
  • Run full test suite to verify no breakage
  • Update bun run quality:fix to catch any issues
  • Document migration in changelog/release notes

Benefits

  1. Industry alignment: Matches 2024-2025 TypeScript best practices
  2. Consistency: Single naming rule for all TypeScript files
  3. Cross-platform safety: Eliminates potential case-sensitivity issues
  4. Developer experience: Matches expectations from modern TypeScript developers
  5. Framework alignment: Consistent with SvelteKit community norms

Migration Strategy

Phase 1: Preparation

  • Update documentation
  • Update ESLint configuration
  • Create automated migration script

Phase 2: Execution

  • Run migration script (using git mv to preserve history)
  • Update all imports automatically
  • Verify all tests pass

Phase 3: Validation

  • Run bun run quality:fix to ensure compliance
  • Manual smoke testing
  • Update any remaining references in documentation

Estimated Effort

  • Documentation + ESLint: 1-2 hours
  • Migration script: 2-3 hours
  • Execution + validation: 1-2 hours
  • Total: 4-7 hours

Priority

Low-Medium - This is a quality-of-life improvement and alignment with industry standards. Current naming works fine, but updating would improve consistency and match developer expectations.

Related


Note: This issue is for future consideration and does not block current development. The team should discuss and decide if/when to implement this change.

Activity

  1. self-assigned this
    on Oct 7, 2025
  2. added
    documentation
    on Oct 7, 2025
  3. assigned and unassigned on Oct 7, 2025
  4. added 4 commits that reference this issue on Oct 8, 2025
    5bccc62
    06c1f55
    715d564
    29d945e
  5. added a commit that references this issue on Oct 8, 2025
    26df0ce
  6. added 2 commits that reference this issue on Feb 4, 2026
    47a0c41
    8298802
  7. added a commit that references this issue on Feb 26, 2026
    af281a0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationtechnical-debttypescript

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions