persona-community-5/.pnpm-store/v3/files/0f/adb77657d36c74a5a89937a8e9c01be504d2ff2da091367d246e1ec37749540f9e0cfd25d096d0118bb8a0643ff426b732ce78b070e945dce8786e112d03ac
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

35 lines
1.2 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = require("../util");
const getESLintCoreRule_1 = require("../util/getESLintCoreRule");
const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('no-loss-of-precision');
exports.default = (0, util_1.createRule)({
name: 'no-loss-of-precision',
meta: {
type: 'problem',
docs: {
description: 'Disallow literal numbers that lose precision',
recommended: 'recommended',
extendsBaseRule: true,
},
hasSuggestions: baseRule.meta.hasSuggestions,
schema: [],
messages: baseRule.meta.messages,
},
defaultOptions: [],
create(context) {
const rules = baseRule.create(context);
function isSeparatedNumeric(node) {
return typeof node.value === 'number' && node.raw.includes('_');
}
return {
Literal(node) {
rules.Literal({
...node,
raw: isSeparatedNumeric(node) ? node.raw.replace(/_/g, '') : node.raw,
});
},
};
},
});
//# sourceMappingURL=no-loss-of-precision.js.map