Skip to content
| Marketplace
Sign in
Visual Studio Code>Linters>Web Metrics AINew to Visual Studio Code? Get it now.
Web Metrics AI

Web Metrics AI

Ankur Singh

|
7 installs
| (1) | Free
AI-powered web performance metrics and inline improvements
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Web Metrics AI - VS Code Extension

AI-powered web performance metrics and inline improvements with real-time analysis for HTML, CSS, JavaScript, TypeScript, and React files.

Features

🚀 Real-time Performance Analysis

  • HTML Analysis: Missing alt tags, lazy loading, render-blocking scripts, viewport meta
  • CSS Analysis: Expensive properties, !important usage, vendor prefixes
  • JavaScript/TypeScript Analysis: Console logs, wildcard imports, inefficient DOM queries
  • React Analysis: Missing keys, inefficient re-renders, styled-components optimization

🤖 AI-Powered Suggestions

  • Multi-provider Support: OpenAI, Anthropic, and local AI models
  • Context-aware Recommendations: Analyzes code context for specific improvements
  • Code Examples: Provides actionable code snippets with explanations
  • Impact Assessment: Shows expected performance improvements

💡 Inline Hints

  • Real-time Feedback: Performance hints appear as you type
  • Visual Indicators: Icons and tooltips for different issue types
  • Severity Levels: Error, warning, and info classifications
  • Quick Actions: Click hints to get AI suggestions

⚙️ Configuration

  • Enable/Disable: Toggle extension features
  • AI Provider Selection: Choose your preferred AI service
  • API Key Management: Secure storage of API credentials
  • Inline Hints Control: Customize hint display preferences

Installation

From VS Code Marketplace

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X)
  3. Search for "Web Metrics AI"
  4. Click Install

Manual Installation

  1. Download the .vsix file from releases
  2. In VS Code, go to Extensions
  3. Click the "..." menu and select "Install from VSIX..."
  4. Choose the downloaded file

Quick Start

  1. Open a web file (HTML, CSS, JS, TS, React)
  2. See inline hints appear automatically
  3. Click on hints to get AI suggestions
  4. Use commands from Command Palette:
    • Web Metrics AI: Analyze Performance
    • Web Metrics AI: Toggle Inline Hints
    • Web Metrics AI: Get AI Suggestion

Configuration

AI Provider Setup

OpenAI

  1. Get an API key from OpenAI
  2. Set webMetricsAI.apiKey in settings
  3. Set webMetricsAI.aiProvider to "openai"

Anthropic

  1. Get an API key from Anthropic
  2. Set webMetricsAI.apiKey in settings
  3. Set webMetricsAI.aiProvider to "anthropic"

Settings

{
  "webMetricsAI.enabled": true,
  "webMetricsAI.aiProvider": "openai",
  "webMetricsAI.apiKey": "your-api-key-here",
  "webMetricsAI.showInlineHints": true
}

Supported File Types

  • HTML (.html, .htm)
  • CSS (.css, .scss, .sass, .less)
  • JavaScript (.js, .mjs)
  • TypeScript (.ts, .tsx)
  • React (.jsx, .tsx)

Analysis Types

Performance Issues

  • Render-blocking resources
  • Missing lazy loading
  • Expensive CSS properties
  • Inefficient DOM queries

Accessibility Issues

  • Missing alt attributes
  • Missing viewport meta tags
  • Semantic HTML violations

Code Quality Issues

  • Console.log statements
  • Wildcard imports
  • !important usage
  • Unnecessary vendor prefixes

React-Specific Issues

  • Missing key props
  • Inefficient re-renders
  • Styled-components optimization
  • Hook dependencies

Commands

Command Description
webMetricsAI.analyzePerformance Run full performance analysis
webMetricsAI.toggleInlineHints Toggle inline hint display
webMetricsAI.getAISuggestion Get AI suggestion for selected issue

Status Bar

The extension adds a status bar item with a pulse icon that:

  • Shows extension status
  • Provides quick access to analysis
  • Displays current configuration

Webview Panel

The AI Suggestions panel provides:

  • Detailed issue information
  • AI-generated improvement recommendations
  • Code examples with explanations
  • One-click fix application
  • Links to relevant documentation

Development

Prerequisites

  • Node.js 16+
  • VS Code Extension Development Tools

Setup

git clone https://github.com/your-username/ai-web-metric-tool.git
cd ai-web-metric-tool
npm install
npm run compile

Testing

  1. Press F5 in VS Code to launch Extension Development Host
  2. Open a web file to test the extension
  3. Check the Output panel for extension logs

Building

npm run package  # Creates .vsix file
npm run publish  # Publishes to marketplace (requires publisher account)

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

MIT License - see LICENSE file for details

Support

  • Issues: GitHub Issues
  • Documentation: GitHub Wiki
  • Discussions: GitHub Discussions

Changelog

v0.0.1

  • Initial release
  • Real-time performance analysis
  • AI-powered suggestions
  • Inline hints for web files
  • Multi-language support (HTML, CSS, JS, TS, React)
  • Configurable AI providers
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft