Skip to content

Proposal: Enforce Exact Import Path Casing #1471

@jimmywarting

Description

@jimmywarting

Add a built-in lint rule that enforces exact casing of import paths to match the filesystem. The rule should be enabled by default and require no configuration.


Problem

On case-insensitive filesystems (macOS, Windows), import paths that do not match the actual file casing work locally but fail on case-sensitive systems (Linux) at runtime, resulting in 404 errors or module resolution failures.

Example:

import './myComponent.js'

Actual file on disk:

mycomponent.js

This works locally but fails in production. Such errors are silent during development and only appear after deployment.


Default Behavior

  • Enabled by default
  • No configuration required

Rationale

Mismatched import casing is always a cross-platform bug. Enforcing exact casing at lint time prevents deployment failures and ensures consistent behavior across all operating systems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions