Skip to content

TypeScript ESLint Phase 2a: Simple Non-Breaking Fixes (27 errors) #789

@justin808

Description

@justin808

Summary

Follow-up to PR #788, this phase addresses simple, safe ESLint fixes that don't change any runtime behavior or APIs.

Part of #783 - TypeScript ESLint Technical Debt resolution.

Errors to Fix (27 total)

1. Unused ESLint Directives (4 errors)

File: package/utils/debug.ts

Remove unused // eslint-disable-next-line no-console comments on lines 21, 27, 32, 38.

These directives are no longer needed since the rule is not triggering.

Impact: None - cleanup only

2. Explicit any Types (4 errors)

Files:

  • package/utils/getStyleRule.ts (lines 9, 15)
  • package/utils/helpers.ts (line 67)
  • package/utils/requireOrError.ts (line 9)

Replace any with unknown or proper types where the value type is not guaranteed.

Impact: Internal only - improves type safety

3. Redundant Type Constituents (19 errors)

File: package/types.ts
Lines with issues: 66, 74, 88, 91, 92, 96, 98, 104, 105

File: package/webpackDevServerConfig.ts
Lines with issues: 28, 32, 45, 50

Issue: Type unions like "all" | "auto" | string where string makes the specific strings redundant.

Examples:

// Current (redundant):
type Allowedhost = "all" | "auto" | string

// Fix option 1 (remove specific strings):
type Allowedhost = string

// Fix option 2 (remove string, make precise):
type Allowedhost = "all" | "auto"

Decision needed: Which approach to take? Option 2 is more type-safe but may be breaking if consumers pass arbitrary strings.

Impact: Type definitions become more precise. May reveal type errors in consuming code if we go with option 2.

Success Criteria

  • All 27 errors fixed
  • No runtime behavior changes
  • All tests pass
  • Type checking passes
  • Standard linting passes

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions