# no-invisible-character

Disallow invisible and misleading characters in source text

Invisible characters can conceal differences between identifiers or reorder displayed source.
Instead, you MUST remove them from syntax and comments and escape invisible characters inside literals.

- Category: security
- Level: error
- Fix: none
- Scope: module

## Reported

```ds title="main.ds"
const user‌Name = 1;
```

## Accepted

```ds title="main.ds"
const userName = 1;
```

## Prior art

- [Clippy · invisible_characters](https://rust-lang.github.io/rust-clippy/master/index.html#invisible_characters)
- [ESLint · no-irregular-whitespace](https://eslint.org/docs/latest/rules/no-irregular-whitespace)
- [rustc · text_direction_codepoint_in_comment](https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html#text_direction_codepoint_in_comment)
- [rustc · text_direction_codepoint_in_literal](https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html#text_direction_codepoint_in_literal)

[language/linter/src/rules/security/no_invisible_character.rs:7](https://github.com/destack-sh/destack/blob/main/language/linter/src/rules/security/no_invisible_character.rs#L7)
