Invisible character
Invisible character. An invisible or direction-changing character. What you see is not what compiles.
This is how the comment reads inline, under the flagged line.
Why it matters
Zero-width and bidi control characters can make code read differently from how it runs (the Trojan Source attack) and break string comparisons.
What to do
Delete it. If you need the character, write it as an escape like \u200b.
Examples
if (role === "admin") {}if (role === "admin") {}What it catches
It reads a pattern on each line, aware of strings and comments. Languages: Any file. Scope: All files. These cases are the rule's own tests: the first set must be flagged and the second must not.
Flagged
const a = "xy";
const b = 1;
Left alone
const a = "\u200b";
Research
Zero-width and bidi control characters. They hide content from reviewers in code and commits.
Turn it off or change it
In a config file for the CLI, or in the API's rules field:
{
"rules": {
"disable": [
"invisible-char"
],
"severity": {
"invisible-char": "low"
}
}
}