Adding Linting to React and TypeScript
Learn to add linting to React and TypeScript in this lesson.
We'll cover the following...
Linting is a series of checks that are used to identify code that is potentially problematic. A linter is a tool that performs linting, and it can be run in our code editor as well as in the continuous integration (CI) process. So, linting helps us write consistent and high- quality code as it is being written.
ESLint is the most popular linter in the React community and has already been installed in our project for us by CRA. Due to this, we will be using ESLint as our linting tool for our app.
Note: TSLint was a popular alternative to ESLint for linting TypeScript code but is now deprecated.
In the following subsections, we will learn how to configure ESLints rules, as well as how to configure Visual Studio Code to highlight violations.
Configuring Visual Studio Code to lint TypeScript code
CRA has already installed ESLint and configured it for us. ...