Skip to content

Fix all lint warnings and retire the deferred-lint mechanism #1256

Description

@williamthorsen

Problem

100 lint warnings across four packages, none auto-fixable. Every one is a rule the shared preset
sets to error, held at warn by a per-package deferral so it neither blocks a gate nor gets fixed.

Context

The mechanism has four touchpoints per package, present in agents, foreman, kb, lifecycle, and
run-core:

  • .config/eslint/deferred-lint-rules.ts -- the rule list
  • eslint.config.ts -- imports it, demoting error to warn
  • .config/strict-lint.config.ts -- spreads the same object as maxSeverity, capping strict-lint's
    warn-to-error promotion
  • tsconfig.json -- includes ./.config/**/*.ts, which matches nothing once the two files go, since
    they are all of .config/ in every package carrying them

Retiring a package's deferral deletes both files and clears both references. The package strict-lint
configs do not set shouldIgnoreAncestors, so deleting one restores the root's advisory ceilings by
cascade; nothing replaces it.

Package Warnings Deferred entries
agents 60 16
kb 23 10
run-core 13 3
foreman 4 3
lifecycle 0 10

17 of the 42 entries clear with no code change, and take 7 warnings with them:

  • unicorn/prefer-simple-condition-first is off in eslint-config-typescript 8.7.0
    (Disable prefer-simple-condition-first and repair inert rule overrides eslint-config#124). The deferral re-enables it at warn in agents, kb, lifecycle,
    and run-core.
  • 14 entries have no violations anywhere: all ten of lifecycle's, and four of agents'
    (no-computed-property-existence-check, no-return-array-push,
    prefer-includes-over-repeated-comparisons, prefer-set-methods).

The remaining 93 warnings need edits. unicorn/no-unreadable-for-of-expression alone accounts for
30 of them.

preserve-caught-error's 9 sites gain a cause from describeError and chainError, published as
@williamthorsen/toolbelt.errors (williamthorsen/toolbelt#110), which each package adopts rather than
defining its own. The wider sweep of ~80 message-extraction sites is a sibling ticket; kb's share of it
comes forward into B so kb's files are touched once.

Children

Scope Warnings Ends with
A Free removals, run-core, foreman 16 lifecycle, run-core, and foreman deferrals gone
B kb 20 kb deferral gone
C agents no-unreadable-for-of-expression 28 --
D agents remainder 29 agents deferral gone

C precedes D: they overlap in src/commands/library-list.ts and three test files.

Acceptance criteria

Must have

  • No deferred-lint-rules.ts file remains, and no eslint.config.ts or
    .config/strict-lint.config.ts references one.
  • nmr lint:check reports zero warnings from the repo root and from every package.

Should have

  • A guard fails when a package reintroduces a deferred-rule list.

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions