What is Linting
Course: ESLint, Prettier and Pre-commit hooks - chapter 1
Linting is the process of running a program that analyzes source code to flag programming errors, bugs, stylistic errors

Why lint?
Section titled “Why lint?”- Multiple developers in a team can have a similar coding pattern
- Good readability of the code
- Automatic Linting so developer doesnt have to manually lint their code
- ESLint - https://eslint.org/
- Prettier - https://prettier.io/
- Husky - https://typicode.github.io/husky/
Two types of lints
Section titled “Two types of lints”1. Code analysis (Similar to TS checks)
Section titled “1. Code analysis (Similar to TS checks)”Analyzes code to find and fix problems according to a set of rules. These problems can include syntax errors, stylistic issues, and potential bugs.
let x = 1;let y = 1;console.log(y)Can you guess some bad things about this code?
- x is never used, and hence can be removed
- y is never changed, and hence can be a const
2. Code formatting (Purely stylistic changes)
Section titled “2. Code formatting (Purely stylistic changes)”let x = 1;let y = 1let firstName = "harkirat";let lastName = 'singh';Can you guess some bad things about this code?
- One line is missing semi colons
- Spacing is wrong in second line
- One string uses double quotes, other uses single quotes
Eslint lets you do both 1 and 2
Prettier is used for 2