Skip to content

numericTrailingZeros

Reports trailing zeros in numeric values.

✅ This rule is included in the yaml stylistic presets.

Trailing zeros in decimal numbers are unnecessary and can be removed without changing the numeric value. Removing trailing zeros makes numeric values more concise and easier to read.

price: 10.00
rate: 0.100
value: 1.50

This rule is not configurable.

If your project requires trailing zeros for formatting purposes (e.g., currency display or alignment), you may not need this rule. Some systems may require numeric values to have a specific number of decimal places for compatibility.

Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.