Code Quality and CI

On a team, code is checked before anyone reads it. Set up ESLint and Prettier for a Node project, then have GitHub Actions lint and test every push and pull request, and read a failed run to fix it.

Updated

Clean Code

  1. ESLint and Prettier for a Node Project (Journeyman): ESLint reads a Node project's code and reports likely mistakes, such as a variable nobody uses or a == that hides text from a URL, and Prettier lays out every file the same way, so you set both up once with a flat config, globals.node and npm scripts.

Continuous Integration

  1. Tests on Every Push with GitHub Actions (Journeyman): A GitHub Actions workflow in .github/workflows/ci.yml runs npm ci, the linter, the format check and the tests on a fresh computer at every push and pull request, so a broken change shows up as a red cross on its commit, with a log that says which step failed and why.

Exercise: Lost and Found CI

  1. Exercise: Lost and Found CI (Journeyman): Add ESLint and Prettier to the Lost and Found Desk's API with npm scripts, fix every problem they report without changing what the API answers, and add a GitHub Actions workflow that lints, checks the format and runs the tests on every push.