Error codes
Estimated reading time: 3 minutesTS88601 Error
Content may introduce an XSS vulnerability and must be marked with the safe
attribute.
An expression with type string or any is used as a child of a native element without
the safe attribute.
Variables prefixed with safe are exempt from this rule, as are expressions with safe
types (numbers, booleans, string literals...).
Add the safe attribute to escape the content:
TS88602 Error
The safe attribute causes this content to be escaped more than once.
The safe attribute is applied to an element whose children include JSX elements. This
would escape the HTML output of those child components, corrupting their markup.
Remove safe from the parent and wrap only the untrusted text in <Fragment safe>, which
escapes it without adding a wrapper element:
TS88603 Error
Content inside a Component must be escaped using escapeHtml().
An expression with type string or any is passed as a child to a component (uppercase
tag name). Unlike native elements, components cannot use the safe attribute directly on
children.
Escape manually using escapeHtml():
Or wrap the content in a Fragment with safe:
TS88604 Warning
The safe attribute is unused in this context.
The safe attribute is applied to an element whose children are all already safe types
(numbers, booleans, bigints, string literals, or JSX.Element). These types cannot
introduce XSS, so the escaping is redundant. When at least one child needs escaping, as in
<p safe>{name}{count}</p>, the attribute is in use and kita-html check reports
nothing.
Remove the safe attribute, since numbers are already safe: