mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
tools: enable ESLint no-loss-of-precision rule
PR-URL: https://github.com/nodejs/node/pull/41463 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
This commit is contained in:
1 parent
775bfd1579
commit
94abcbde8b
5 files changed
+6
No files matched your search
@@ -35,6 +35,7 @@ assert.strictEqual(buffer.readDoubleLE(0), 1.0000000000000004);
|
||||
buffer[0] = 1;
|
||||
buffer[6] = 0;
|
||||
buffer[7] = 0;
|
||||
// eslint-disable-next-line no-loss-of-precision
|
||||
assert.strictEqual(buffer.readDoubleBE(0), 7.291122019556398e-304);
|
||||
assert.strictEqual(buffer.readDoubleLE(0), 5e-324);
|
||||
|
||||
|
||||
@@ -85,6 +85,7 @@ assert.strictEqual(
|
||||
|
||||
assert.strictEqual(
|
||||
util.format(
|
||||
// eslint-disable-next-line no-loss-of-precision
|
||||
'%d %s %i', 118059162071741130342, 118059162071741130342, 123_123_123),
|
||||
'118_059_162_071_741_140_000 118_059_162_071_741_140_000 123_123_123'
|
||||
);
|
||||
|
||||
@@ -3187,6 +3187,7 @@ assert.strictEqual(
|
||||
util.inspect.defaultOptions.numericSeparator = true;
|
||||
|
||||
assert.strictEqual(
|
||||
// eslint-disable-next-line no-loss-of-precision
|
||||
util.inspect(1234567891234567891234),
|
||||
'1.234567891234568e+21'
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user