Tools Before we move forward, let's take a quick refresher on what we will be exploring here. TypeScript Typescript is a programming language that serves as a syntactic extension of Javascript by introducing types and type safety capabilities. Eslint...
If you choosed TypeScript and ESLint during Next.js CLI, then this article is for you to setup Prettier, Husky, lint-staged properly to proceed ahead and great project structure. If you work with other developer or want to maintain the project in fut...
To set up Husky and lint-staged for running ESLint and Prettier automatically before every Git commit, follow these step-by-step instructions: 1. Install Husky and lint-staged Start by installing Husky (for Git hooks) and lint-staged (to run linters ...
A linter is a tool that scans code for potential issues. This is invaluable with a programming language like JavaScript which is so loosely typed. Even for TypeScript, which is a strongly typed language whose compiler does a great job of detecting er...
Introduction In modern web development, maintaining code quality and consistency is crucial for building scalable and maintainable applications. With the release of Next.js 14, developers have even more powerful tools at their disposal. However, as p...
Technology Stack of the project NextJS Typescript TailwindCSS ESLint, Prettier, Husky, Lint-staged Problem In my last employment, I worked as a Team Leader for a comprehensive project. There were rules set by the Tech Lead that we need to maint...
In a typical web code repository, we use linters like eslint to highlight warnings or syntax errors and use tools like prettier to format the code. There are a few ways to trigger the action: VS Code At editor level, e.g. VS Code, we can use command ...
Initial setup Setting up ESLint only one command is now needed to install and setup ESLint. In your terminal or PowerShell run: npm init @eslint/config this should add a file called .eslintrc.{js,yml,json} with the basic config of { "env": { ...
Intro ✨ I have a React TypeScript project for which I want to automate code formatting before committing changes to the repo, hence in this tutorial, I will teach you to do the same using husky, lint-staged & prettier. Installing and Setting up Husky...