🟠 DupliMark
DupliMark is a lightweight Visual Studio Code extension that highlights duplicate variable and function declarations in your JavaScript and JSX code. It helps you catch accidental re-declarations early and keeps your code clean and bug-free.
✨ Features
- 🔍 Real-time detection of duplicate
let
, const
, var
, function
, and arrow function declarations
- ✅ Highlights both
exports.name
and module.exports.name
- 🧠 Skips built-in globals like
console
, setTimeout
, etc.
- 🎯 Underlines only declarations (not usages) with a subtle orange border
- 🟧 Highlights are non-intrusive, ideal for focused development
📂 Supported File Types
Language |
Extensions |
JavaScript |
.js |
JavaScript React |
.jsx |
TypeScript support coming soon.
📸 DupliMark Examples
Examples of duplicate variable and function declarations that DupliMark will highlight in your JavaScript/JSX code.
❗ Duplicate Variables
const name = 'Ajith';
let name = 'Arun'; // ⛔ Duplicate declaration detected
let user = 'Ajith';
let user = 'Arun'; // ⛔ Duplicate let
const id = 101;
const id = 102; // ⛔ Duplicate const
var age = 25;
var age = 30; // ⛔ Duplicate var
❗ Mixed Declaration Types (Still Duplicate)
let email = 'ajith@example.com';
const email = 'arun@example.com'; // ⛔ Duplicate variable name across different types
var token = 'abc123';
let token = 'xyz456'; // ⛔ Duplicate name using var + let
❗ Duplicate Functions
function getName() {
return 'Ajith';
}
function getName() {
return 'Arun'; // ⛔ Duplicate function name detected
}
✅ What It Detects
Pattern |
Example |
Detected |
Same variable redeclared |
let x; let x; |
✅ Yes |
Mixed declaration styles |
const x; var x; |
✅ Yes |
Arrow vs regular function |
const x = () => {}; function x() {} |
✅ Yes |
Exports vs local function |
exports.x = () => {}; function x() {} |
✅ Yes |
Usage only (no new declaration) |
console.log(x); |
❌ No |
Scoped variables (in different blocks) |
if (true) { let x = 1; } let x = 2; |
❌ No |
🚫 Not Highlighted
const email = 'user@example.com';
console.log(email); // ✅ Just usage
function greet() {
const email = 'internal@example.com'; // ✅ Block-scoped, allowed
}
🚀 Getting Started
Install from VS Code Marketplace:
- Open Visual Studio Code
- Go to the Extensions Panel
- Search for:
DupliMark
- Click Install
Or install via CLI:
code --install-extension duraiDev.duplimark
🔧 Configuration
No configuration required. It works out of the box on .js
and .jsx
files.
🧪 Planned Features
- [ ] TypeScript & TSX support
- [ ] Rename/fix suggestions
- [ ] Customizable highlight styles
- [ ] Multi-scope detection
🧑💻 Author
Built with ❤️ by [Durai Raja]
Found a bug or have suggestions? Open an issue or submit a pull request!
📬 Feedback
If you like DupliMark, don’t forget to ⭐️ the extension on the Marketplace and share it with your team!