dotenv-linter: ⚡️ Lightning-fast linter for .env files. Written in Rust 🦀

Updating dotenv-linter

webi dotenv-linter@stable

Use the @beta tag for pre-releases.

Windows 10

On Windows 10 you'll get an error like this:

execution cannot proceed run because vcruntime140.dll was not found

You need to download and install the Microsoft Visual C++ Redistributable.

Cheat Sheet

Dotenv Linter is a lightning-fast check for your .env files. It can rapidly detect and automatically fix issues.

By default, dotenv-linter checks all .env files in the current directory:

dotenv-linter

This is the same as the default behavior:

dotenv-linter .env .env.*

To lint .env files recursively, use -r:

dotenv-linter -r

For the complete usage, see the official Dotenv Linter Usage Guide.

How to automatically fix errors

Use the --fix flag.

dotenv-linter --fix

Backup files in the format of .env_0000000000 will be created by default. You can use --no-backup to skip this.

How to toggle linter rules

You can turn off certain linter checks with --skip options, for example:

dotenv-linter --skip QuoteCharacter --skip UnorderedKey

You can see the full list of linter rules with dotenv-linter --show-checks:

DuplicatedKey
EndingBlankLine
ExtraBlankLine
IncorrectDelimiter
LeadingCharacter
KeyWithoutValue
LowercaseKey
QuoteCharacter
SpaceCharacter
TrailingWhitespace
UnorderedKey

Contribute

Report an Issue Submit Installer