Skip to content

Bug: no-unsafe-values does not report JSON5 Infinity values #277

Description

@electrohyun

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
import json from "@eslint/json";

export default [
  {
    files: ["**/*.json5"],
    plugins: { json },
    language: "json/json5",
    rules: { "json/no-unsafe-values": "error" },
  },
];
[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

  • I am willing to submit a pull request for this issue.

AI acknowledgment

  • I did not use AI to generate this issue report.
  • (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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingrepro:neededThis issue should include a reproducible example

Type

No type

Projects

  • Status
    Needs Triage

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions