JS Code Guardian
VS Code extension for JavaScript/TypeScript (and some embedded JS/TS cases like Vue/Svelte) that helps you catch syntax/keyword typos, offers one-click fixes, and adds useful inline information.
Features
1) Red diagnostics for keyword / syntax typos
The extension scans code and highlights identifiers that look like JavaScript syntax/keyword typos (example: funciton → function).

- Uses fuzzy matching (Damerau–Levenshtein) with context checks to reduce false positives.
- Shows additional “Correct syntax” info in the diagnostic related information when available.
2) Hover help + “Fix with JS Code Guardian”
When you hover over a highlighted issue, you get:
- Message like:
Unknown syntax "..." Did you mean "..."?
- A clickable action: [Fix with JS Code Guardian] (implemented via a trusted VS Code command).

3) One-click Quick Fix
From the diagnostic or Quick Fix menu, the extension performs an edit that replaces the wrong range with the computed fix.

Command id: jsCodeGuardian.fixIssue
4) Dim unused symbols
The extension applies text decorations (opacity) to:
- Unused bindings (variables, imports, functions, classes, parameters)
- Unused object properties in patterns

For calls where the runtime value can be evaluated statically (limited depth), it shows inline hints:
console.*(...) → inline text preview after the call
alert(...), confirm(...), prompt(...) → inline popup preview text after the call

Safe built-in methods are evaluated when their inputs are known, including string methods like toUpperCase(), array methods like map(), filter(), join(), slice(), number methods like toFixed(), plus Math.*, Object.keys(), Object.values(), and Array.isArray().
Supported languages
Based on the extension activation and language selectors:
javascript
typescript
javascriptreact
typescriptreact
vue
svelte
How it works (high level)
- Parses source using Babel parser with language-appropriate plugins.
- Uses rules + documentation from:
src/dataset/data.json
syntax: documentation for known APIs/keywords
corrections: typo → fix mappings for keyword/syntax identifiers
- If parsing fails, it falls back to a lightweight tokenization approach to still find likely keyword typos.