J'ai juste update le cutie.js, CONNARD
Ah oui, j'ai aussi add le info.js, qui est merdique d'ailleurs
This commit is contained in:
Syxpi
2025-10-11 22:06:46 +02:00
parent 14d4df5a40
commit b5cba1c318
283 changed files with 15040 additions and 12924 deletions

View File

@@ -189,9 +189,32 @@ module.exports = {
* @returns {boolean} true if they do not match
*/
function baseTenLosesPrecision(node) {
const normalizedRawNumber = convertNumberToScientificNotation(
getRaw(node),
);
const rawNumber = getRaw(node).toLowerCase();
/*
* If trailing zeros equal the exponent, this is a valid representation
* like "9.00e2" where 00 = 2 (meaning 9.00 * 10^2 = 900)
* https://github.com/eslint/eslint/issues/19957
*/
if (rawNumber.includes(".") && rawNumber.includes("e")) {
const parts = rawNumber.split("e");
const coefficient = parts[0];
const exponent = parseInt(parts[1], 10);
// Count trailing zeros after decimal
const decimalParts = coefficient.split(".");
if (decimalParts.length === 2) {
const decimalPart = decimalParts[1];
const trailingZeros = decimalPart.match(/0*$/u)[0].length;
if (trailingZeros === exponent) {
return false;
}
}
}
const normalizedRawNumber =
convertNumberToScientificNotation(rawNumber);
const requestedPrecision = normalizedRawNumber
.split("e")[0]
.replace(".", "").length;