Skip to content

Linted the 10,242‑line quality gate itself

Brought 10,242 lines of quality‑gate JavaScript under a formatter and a linter after establishing it was the largest body of code in the repository and the only one nothing read, fixing 13 findings and suppressing none.

10,242 lines of quality‑gate JavaScript, finally linted

Situation. The site’s quality gate is thirty‑two scripts totalling 10,242 lines of JavaScript. It was, by a wide margin, the largest body of code in the repository, and it was the only body of code nothing read — no formatter, no linter, no type checking. The programs enforcing every rule in the project were the only programs subject to none of them.

Task. The checkers had to be held to the standard they exist to enforce, and the formatter had to be fitted to them rather than the other way around.

Action. The formatter came first, and the indentation width was the interesting decision. The repository’s default is four spaces; at four spaces the formatter would have rewritten 2,173 lines of the largest checker. An override to two spaces for those files reduced that to 38 lines of genuine drift. The principle recorded with it is that the formatter is fitted to the code, not the code to the formatter — reformatting two thousand lines to satisfy a preference destroys the ability to read the history of the file. Then the linter, which produced thirteen real findings, all fixed and none suppressed. The Python checkers got the same treatment through a type checker configured at a middle strictness with thirty individual strict‑tier rules enabled on top, chosen by measurement: at that setting the tree is silent, and of the thirty candidates twenty‑nine were already silent and one fired — and that one was fixed rather than exempted. The type checker found two real defects the linter had passed clean, both about a value’s shape rather than its syntax.

Result. The largest and most load‑bearing code in the repository is now formatted, linted and type‑checked, with thirteen findings fixed and zero suppressions. The reason it matters more than the line count suggests is stated in the plan: a defect in the site’s stylesheet shows up as a page that looks wrong, and a defect in a checker shows up as a check that passes when it should not.

  • Park, hedge, garden
    Photo: stux / Pixabay
  • Bonsai, trees, plants
    Photo: IlonaBurschl / Pixabay

Bring this experience to your project

Use “Linted the 10,242‑line quality gate itself” as a starting point for a similar challenge in your organisation. The services behind this work are available for your project. Interfaces that load quickly, work on a phone and behave the same in every browser your customers happen to use.

Explore our services Get in touch

Look behind the result

Read the situation, decisions and result in this example. We can discuss which parts transfer to your constraints and which need another approach. Linted the 10,242‑line quality gate itself — 10,242 lines of quality‑gate JavaScript, finally linted

Explore our services Get in touch

One piece of a longer record — and it is all on this site.

Every entry is written the same way: the situation, the task, what we did and what changed.

See the whole record

Define the improvement you need

Describe the workflow, the existing interfaces and the users who need the change. We can define a testable delivery and a handover that lets your team maintain it.

See what it costs Get in touch

Who checks the code that checks your code?

Ask about the decisions behind “Linted the 10,242‑line quality gate itself”. You will speak with the people who can explain the work and assess your own project.

Explore our services
welcome@engineer.company +45 50 10 61 84 Copenhagen, Denmark
QR code for Brought 10,242 lines of quality‑gate JavaScript under a formatter and a linter after establishing it was the largest body of code in the repository and the only one nothing read, fixing 13 findings and suppressing none.
Take this page with youhttps://engineer.company/portfolio/linted-the-10242-line-quality-gate-itself/