Skip to content

fix: resolve ESLint errors in config, server, and CaddyService#23

Merged
jgarzik merged 1 commit into
mainfrom
updates
Mar 4, 2026
Merged

fix: resolve ESLint errors in config, server, and CaddyService#23
jgarzik merged 1 commit into
mainfrom
updates

Conversation

@jgarzik
Copy link
Copy Markdown
Owner

@jgarzik jgarzik commented Mar 4, 2026

  • Use nullish coalescing where safe, suppress where || is intentional
  • Replace as number cast with Number() conversion in server.ts
  • Use T[] array syntax instead of Array in CaddyService
  • Add explicit Record type to fix no-unnecessary-condition lint error

- Use nullish coalescing where safe, suppress where || is intentional
- Replace `as number` cast with Number() conversion in server.ts
- Use T[] array syntax instead of Array<T> in CaddyService
- Add explicit Record type to fix no-unnecessary-condition lint error

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jgarzik jgarzik requested a review from Copilot March 4, 2026 15:11
@jgarzik jgarzik self-assigned this Mar 4, 2026
@jgarzik jgarzik added the bug Something isn't working label Mar 4, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses ESLint/type-safety issues across configuration loading, server startup logic, and the Caddy integration service to keep the codebase compliant with the current lint rules without changing intended behavior.

Changes:

  • Add an explicit Record type for Docker network inspection results to satisfy no-unnecessary-condition.
  • Replace a TypeScript as number cast with an explicit Number() conversion when restoring Caddy routes on startup.
  • Normalize array type syntax in CaddyService.restoreRoutes to T[] and document an intentional || usage in config with an ESLint suppression.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/services/CaddyService.ts Tightens types around Docker network inspection and updates array type syntax for restoreRoutes.
src/server.ts Makes port handling explicit during Caddy route restoration by converting to number via Number().
src/config.ts Suppresses prefer-nullish-coalescing where `

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jgarzik jgarzik merged commit e512296 into main Mar 4, 2026
7 checks passed
@jgarzik jgarzik deleted the updates branch March 4, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants