Your file name is wrong

GitHub

Let's normalize file extensions the way they should be used, not the way they're often misused.

The Problem

Many developers and so many projects unfortunately use inconsistent file naming patterns, especially for configuration files. We often see patterns like .env.development instead ofdevelopment.env.

.env, .dockerfile and others are actually file extensions, and it's a mystery why people start to suffix the file type and this page is trying to change this.

This creates confusion and inconsistency in codebases. Let's explore why the proper convention matters and how to fix it.

The Proper Convention

Incorrect Pattern

Adding purpose after the extension:

  • .env.development
  • Dockerfile.static
  • Makefile.local
  • .gitignore.template

Correct Pattern

Adding purpose before the extension:

  • development.env
  • static.dockerfile
  • local.makefile
  • template.gitignore

Common Examples

File TypeCommon (Incorrect)Proper (Correct)
Environment Variables.env.locallocal.env
Docker ConfigurationDockerfile.prodprod.dockerfile
Build ScriptsMakefile.cici.makefile
Git Configuration.gitignore.nodenode.gitignore
Shell Scriptssetup.sh.macosmacos.setup.sh

Why It Matters

Consistency
Maintaining a logical pattern

File extensions tell us what type of file we're looking at. The name before the extension should tell us its purpose or variant, not the other way around.

Filtering & Sorting
Better organization in file explorers

Proper naming allows files to be grouped by extension first, then sorted by their purpose, making them easier to find in directories with many files.

Command Line Efficiency
Easier to work with in the terminal

Commands like *.env will match all environment files regardless of their purpose, making shell operations more intuitive.

Tool Integration
Better compatibility with development tools

Many tools recognize files by their extensions. Proper naming ensures better syntax highlighting, linting, and other tooling support.

Try It Yourself

Convert your incorrectly named files to the proper convention: