AcademyPipeline Pilot: The CI/CD Flight ManualAltitude 4: Structural Integrity (Testing)

Linting and Code Quality

Tests check if your code works. Linting checks if your code is written well.

It's best practice to run linters (like ESLint, Flake8) and formatters (like Prettier) in your CI pipeline.

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
      - run: npm ci
      
      - name: Check Formatting
        run: npm run format:check
        
      - name: Run Linter
        run: npm run lint

Many teams use tools like SonarQube or Snyk in their CI pipelines to automatically scan for security vulnerabilities as part of the linting process!

booting...

Mission Control

Add a linting step

Expected Command

echo 'run: npm run lint' > lint.yml