Must-Have Visual Studio Code Extensions for Modern Web Development

Boost your productivity with these must-have VS Code extensions

November 22, 2024

By Kat Lea

Essential VS Code Extensions for Web Development

In today's fast-paced web development world, efficiency and productivity are crucial. Developers need tools that streamline their workflow and ensure clean, maintainable code. Visual Studio Code (VSCode) has become one of the most popular code editors, thanks to its flexibility and vast ecosystem of extensions. The right extensions can significantly improve code quality and boost collaboration. In this blog, we'll explore essential VSCode extensions that every modern web developer should have in their toolkit.

An Extension for Everything

Visual Studio Code (VSCode) extensions are add-ons that boost the editor's functionality, letting developers tailor their coding environment. These tools offer a variety of features - from syntax highlighting and code formatting, to debugging and version control integration. Whether you're tackling a small project or a large-scale application, the right extensions can greatly improve your development experience, making coding more efficient and enjoyable. Below, we will discover various and useful extensions together!

Prettier ESLint

Prettier ESLint combines the benefits of Prettier and ESLint. It automatically formats your code using Prettier while ensuring it follows your ESLint rules. Prettier handles formatting (like indentation and spacing), while ESLint enforces code quality and style rules. This combination streamlines development by making your code stylistically consistent and aligned with team standards.

How to Use Prettier ESLint

  • Install Prettier, ESLint, and other needed prerequisites (we are using this with Typescript today):

      npm i -D prettier@^3.1.0 eslint@^8.52.0 prettier-eslint@^16.1.2 @typescript-eslint/parser@^5.0.1 typescript@^4.4.4
          
  • Configure Prettier and ESLint:

    • Open or create a settings.json file at the root of the project. Paste in the following settings.

        {
                "editor.defaultFormatter": "rvest.vs-code-prettier-eslint",
                "editor.formatOnType": false, // required
                "editor.formatOnPaste": true, // optional
                "editor.formatOnSave": true, // optional
                "editor.formatOnSaveMode": "file", // required to format on save
                "files.autoSave": "onFocusChange", // optional but recommended
                "vs-code-prettier-eslint.prettierLast": false // set as "true" to run 'prettier' last not first
              }
            
  • Install the Prettier ESLint Extension in VSCode:

    • Search for Prettier ESLint in the extensions tab in VSCode. Hit install.

      VS Code marketplace displaying Prettier ESLint extension information.

Benefits of Using Prettier ESLint

  • Automatic Formatting: Prettier handles style and format, including spacing, semicolons, and line breaks.
  • Code Quality Assurance: ESLint enforces coding standards, catches potential bugs, and ensures best practices.
  • Consistent Codebase: together, Prettier and ESLint maintain clean, high-quality code. This reduces friction in code reviews and enhances collaboration.

Check out the GitHub repository for Prettier ESLint for more information.

Live Server

Live Server launches a local development server with live reload capability. It's especially helpful for front-end developers, as it automatically refreshes the browser when you save changes to your files. This allows you to see the impact of your edits instantly, without manually reloading the browser.

How to Use Live Server

  • Install the Live Server Extension in VSCode:

    • Search for Live Server in the extensions tab in VSCode. Hit install.

      Details page for the Live Server extension in VS Code marketplace.

Benefits of Using Live Server

  • Real-Time Feedback: see changes instantly, accelerating front-end development.
  • Enhanced Efficiency: streamline development by eliminating constant switching between code editor and browser, reducing errors.
  • Framework Compatibility: get rapid feedback for front-end work, whether using plain HTML/CSS or frameworks like Vue and React.

Check out the GitHub repository for Live Server for more information.

Tailwind CSS IntelliSense

Tailwind CSS IntelliSense enhances the workflow for developers using Tailwind CSS, a popular utility-first CSS framework. It provides intelligent autocompletion, suggestions, and error-checking for Tailwind CSS classes directly within your code editor. This tool makes it easier to apply styling and ensures you're using valid class names.

How to Use Tailwind CSS IntelliSense

  • Install the Tailwind CSS IntelliSense Extension in VSCode:

    • Search for Tailwind CSS IntelliSense in the extensions tab in VSCode. Hit install.

      VS Code marketplace showing the Tailwind CSS IntelliSense extension details

  • Set up the extension in your project:

    • Ensure Tailwind CSS is installed and configured in your project. You can install it via npm by running npm install -D tailwindcss
    • Next, create your tailwind.config.js file in the root directory of your project.

      /** @type {import('tailwindcss').Config} */
            
      module.exports = { content: ["./src/**/*.{html,js}"], theme: { extend: {}, }, plugins: [], }
    • After installing Tailwind CSS IntelliSense, it automatically provides class name autocompletion as you type in HTML, JavaScript, and other file types that use Tailwind classes:

      Code editor showing Tailwind CSS IntelliSense autocomplete in action.

Benefits of Using Tailwind CSS IntelliSense

  • Improves Productivity: saves time by eliminating the need to memorize exact class names or constantly refer to documentation.
  • Reduces Errors: with autocompletion and error-checking features, common mistakes in class names are prevented, leading to smoother styling.
  • Enhances Visual Feedback: real-time style previews make it easier to select the right classes for your layout, significantly improving the development experience.

Check out the GitHub repository for Tailwind CSS IntelliSense for more information. 

Code Spell Checker

Code Spell Checker detects and corrects spelling errors in your code. This tool is especially helpful for catching typos in comments, variable names, strings, and documentation. By using it, you can improve the readability and professionalism of your code.

How to Use Code Spell Checker

  • Install the Code Spell Checker Extension in VSCode:

    • Search for Code Spell Checker in the extensions tab in VSCode. Hit install.

      Details page for the Code Spell Checker extension in VS Code marketplace.

  • Once installed, the extension immediately begins highlighting potential spelling errors as you type in real time. Misspelled words are underlined, making them easy to spot.

    Code editor highlighting a spelling error with suggestions for correction.

  • Right-click on any highlighted word to see suggested corrections, or use the Quick Fix option (Cmd+. or Ctrl+.) for instant correction choices.

    Code editor displaying quick fix suggestions for a misspelled word.

  • To prevent custom terms, or specific variable names, from being flagged as errors, you can add them to your personal dictionary. Simply right-click on the word and select "Add Word to Dictionary". This will ensure the term isn't flagged in future checks.

Benefits of Using Code Spell Checker

  • Enhances Code Readability: catches typos in comments and documentation that might otherwise go unnoticed, improving code comprehension for collaborators.
  • Maintains Professional Codebase: eliminates embarrassing spelling errors that could undermine the project's professionalism, especially in client-facing or public repositories.
  • Saves Time: quickly identifies errors, eliminating the need for manual proofreading of comments and documentation.

Check out the GitHub repository for Code Spell Checker for more information.  

Better Comments

Better Comments enhances code readability by adding color-coded highlighting to comments. It distinguishes between different types of comments - such as TODOs, warnings, and notes - making it easier to navigate and understand the purpose of each annotation in your codebase.

How to Use Better Comments

  • Install the Better Comments Extension in VSCode:

    • Search for Better Comments in the extensions tab in VSCode. Hit install.

      Details page for the Better Comments extension in the VS Code marketplace.

  • Better Comments uses symbols at the beginning of a comment to categorize and highlight it in a specific color:

    • // ! for important or warning comments (red)
    • // ? for questions (blue)
    • // TODO for to-do items (orange)
    • // * for explanatory notes (green)
    • Simply place these symbols at the start of a comment line to apply the corresponding color automatically.

      Code editor showing categorized comments using Better Comments extension.

Benefits of Using Better Comments

  • Improves Code Navigation: quickly identify key points like TODOs or warnings, making it easier to focus on areas that need action or attention.
  • Organized Codebase: keeps your comments structured, helping team members easily understand the context and purpose of each note.
  • Increases Productivity: saves time by highlighting important information, allowing you and your teammates to focus on relevant sections more efficiently

Check out the GitHub repository for Better Comments for more information.

Color Info

Color Info enhances styling by displaying color information directly in the editor. It provides instant color previews and details for hex, RGB, HSL, and other color codes when working with CSS, SCSS, or similar styling languages. This feature makes it easy to visualize and select colors without switching to another tool.

How to Use Color Info

  • Install the Color Info Extension in VSCode:

    • Search for Color Info in the extensions tab in VSCode. Hit install.

      Details page for the Color Info extension in the VS Code marketplace.

  • When you add a color (such as #FF5733 or rgb(255, 87, 51)) in your styles, the extension displays a small color swatch next to the code. This feature allows you to visually confirm the color directly within your code editor.

    Code editor showing a color picker tool for adjusting a CSS color value.

  • Hover over any color code to see detailed information, including RGB, hex, and HSL values.

Benefits of Using Color Info

  • Speeds Up Styling: saves time by offering visual color feedback, eliminating the need to look up codes or test in a browser.
  • Improves Design Precision: enables quick color viewing and selection, ensuring consistent and accurate styles.
  • Enhances Readability: makes scanning and adjusting styles easier with inline color previews, particularly useful in large CSS files or complex design projects.

Check out the GitHub repository for Color Info for more information.

Git Graph

Git Graph offers a visual representation of your Git commit history. It simplifies understanding your project's branching structure, commits, merges, and tags. This invaluable tool for Git users allows intuitive branch navigation and management without leaving the editor.

How to Use Git Graph

  • Install the Git Graph Extension in VSCode:

    • Search for Git Graph in the extensions tab in VSCode. Hit install.

      VS Code marketplace showcasing the Git Graph extension for visualizing Git repositories.

  • You can view the Git Graph by clicking on the “View Git Graph” button in the Source Control tab:

    Source control interface in VS Code with an option to view the Git Graph.

  • The Git Graph view displays all branches, commits, merges, and tags. Color-coded branches illustrate the flow of commits in a tree-like structure, making it easy to track the history and relationships between branches.
  • Right-click on any commit to access options such as checkout, create a new branch, merge, or revert. You can also delete or rename branches, streamlining Git management and making it user-friendly.
  • Click on any commit to view detailed information, including changes made in that commit and associated file diffs.

Benefits of Using Git Graph

  • Improves Version Control Understanding: the visual layout simplifies Git, making it easy to see how branches and merges relate. This is especially helpful for teams and complex projects.
  • Streamlines Git Workflow: common Git operations can be performed directly within the graph, reducing the need for command-line interactions.
  • Enhances Collaboration: a clear visual representation of the commit history makes it easier to onboard team members and track who made which changes and when.

Check out the GitHub repository for Git Graph for more information. 

Indent Rainbow

Indent Rainbow color-codes indentation levels, making it easier to read and understand complex code structures. This extension applies distinct colors to each indentation level, helping prevent errors, improve code readability, and enhance comprehension of nested code - particularly useful for languages like HTML and Python.

How to Use Indent Rainbow

  • Install the indent-rainbow Extension in VSCode:

    • Search for indent-rainbow in the extensions tab in VSCode. Hit install.

      VS Code marketplace page displaying the Indent Rainbow extension details.

  • Once installed, Indent Rainbow automatically applies different colors to each indentation level in your code. This creates a visual gradient that reflects the depth of indentation.

    Code snippet for a mobile navigation component with menu toggle functionality.

Benefits of Using Indent Rainbow

  • Improves Code Readability: color-coded indentation helps you quickly grasp nested structures, reducing the chance of misinterpreting code blocks.
  • Helps Avoid Errors: clear visual cues make it easier to spot indentation issues or accidental misalignments - especially useful in languages like Python where indentation matters.
  • Boosts Productivity: by making code easier to scan and understand, indent-rainbow speeds up debugging and code reviews, particularly in complex projects.

Check out the GitHub repository for Indent Rainbow for more information. 

Supercharge Your VS Code Setup

The right extensions can transform Visual Studio Code into a powerhouse for modern web development, streamlining your workflow and boosting productivity. From enhancing code readability with indent-rainbow, to simplifying Git workflows with Git Graph - these tools cater to developers' diverse needs. Prettier ESLint helps maintain coding standards, while Live Server provides instant previews. Each extension offers unique benefits to help you write cleaner, more maintainable code.

Tailor your setup by experimenting with these extensions to suit your workflow and project requirements. Embrace these tools and watch your code flourish in a modern, robust development environment!

Kat Lea

Kat Lea

Front-End Developer

Kat is a front-end developer with a diploma in Contemporary Web Design. She has experience working in JavaScript based frameworks and libraries. Outside of work, she enjoys music, gaming with friends, and nature photography.