Skip to content
| Marketplace
Sign in
Visual Studio Code>Linters>Path CheckerNew to Visual Studio Code? Get it now.
Path Checker

Path Checker

Nadeem Khan

|
6 installs
| (0) | Free
Validates file paths in your code and highlights paths that don't exist in the workspace
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Path Checker

A VS Code extension that validates file paths in your code and highlights paths that don't exist in the workspace.

Features

  • 🔍 Automatic Path Detection: Detects file paths in various formats:

    • Import/require statements: import './file', require('./file')
    • Quoted paths: "./path/to/file", '../path/to/file'
    • Relative paths: ./file, ../folder/file
    • Absolute paths: /absolute/path/to/file
  • ⚠️ Visual Feedback: Invalid paths are highlighted with:

    • Red wavy underline
    • Hover tooltip showing "Path not found in workspace"
    • Subtle background highlight
  • ⚙️ Configurable: Customize the extension behavior:

    • Enable/disable path checking
    • Specify file extensions to check
    • Customize decoration color
  • 🚀 Smart Resolution: Automatically resolves paths:

    • Relative to current file
    • Relative to workspace root
    • With common file extensions (.js, .ts, .jsx, .tsx, etc.)
    • Index files (index.js, index.ts, etc.)

Installation

From Source

  1. Clone this repository
  2. Run npm install to install dependencies
  3. Run npm run compile to build the extension
  4. Press F5 in VS Code to launch the Extension Development Host

From VSIX (when published)

  1. Download the .vsix file
  2. In VS Code, go to Extensions view
  3. Click "..." menu → "Install from VSIX..."
  4. Select the downloaded file

Usage

Once installed, the extension automatically activates when you open a file. It will:

  1. Scan the file for path references
  2. Validate each path against your workspace
  3. Highlight invalid paths with a red wavy underline
  4. Show a tooltip when you hover over invalid paths

Example

// Valid path - no highlight
import { Component } from './components/MyComponent';

// Invalid path - highlighted in red
import { Utils } from './utils/nonexistent';

// Also works with require
const config = require('./config.json'); // Valid
const missing = require('./missing.js'); // Invalid

Extension Settings

This extension contributes the following settings:

  • pathChecker.enabled: Enable/disable path checking (default: true)
  • pathChecker.fileExtensions: Array of file extensions to check (default: ["js", "ts", "jsx", "tsx", "vue", "py", "java", "go", "rs", "cpp", "c", "h", "md", "html", "css", "json", "xml", "svg", "yaml", "yml", "toml"])
  • pathChecker.decorationColor: Color for invalid path decorations (default: "#ff0000")

Configuration Example

{
  "pathChecker.enabled": true,
  "pathChecker.fileExtensions": ["js", "ts", "jsx", "tsx"],
  "pathChecker.decorationColor": "#ff6b6b"
}

How It Works

  1. Detection: The extension uses regular expressions to detect various path patterns in your code
  2. Validation: Each detected path is resolved relative to:
    • The current file's directory
    • The workspace root
  3. File System Check: The extension checks if the resolved path exists on the file system
  4. Smart Extensions: If a path has no extension, the extension tries common extensions (.js, .ts, etc.) and index files
  5. Decoration: Invalid paths are decorated with a red wavy underline and hover tooltip

Known Limitations

  • Only checks paths in text files (not in binary files)
  • May not detect all path formats (e.g., dynamic paths constructed at runtime)
  • Performance may be affected in very large files with many paths

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

License

MIT

Release Notes

0.0.1

Initial release of Path Checker:

  • Path detection for imports, requires, and file references
  • Visual highlighting of invalid paths
  • Configurable settings
  • Support for multiple file types
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft