π Enforce using the digits argument with Number#toFixed().
πΌ This rule is enabled in the following configs: β
recommended, βοΈ unopinionated.
π§ This rule is automatically fixable by the --fix CLI option.
It's better to make it clear what the value of the digits argument is when calling Number#toFixed(), instead of relying on the default value of 0.
// β
const string = number.toFixed();
// β
const string = number.toFixed(0);// β
const string = number.toFixed(2);