We'll setup eslint to help us know if our code's syntax is broken

To install eslint:

npx eslint --init

Now it will ask us a few questions - for this project, using arrow keys and the space bar, we'll answer them as follows :

  1. How would you like to use ESLint?
  2. What type of modules does your project use?
  3. Which framework does your project use?
  4. Does your project use TypeScript?
  5. Where does your code run?
  6. What format do you want your config file to be in?
  7. Would you like to install them now with npm?

This should have created a file called .eslintrc.json with the following contents:

{
    "env": {
        "commonjs": true,
        "es2021": true,
        "node": true
    },
    "extends": "eslint:recommended",
    "parserOptions": {
        "ecmaVersion": 12
    },
    "rules": {
    }
}

It should have also added an eslint entry in your package.json under devDependencies


*** *Time to commit to git! ****

Every time we complete a step is a good time to commit

git add .
git commit -am 'added eslint'

***


◀ Setup Express.js

Separating Concerns ▶