8000 linter(no-loss-of-precision): False Positive 1000000000000000128 · Issue #11436 · oxc-project/oxc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

linter(no-loss-of-precision): False Positive 1000000000000000128 #11436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
magic-akari opened this issue Jun 2, 2025 · 4 comments · Fixed by #11437
Closed

linter(no-loss-of-precision): False Positive 1000000000000000128 #11436

magic-akari opened this issue Jun 2, 2025 · 4 comments · Fixed by #11437
Assignees

Comments

@camc314
Copy link
Contributor
camc314 commented Jun 2, 2025

I've filed an issue on the eslint side for this, as I believe oxlint is correctly reporting an error here.

Image

Furthermore I get a TS diagnostic when I put this number into my editor

Image

It looks like it's something related to that specific number in eslint? a digit less/more and the diagnostic is reported

8000

@camc314 camc314 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 2, 2025
@camc314
Copy link
Contributor
camc314 commented Jun 2, 2025

Also, how did you run into this case out of interest?

@magic-akari
Copy link
Contributor Author

I think the implementation in ESLint is correct. My example code includes toFixed; you can run it to verify.
I discovered this in a note within the ECMAScript Spec:
https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec-number.prototype.tofixed

@camc314 camc314 reopened this Jun 2, 2025
@camc314
Copy link
Contributor
camc314 commented Jun 2, 2025

this feels very silly but basically the number gets coerced to 1000000000000000128 when performint operations on it?

> 1000000000000000120 - 1000000000000000128
0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0