GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — tools: enable ESLint no-loss-of-precision rule · nodejs/node@afa4f37

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .eslintrc.js
  • test
    • js-native-api/test_number
      • test.js
    • parallel
      • test-buffer-readdouble.js
      • test-util-format.js
      • test-util-inspect.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.eslintrc.js‎

Copy file name to clipboardExpand all lines: .eslintrc.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ module.exports = {
201201
'no-invalid-regexp': 'error',
202202
'no-irregular-whitespace': 'error',
203203
'no-lonely-if': 'error',
204+
'no-loss-of-precision': 'error',
204205
'no-misleading-character-class': 'error',
205206
'no-mixed-requires': 'error',
206207
'no-mixed-spaces-and-tabs': 'error',
Collapse file

‎test/js-native-api/test_number/test.js‎

Copy file name to clipboardExpand all lines: test/js-native-api/test_number/test.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ testNumber(-1233);
1919
testNumber(986583);
2020
testNumber(-976675);
2121

22+
/* eslint-disable no-loss-of-precision */
2223
testNumber(
2324
98765432213456789876546896323445679887645323232436587988766545658);
2425
testNumber(
2526
-4350987086545760976737453646576078997096876957864353245245769809);
27+
/* eslint-enable no-loss-of-precision */
2628
testNumber(Number.MIN_SAFE_INTEGER);
2729
testNumber(Number.MAX_SAFE_INTEGER);
2830
testNumber(Number.MAX_SAFE_INTEGER + 10);
Collapse file

‎test/parallel/test-buffer-readdouble.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-buffer-readdouble.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ assert.strictEqual(buffer.readDoubleLE(0), 1.0000000000000004);
3535
buffer[0] = 1;
3636
buffer[6] = 0;
3737
buffer[7] = 0;
38+
// eslint-disable-next-line no-loss-of-precision
3839
assert.strictEqual(buffer.readDoubleBE(0), 7.291122019556398e-304);
3940
assert.strictEqual(buffer.readDoubleLE(0), 5e-324);
4041

Collapse file

‎test/parallel/test-util-format.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-util-format.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ assert.strictEqual(
8585

8686
assert.strictEqual(
8787
util.format(
88+
// eslint-disable-next-line no-loss-of-precision
8889
'%d %s %i', 118059162071741130342, 118059162071741130342, 123_123_123),
8990
'118_059_162_071_741_140_000 118_059_162_071_741_140_000 123_123_123'
9091
);
Collapse file

‎test/parallel/test-util-inspect.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-util-inspect.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3187,6 +3187,7 @@ assert.strictEqual(
31873187
util.inspect.defaultOptions.numericSeparator = true;
31883188

31893189
assert.strictEqual(
3190+
// eslint-disable-next-line no-loss-of-precision
31903191
util.inspect(1234567891234567891234),
31913192
'1.234567891234568e+21'
31923193
);

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.