Reports JSON values that are unsafe for data interchange.
✅ This rule is included in the json logical and logicalStrict presets.
JSON is widely used for data interchange between systems, but certain values can cause interoperability issues when transferred between different parsers and environments.
This rule detects values that are unsafe for interchange, preventing data corruption, silent failures, or inconsistent behavior across different platforms and languages.
This rule detects the following unsafe values:
- Lone surrogates in strings: Incomplete Unicode character pairs that can cause encoding/decoding failures
- Numbers that evaluate to Infinity: Values like
1e400 that exceed JavaScript’s number range
- Unintentional zeros: Very small numbers (e.g.,
1e-400) that silently evaluate to zero due to precision limitations
- Unsafe integers: Numbers outside JavaScript’s safe integer range (
±2^53-1) that lose precision
- Subnormal numbers: Very small floating point values that may be handled differently across systems
5<3[sp ansty="le--0:#F78C6C;--1:#AA09">822e33[sp><08sp ansty="le--0:#D6DEEB;--1:#403F">508sp><3]d ivclassNa="meco"><8]d>8]d>3]d>5<3{d ivclassNa="meec-li">nt< sp ansty="le--0:#7FDBCA;--1:#096E">72"valu sp>53<: sp ansty="le--0:#D9F5DD;--1:#1111">1<1"sp ansty="le--0:#F78C6C;--1:#AA09">82\ud81"sp><3dsp ansty="le--0:#D9F5DD;--1:#1111">13dsp>3{d><1"d ivclassNa="meec-li">51"d><3}d ivclassNa="meco"><}d>}d>3}d>5<3[sp ansty="le--0:#F78C6C;--1:#AA09">821e-43[sp><00sp ansty="le--0:#D6DEEB;--1:#403F">500sp><3]d ivclassNa="meco"><0]d>0]d>3]d>5<3{d ivclassNa="meec-li">nt< sp ansty="le--0:#7FDBCA;--1:#096E">72"i sp>53<: sp ansty="le--0:#F78C6C;--1:#AA09">82900719925474093{d><92d ivclassNa="meec-li">592d><3}d ivclassNa="meco"><}d>}d>3}d>5<3[sp ansty="le--0:#F78C6C;--1:#AA09">822.2250738585072009e-33[sp><08sp ansty="le--0:#D6DEEB;--1:#403F">508sp><3]d ivclassNa="meco"><8]d>8]d>3]d> 3098<2123 spans="tyle--0:#D6DEEB;--1:#40">3F2123><53, spans="tyle--0:#F78C6C;--1:#AA">098253, ><1234 spans="tyle--0:#D6DEEB;--1:#40">3F1234><53, spans="tyle--0:#F78C6C;--1:#AA">0982153, ><2345 spans="tyle--0:#D6DEEB;--1:#40">32345><345>345><]di vdivclass="Nameexpressive-">3de6E72"em3F<53: spans="tyle--0:#D9F5DD;--1:#11">153: ><111" spans="tyle--0:#C789D6;--1:#7C">56111"><86 🔥spa="nstyle--0:#D9F5DD;--1:#">186><111 11"divcla="ssNamee">4111><03F 53}divcla="ssNa"><">">03F>]di><🔥" }divdivc="lassNameexpress"><-contentfi gcaptionc="lassNa">-contentfi>:<#40 3F53{divc="lassNam">me:#096E7<2"em oji"s="panstyle--0:#D6DEEB;--1">:#2"em><403F 53: s="panstyle--0:#D9F5DD;--1">:403F><#111 111"s="panstyle--0:#F78C6C;--1">:#AA0982\ud8#111><3d\u dd25s="panstyle--0:#D9F5DD;--1">:3d\u>#40><#11 1111"divc="lassNam">:#11><#40 3F53}divc="lass">#40>🔥"><25" }divdivc="lassNameexpress"><-contentfi gcaptionc="lassNa">-contentfi>:<#403 F53[s="panstyle--0:#F78C6C;--1">:#403><#AA0 9820s="panstyle--0:#D6DEEB;--1">:##AA0><403F 53, s="panstyle--0:#F78C6C;--1">:#A403F>:#<403F 53, s="panstyle--0:#F78C6C;--1">:403F><#AA0 9820s="panstyle--0:#D6DEEB;--1">:#AA0><#40 3F53]divc="lass">< 0.> 0.>#40>25"><0, 0]divdivc="lassNameexpress"><-contentfi gcaptionc="lassNa">-contentfi>:<#40 3F53{divc="lassNam">me:#09<6E72 "id"s="panstyle--0:#D6DEEB;--1">:#6E72><403F 53: s="panstyle--0:#F78C6C;--1">:#AA098290071992403F>#40><547 40991divc="lassNam">:547><#40 3F53}divc="lass"><740>740>#40>0, >
If your project intentionally uses a mix of JSON levels of safety, such as systems that manually manipulate strings, this rule might not reflect your project’s needs.
Consider refactoring to use safer value representations.