Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit afa4f37

Browse filesBrowse files
Trotttargos
authored andcommitted
tools: enable ESLint no-loss-of-precision rule
PR-URL: #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>
1 parent c9a4603 commit afa4f37
Copy full SHA for afa4f37

File tree

Expand file treeCollapse file tree

5 files changed

+6
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

5 files changed

+6
-0
lines changed
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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.