no-floating-decimal
eslint
Safe autofix
eslint.config.js
export default [
{
rules: {
"no-floating-decimal": "error",
},
},
];This rule is deprecated. Check its documentation for a replacement before enabling it.
Disallow leading or trailing decimal points in numeric literals
var num = .5;
var num = 2.;
var num = -.7;var num = .5;
var num = 2.;
var num = -.7;var num = 0.5;
var num = 2.0;
var num = -0.7;Examples from the ESLint documentation.
no-floating-decimal
eslint
export default [
{
rules: {
"no-floating-decimal": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Require for-in loops to include an if statement
Enforce the use of variables within the scope they are defined
Require var declarations be placed at the top of their containing scope
Require grouped accessor pairs in object literals and classes
Disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead