Local Bug Finder is a VS Code extension that detects common JavaScript and TypeScript issues entirely offline using static analysis.
Features
- Real-time diagnostics for JavaScript and TypeScript
- Detects assignment inside conditionals like
if (x = 5) - Detects empty blocks in
if, loops, and other statements - Detects duplicate declarations in the same scope
- Detects unused variables
- Detects undefined variables
- Optional
console.logwarnings - Optional strict semicolon checking
- Output channel report for issue details
Project Structure
package.jsontsconfig.jsonsrc/extension.tssrc/diagnosticEngine.tssrc/rules/jsRules.ts
Setup
- Open this folder in VS Code.
- Run
npm install. - Run
npm run compile.
Run in VS Code
- Open the project in VS Code.
- Press
F5to launch a development host. - Open a JavaScript or TypeScript file.
- The extension will analyze the file automatically and show diagnostics.
- Use the
Bug Finder Reportoutput channel to see the issue list.
Package as .vsix
npm install
npm run compile
npx @vscode/vsce package
Publish to Marketplace
- Create a publisher in the Visual Studio Code Marketplace.
- Run
npx @vscode/vsce publish. - Provide your Personal Access Token when prompted.
Settings
In VS Code settings, search for localBugFinder.
localBugFinder.strictMode: enable stricter analysis rules.localBugFinder.enableConsoleLogWarning: warn onconsole.logusage.localBugFinder.enabledRules.*: enable or disable specific checks.
Monetization Ideas
- Offer paid rule packs for advanced security patterns.
- Provide premium rule sets for team code quality enforcement.
- Bundle Local Bug Finder with developer tooling or refactoring helpers.
Notes
- No external APIs are used.
- All analysis runs locally.
- The rule engine uses AST parsing and custom validation logic.