// Rule Definition
//------------------------------------------------------------------------------
+/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
type: "problem",
docs: {
description: "disallow literal numbers that lose precision",
- category: "Possible Errors",
- recommended: false,
+ recommended: true,
url: "https://eslint.org/docs/rules/no-loss-of-precision"
},
schema: [],
}
/**
- * Converts an integer to to an object containing the the integer's coefficient and order of magnitude
+ * Converts an integer to to an object containing the integer's coefficient and order of magnitude
* @param {string} stringInteger the string representation of the integer being converted
- * @returns {Object} the object containing the the integer's coefficient and order of magnitude
+ * @returns {Object} the object containing the integer's coefficient and order of magnitude
*/
function normalizeInteger(stringInteger) {
const significantDigits = removeTrailingZeros(removeLeadingZeros(stringInteger));
/**
*
- * Converts a float to to an object containing the the floats's coefficient and order of magnitude
+ * Converts a float to to an object containing the floats's coefficient and order of magnitude
* @param {string} stringFloat the string representation of the float being converted
- * @returns {Object} the object containing the the integer's coefficient and order of magnitude
+ * @returns {Object} the object containing the integer's coefficient and order of magnitude
*/
function normalizeFloat(stringFloat) {
const trimmedFloat = removeLeadingZeros(stringFloat);