Environment
ESLint version: 10.10.0
@eslint/json version: 2.1.0
Node version: 22.16.0
npm version: 11.17.0
Operating System: darwin 25.5.0
Which language are you using?
json
What did you do?
Configuration
import json from "@eslint/json";
export default [
{
files: ["**/*.json"],
plugins: { json },
language: "json/json",
rules: {
"json/no-unnormalized-keys": ["error", { form: "NFKC" }],
},
},
];
What did you expect to happen?
(Before running npx eslint test.json --fix)
The autofix should produce valid JSON {"\"": 1, "\\": 2}.
What actually happened?
(After running npx eslint test.json --fix)
The autofix produces invalid JSON {""": 1, "\": 2}.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/stackblitz-starters-vvepisbw?file=test.json (You can reproduce by running npx eslint test.json --fix)
Participation
AI acknowledgment
I used AI to check the English grammar in the issue description I wrote myself. The technical decisions in those responses were my own.
For context, Microsoft Japanese IME supports full-width punctuation, so text such as "りんご" or "abc" can be entered. I had encountered this form while using Japanese input before, which prompted me to test the full-width quotation mark here.
Additional comments
From my reading of the rule’s implementation and documentation, no-unnormalized-keys rule is intended to catch cases where different Unicode representations could cause key lookup or comparison mismatches.
However, it now includes an autofix that normalizes object keys according to the NFC, NFD, NFKC, or NFKD, so I opened this issue because I understood converting " to " to be within the intended scope of that autofix.
These characters may occur in practice through full-width input modes and conversions in Japanese and Chinese IMEs, so I think the autofix should preserve valid JSON when normalizing them.
Disclosure: I'm a participant of open source contribution program OSSCA
Environment
ESLint version: 10.10.0
@eslint/json version: 2.1.0
Node version: 22.16.0
npm version: 11.17.0
Operating System: darwin 25.5.0
Which language are you using?
json
What did you do?
Configuration
{ """: 1, "\": 2 }What did you expect to happen?
(Before running
npx eslint test.json --fix)The autofix should produce valid JSON
{"\"": 1, "\\": 2}.What actually happened?
(After running
npx eslint test.json --fix)The autofix produces invalid JSON
{""": 1, "\": 2}.Link to Minimal Reproducible Example
https://stackblitz.com/edit/stackblitz-starters-vvepisbw?file=test.json (You can reproduce by running
npx eslint test.json --fix)Participation
AI acknowledgment
I used AI to check the English grammar in the issue description I wrote myself. The technical decisions in those responses were my own.
For context, Microsoft Japanese IME supports full-width punctuation, so text such as "りんご" or "abc" can be entered. I had encountered this form while using Japanese input before, which prompted me to test the full-width quotation mark here.
Additional comments
From my reading of the rule’s implementation and documentation,
no-unnormalized-keysrule is intended to catch cases where different Unicode representations could cause key lookup or comparison mismatches.However, it now includes an autofix that normalizes object keys according to the
NFC,NFD,NFKC, orNFKD, so I opened this issue because I understood converting"to"to be within the intended scope of that autofix.These characters may occur in practice through full-width input modes and conversions in Japanese and Chinese IMEs, so I think the autofix should preserve valid JSON when normalizing them.
Disclosure: I'm a participant of open source contribution program OSSCA