Find and manage deprecated code in your TypeScript and JavaScript projects
Ever wondered which methods in your codebase are deprecated? This extension helps you find all @deprecated tags in your TypeScript and JavaScript projects, making it easier to manage technical debt.
This extension uses the TypeScript Compiler API to properly parse your code and identify deprecated items. It finds methods, properties, classes, and functions marked with @deprecated JSDoc tags and presents them in an easy-to-navigate interface.
Useful when working with large codebases or inherited projects where you need to identify deprecated code.
β¨ Smart Scanning - Actually understands your TypeScript and JavaScript code, not just text matching
π Interactive Results - Clean table view with clickable navigation (no more Ctrl+P hunting)
π Powerful Filtering - Filter by name or file to find what you need quickly
π·οΈ Custom Tags - Define your own deprecation tags beyond @deprecated (e.g., @obsolete, @legacy)
βοΈ Configuration Support - Customize scanner behavior via .deprecatedtrackerrc or package.json
π« Ignore Management - Hide items you're not ready to deal with yet
π Quick Navigation - Jump straight to deprecated code with one click
π₯ Export Results - Export to CSV, JSON, or Markdown for reports and documentation
π Rescan Anytime - Re-run scans as your codebase changes
π Folder Scanning - Scan specific folders or files instead of entire project
πΎ State Persistence - Your filters and settings survive VS Code reloads
- Clone this repo
- Open in VS Code
- Press
F5to launch the Extension Development Host - Open a TypeScript project in the new window
- Run
Deprecated Tracker: Scan Projectfrom the command palette
Once installed, run the scan command and you'll see a panel with all deprecated items in your project. Click any item to jump to its location in your code.
Tip: Use the filters to narrow down results when working on specific files or features.
Or even faster: Right-click any folder in the Explorer and select "Scan for Deprecated" to scan just that folder!
- Open your TypeScript or JavaScript project in VS Code
- Press
Ctrl+Shift+P(orCmd+Shift+Pon Mac) - Type "Deprecated Tracker: Scan Project", "Scan Folder", or "Scan File"
- Review the results in the panel that opens
Or even faster: Right-click any folder or file in the Explorer and select "Scan for Deprecated"!
- By Name: Type the item name to see only matching results
- By File: Filter by filename or path
Sometimes you're aware of deprecated code but not ready to address it. You can:
- Ignore a specific method/property: Click "Ignore [kind]" next to any item
- Ignore an entire file: Click "Ignore File" to hide all items in that file
Ignored items won't appear in future scans. You can manage them later through the ignore manager.
Click "Manage Ignores" to see what you've ignored. Remove individual items or clear everything at once.
Beyond @deprecated, you can define custom tags:
- Click "Manage Custom Tags" in settings
- Add your tags:
- Tag Name: e.g.,
@obsolete,@legacy,@experimental - Label: Display name
- Description: What it means
- Color: For visual distinction
- Tag Name: e.g.,
- Enable/disable as needed
Pre-configured tags:
@obsolete- Outdated code that should be replaced@legacy- Old code kept for compatibility@experimental- Unstable features
Why use them:
- Categorize different types of deprecated code
- Track various kinds of technical debt
- Custom workflows for deprecation levels
Example usage in your code:
/**
* @obsolete Use the new PaymentServiceV2 instead
*/
export class PaymentService {
// ...
}
/**
* @legacy Kept for backward compatibility only
* @param oldFormat The legacy format
*/
function processLegacyData(oldFormat: string) {
// ...
}Note: The scanner validates custom tags to prevent conflicts with standard JSDoc tags like @param, @returns, etc.
Need to share deprecated items with your team or track them over time? Export your scan results:
- Click the Export βΌ button in the results panel
- Choose your format:
- CSV - For spreadsheet analysis in Excel/Google Sheets
- JSON - For CI/CD integration or programmatic processing
- Markdown - For documentation and reports
- Save to your desired location
Alternative: Use the Command Palette (Ctrl+Shift+P) and search for "Deprecated Tracker: Export Results"
You can customize scanner behavior by creating a .deprecatedtrackerrc file or adding a deprecatedTracker section to your package.json.
Create a .deprecatedtrackerrc file in your project root:
{
"trustedPackages": ["rxjs", "lodash", "@angular/core", "my-internal-lib"],
"excludePatterns": ["**/*.spec.ts", "**/*.test.ts", "**/test/**"],
"includePatterns": ["src/**/*.ts"],
"ignoreDeprecatedInComments": false,
"severity": "warning"
}Or add to your package.json:
{
"name": "my-project",
"version": "1.0.0",
"deprecatedTracker": {
"trustedPackages": ["custom-lib"],
"excludePatterns": ["**/*.test.ts"]
}
}- trustedPackages: Additional npm packages to whitelist (merged with defaults: rxjs, lodash, etc.)
- excludePatterns: Glob patterns for files to exclude from scanning (e.g.,
**/*.test.ts) - includePatterns: Glob patterns for files to include (when specified, only these files are scanned)
- ignoreDeprecatedInComments: Whether to ignore @deprecated tags in comments (future use)
- severity: Severity level -
'info','warning', or'error'(future use for diagnostics)
.deprecatedtrackerrc(if exists)package.jsonwithdeprecatedTrackerkey (if exists)- Default configuration (if no config files)
- VS Code 1.74.0 or newer
- A TypeScript project with
tsconfig.jsonor a JavaScript project withjsconfig.jsonin the workspace root
That's it! Works with any TypeScript or JavaScript project, regardless of framework.
Under the hood, this extension:
- Reads your
tsconfig.jsonorjsconfig.jsonto understand your project structure - Uses the TypeScript Compiler API to parse all your TypeScript and JavaScript files
- Walks through the AST looking for
@deprecatedJSDoc tags - Shows you what it finds in an easy-to-use interface
The scanning respects your TypeScript/JavaScript configuration, so it only looks at files that are actually part of your project.
Want to contribute or customize it? Here's how to get started:
- Node.js 18+ and npm 9+
- VS Code 1.74+
npm install
npm run compilenpm run dev # Watch mode for development
npm run build # Lint, format, and compile
npm run lint # Check for linting issues
npm run lint:fix # Auto-fix linting issues
npm run format # Format code with Prettier
npm test # Run tests
npm run test:watch # Run tests in watch mode
npm run test:coverage # Generate coverage reportPress F5 in VS Code to launch the extension in debug mode. A new window will open where you can test your changes.
- Requires
tsconfig.jsonorjsconfig.jsonin the workspace root - Supports TypeScript (
.ts,.tsx) and JavaScript (.js,.jsx,.mjs) files - Scans for
@deprecatedJSDoc tags (standard deprecation mechanism)
Found a bug? Have an idea? Pull requests are welcome!
- Fork the repo
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - feel free to use this however you want.
Made with β€οΈ for TypeScript developers who are tired of hunting for deprecated code manually