Maximizing Productivity in Angular & Node.js with VSCode
Written on
Chapter 1: Essential VSCode Setup
As a full-stack developer, a large portion of my work involves crafting applications using Angular and Node.js, primarily within the VSCode environment. In this article, I aim to highlight my favorite extensions that significantly enhance daily productivity. Some extensions cater specifically to Angular, while others are universally beneficial for developers across various frameworks and languages.
Section 1.1: Top Extensions for Angular
File Extension Switcher (Angular Companion)
In Angular development, a standard component comprises four files: the TypeScript file for logic, an HTML template, a style sheet, and a spec file for testing. This extension allows for rapid switching among these files, especially useful in Split Screen mode where two files can be viewed side by side. Hotkeys facilitate quick navigation between different parts of a component.
Angular Files
This extension acts as a visual interface for the Angular CLI. To create a new component, simply right-click on the folder and choose 'Generate Component' from the menu. This tool also enables the creation of directives, services, pipes, and more.
Angular Language Service
A vital tool for Angular developers, this extension enhances code completion and suggestions in both HTML templates and TypeScript files.
Nx Console
This extension is invaluable for managing a monorepo with nrwl nx, allowing library generation through a user-friendly interface directly in the editor.
Prettier for Auto-Formatting
Prettier stands out as the leading linter in the web development scene. Setting it up involves creating a .prettierrc file in the root of your project to dictate formatting rules. It also supports new syntax introduced in Angular v17.
Jest Runner for Inline Testing
Jest Runner provides buttons above test code for executing tests directly from the file, allowing you to run individual tests, entire files, or grouped test blocks.
ESLint for Code Quality
Linting is essential in development, and ESLint is the go-to tool for JavaScript and TypeScript. It performs static code analysis to help identify and resolve problematic code patterns.
Enhancing Git Integration
While VSCode includes built-in Git capabilities, extensions like Git Graph, Git Lens, and Git History can amplify your workflow.
Codeium: Free AI Code Assistant
An AI coding assistant can be a game-changer. If your employer permits, GitHub Copilot is a fantastic tool to consider. For a free alternative, Codeium excels in auto-completion and features a chat interface within the sidebar.
UUID Generator
If you frequently work with UUIDs, this handy extension generates random UUIDs quickly. It supports multi-cursor functionality, producing unique UUIDs for each selected location in your code.
Color Highlighting Extension
This small utility highlights color codes in various formats directly within your code, enhancing CSS and HTML development.
Code Spell Checker
This extension checks the spelling in your code to help prevent errors before submitting pull requests.
i18n Ally for Internationalization
An essential tool for applications requiring localization, this extension simplifies translation tasks.
14+. Various Other Tools
- Px to Em: Quickly converts units from pixels to ems.
- Ident-Rainbow: Highlights code indentation.
- Peacock: Colors the editor's top and side panels for better project differentiation.
- Thunder Client: A built-in REST API client.
- Import Size: Displays the size of imported libraries directly in the import statement.
Chapter 2: Themes and Fonts
For years, I've favored the Night Owl theme for its aesthetics and functionality. Recently, I've also adopted GitHub Monospace and the Material Icon Theme for improved icon visibility in the editor.
The first video, "How to Set Up Your First Angular Project in VS Code," provides a comprehensive guide to kickstarting an Angular project using VSCode.
The second video, "How to Setup and Run Angular App in Visual Studio Code 2024," offers step-by-step instructions for setting up and executing an Angular application in the latest version of VSCode.
Feel free to share your favorite VSCode tools and setups in the comments. Thank you for reading, and happy coding!