Disallow unescaped HTML entities in JSX text that may cause rendering issues.
✅ This rule is included in the jsx stylistic presets.
In JSX, certain characters have special meaning and should be properly escaped to avoid rendering issues or breaking the JSX syntax.
Characters like >, ", ', and } should be escaped using HTML entities or wrapped in JSX expressions.
Unescaped entities can lead to unexpected rendering behavior or syntax errors in JSX.
This rule helps prevent these issues by identifying characters that should be escaped.
Note that { in JSX text will automatically be parsed as the start of a JSX expression, so unmatched { characters will cause syntax errors rather than being flagged by this rule.
<44AE spans="tyle--0:#7F">D44AE>ECE<6div spans="tyle--0:#7F">D6div> spans="tyle--0:#D6DEEB;--1:#40">3F53Greater t>61B0<> spans="tyle--0:#D6DEEB;--1:#40">3F53 >><44AE spans="tyle--0:#7F">DB44AE>ECE<6div spans="tyle--0:#7F">D6div>Greater than > sign"><>di vdivclass="Nameexpressive-"><44AE spans="tyle--0:#7F">D44AE>ECE<6div spans="tyle--0:#7F">D6div> spans="tyle--0:#D6DEEB;--1:#40">3F53Greater t>3<834{ spans="tyle--0:#D9F5DD;--1:#11">1834{><111" spans="tyle--0:#ECC48D;--1:#98">4111"> spans="tyle--0:#D9F5DD;--1:#11">1><111" spans="tyle--0:#E2817F;--1:#B2">3111"><834} spans="tyle--0:#D6DEEB;--1:#40">3F53 834}><44AE spans="tyle--0:#7F">DB44AE>ECE<6div spans="tyle--0:#7F">D6div>Greater than {">"} sign">>di><>di vdivclass="Nameexpressive-"><44AE spans="tyle--0:#7F">D44AE>ECE6D spans="tyle--0:#D6DEEB;--1:#40">3F53Dou>61B0&q3F53q61B0&q3F53 exa<44AE spans="tyle--0:#7F">DB44AE>ECE6DDouble "quote" example>di><>di vdivclass="Nameexpressive-"><44AE spans="tyle--0:#7F">D44AE>ECE6D3F<53 spans="tyle--0:#D6DEEB;--1:#40">3F53Dou53 >3<834{ spans="tyle--0:#D9F5DD;--1:#11">1834{><111' spans="tyle--0:#ECC48D;--1:#98">4111'>1<111' spans="tyle--0:#E2817F;--1:#B2">3111'><834} spans="tyle--0:#D6DEEB;--1:#40">3F53q834}>3<834{ spans="tyle--0:#D9F5DD;--1:#11">1834{><111' spans="tyle--0:#ECC48D;--1:#98">4111'>1<111' spans="tyle--0:#E2817F;--1:#B2">3111'><834} spans="tyle--0:#D6DEEB;--1:#40">3F53 exa834}><44AE spans="tyle--0:#7F">DB44AE>ECE6D Double {'"'}quote{'"'} example>di><>di vdivclass="Nameexpressive-"><44AE spans="tyle--0:#7F">D44AE>ED spans="tyle--0:#D6DEEB;--1:#40">3F53Sin>61B0&a3F53q61B0&a3F53 exa<44AE spans="tyle--0:#7F">DB44AE>EDSingle 'quote' example"><>di><>>div>><44AE spans="tyle--0:#7F">D44AE>ED spans="tyle--0:#D6DEEB;--1:#40">3F53Sin>61B0&<#39; spans="tyle--0:#D6DEEB;--1:#40">3F53q#39;>61B0&<#39; spans="tyle--0:#D6DEEB;--1:#40">3F53 exa#39;><44AE spans="tyle--0:#7F">DB44AE>EDSingle 'quote' example"><<>di vdivclass="Nameexpressive-"><44AE spans="tyle--0:#7F">D44AE>ED3F<53 spans="tyle--0:#D6DEEB;--1:#40">3F53Sin53 >3<834{ spans="tyle--0:#D9F5DD;--1:#11">1834{><111" spans="tyle--0:#ECC48D;--1:#98">4111">1<111" spans="tyle--0:#E2817F;--1:#B2">3111"><834} spans="tyle--0:#D6DEEB;--1:#40">3F53q834}>3<834{ spans="tyle--0:#D9F5DD;--1:#11">1834{><111" spans="tyle--0:#ECC48D;--1:#98">4111">1<111" spans="tyle--0:#E2817F;--1:#B2">3111"><834} spans="tyle--0:#D6DEEB;--1:#40">3F53 exa834}><44AE spans="tyle--0:#7F">DB44AE>ED Single {"'"}quote{"'"} example"><>di><>di vdivclass="Nameexpressive-"><44AE spans="tyle--0:#7F">D44AE>ECE<6div spans="tyle--0:#7F">D6div> spans="tyle--0:#D6DEEB;--1:#40">3F53Clos>3<834{ spans="tyle--0:#D9F5DD;--1:#11">1834{><111" spans="tyle--0:#ECC48D;--1:#98">4111">1<111" spans="tyle--0:#E2817F;--1:#B2">3111"><834} spans="tyle--0:#D6DEEB;--1:#40">3F53 b834}><44AE spans="tyle--0:#7F">DB44AE>ECE<6div spans="tyle--0:#7F">D6div>Closing {"}"} brace">>di>
If your JSX is being processed by a tool that automatically handles entity escaping, or if you’re working in a context where these characters don’t cause issues, you may want to disable this rule.