eslint / eslint/json

Bug: `no-unsafe-values` does not report JSON5 `Infinity` values

Open
#277 2 comments 0 reactions 1 assignee Claimed by @electrohyun View on GitHub
accepted bug repro:yes
Dominant language
JavaScript
Stars
121
Forks
30
Avg merge
2d 5h
Merged PRs (30d)
6

Description

### Environment

ESLint version: v10.9.1
@eslint/json version: v2.1.0
Node version: v22.22.3
npm version: v10.8.2
Operating System: Ubuntu 20.04.0 LTS (StackBlitz)

### Which language are you using?

json5

### What did you do?

Configuration

```js
import json from "@eslint/json";

export default [
{
files: ["**/*.json5"],
plugins: { json },
language: "json/json5",
rules: { "json/no-unsafe-values": "error" },
},
];
```

```json5
[2e308, +2e308, -2e308, Infinity, +Infinity, -Infinity]
```

### What did you expect to happen?

All six values should be reported.

### What actually happened?

Image

Only 2e308, +2e308, and -2e308 are reported.

### Link to Minimal Reproducible Example

https://stackblitz.com/edit/stackblitz-starters-jgyzylpm?file=index.js

### Participation

- [x] I am willing to submit a pull request for this issue.

### AI acknowledgment

- [ ] I did not use AI to generate this issue report.
- [x] (If the above is not checked) I have reviewed the AI-generated content before submitting.

### Additional comments

This is something I thought about while working on #266, and after looking into it, it appears to be a bug. If you agree, I’d be happy to submit a PR right away.


Disclosure: I'm a participant of [open source contribution program OSSCA](https://github.com/eslint-ossca)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.