ESLint plugin (v1.1.2) that detects Trojan Source attacks using Unicode bidirectional (bidi) characters in JavaScript/TypeScript code. It provides a single rule `no-bidi` that flags maliciously embedded Unicode control characters that can cause code to appear differently to humans vs compilers. The plugin includes a recommended configuration for easy adoption. Updated as recently as November 2025 but core functionality (single rule) stable since 2021. Inspired similar rule `detect-bidi-characters` in eslint-plugin-security. No dependencies. Actively maintained.
npm install eslint-plugin-anti-trojan-sourceVerified import paths — ran on the pinned version, not inferred.
Install the plugin, configure via recommended or manual setup, and run ESLint to detect Trojan Source bidi attacks in your codebase.
Switch to `eslint-plugin-security` and enable the `detect-bidi-characters` rule for broader security scope.
Use legacy config format for now, or check plugin for flat config support. For flat config: `import antiTrojan from 'eslint-plugin-anti-trojan-source';` and include `antiTrojan.flatConfigs.recommended`.
Complement with other tools like `anti-trojan-source` CLI or use `eslint-plugin-security` for wider coverage.
Mark false positives with `// eslint-disable-next-line anti-trojan-source/no-bidi` (but ensure they are intentional).
Run `npm install --save-dev eslint-plugin-anti-trojan-source`.
Use `"anti-trojan-source/no-bidi"` in the rules object.
Ensure only one config file defines the plugin (e.g., move plugins to root .eslintrc).
No dependency data recorded yet.