Bitpath

Lesson 1 · Unit 03

Linters and formatters

Formatter, linter, type checker: what each is configured to do, and where each one runs

13 exercisesabout 3 min

What you practise

  • What each one catches, reading their output, a shared config, hooks that run before a commit

Try a question from this lesson

Pick one

A review of a 12-line change has drawn 30 comments, and 26 of them are about quote style and where the braces go. What should the team change?

The ideas

Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.

Concept

Three tools, three jobs

A formatter rewrites layout: spacing, quotes, line breaks. It never changes what the code means.

A linter reads the code without running it and flags suspicious patterns, each one a named rule.

A type checker proves that values fit where they are used.

Layout, patterns, proof. Each catches what the others cannot.

Concept

Config lives in the repository

Each tool reads its settings from a file in the project. This one tells the Prettier formatter: semicolons, single quotes, wrap at 80 columns.

Because the file is committed, every editor and every CI machine formats the same way. Style is argued once, in the review of this file.

JSON
{
  "semi": true,
  "singleQuote": true,
  "printWidth": 80
}

10 more exercises in the app

  • 1× match the pairs
  • 3× type the answer
  • 3× multiple choice
  • 1× true or false
  • 1× fill the blanks
  • 1× order the lines

Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.

One email when Bitpath is ready to try. Nothing else. Privacy