Case (In-)Sensitivity
on macOS

APFS is not case-sensitive by default :(

File renamings that only touch capitalization aren't being tracked by git (e.g. myComponent.tsx to MyComponent.tsx)

Problem #1: Git

Capitalization doesn't matter in file path imports (but it matters on other OSes!).

Problem #2: Imports

// Both lines equally work on macOS!
import Button from '../../components/button';
import Button from '../../components/Button';
  • enforce case sensitivity via git config (ignorecase = false)
  • this also affects e.g. .gitignore (hence we needed a fix to capitalize ".DS_Store" correctly)

Solution for Git

  • reformat our disks to use case-sensitivity? 😃
  • doesn't seem to be possible for system partitions… 😢

Solution for imports

  • at least Webpack is smart enough to warn us about ambiguous import paths

But…

kthxBye

Case Sensitivity on macOS

By Sebastian Herrmann

Case Sensitivity on macOS

…for Git and ES6 file paths.

  • 362
Loading comments...

More from Sebastian Herrmann