Overview
This issue tracks the work needed to extend the noZeroFractions lint rule — currently implemented for JavaScript/TypeScript — to other languages where trailing zeros in numeric literals are also redundant.
Originally discussed in #9817.
TODO
Out of scope
- GraphQL: GraphQL distinguishes between float and integer types —
1.0 is a Float while 1 is an Int, so removing trailing zeros would change semantics. This rule should not be applied to GraphQL.
References
Overview
This issue tracks the work needed to extend the
noZeroFractionslint rule — currently implemented for JavaScript/TypeScript — to other languages where trailing zeros in numeric literals are also redundant.TODO
noZeroFractions. Stylelint has a comparable rule:number-no-trailing-zeros.noZeroFractions. Trailing zeros in JSON numeric values (e.g.1.0) are redundant and can be simplified to1.Out of scope
1.0is aFloatwhile1is anInt, so removing trailing zeros would change semantics. This rule should not be applied to GraphQL.References
noZeroFractions#9817