Skip to content

#1209 Clear factory's remaining lint violations and retire both deferral lists - #1216

Merged
williamthorsen merged 6 commits into
mainfrom
1209
Aug 6, 2026
Merged

#1209 Clear factory's remaining lint violations and retire both deferral lists#1216
williamthorsen merged 6 commits into
mainfrom
1209

Conversation

@williamthorsen

@williamthorsen williamthorsen commented Aug 6, 2026

Copy link
Copy Markdown
Owner

What

Fixes all lint violations in the factory project and restores the severity of all rules to "error" when a strict-lint check is run in that project.

Why

New violations of the deferred rules accumulated in factory and in the Catwalk demo without failing any check, and the root list reached every workspace, so the monorepo's strict-lint gate was weaker than it appeared. #1208 cleared factory's src/client/visualizations/ subtree; this covers the remainder.

Details

♻️ Refactoring

  • Ten unicorn/prefer-await sites across App.tsx, useDismissedRuns.ts, project-watcher.ts, and settings-store.ts convert from promise chains to async/await, each invoked as void asyncFn() from the synchronous callback that owns it. Every converted function wraps its full body in try/catch, so no rejection can escape unhandled.
  • useDismissedRuns gains a single module-level persistDismissed helper in place of the duplicate warn-and-swallow handlers in dismiss and dismissAll.
  • ProjectWatcher extracts a private rescan(), taking its debounce-timer bookkeeping with it.

🧪 Tests

  • The two useDismissedRuns persistence failure paths gain coverage, each asserting that the optimistic state survives a rejected patchSettings and that the warning fires.
  • SettingsStore.save gains coverage for a failed rename, asserting that the original error propagates and the temp file is removed.
  • useContainerResize.unit.test.ts moves to vi.stubGlobal/vi.unstubAllGlobals in place of a manual save-and-restore. vitest.setup.ts installs its ResizeObserver stub through an explicitly writable and configurable property descriptor, which is what lets a suite override the stub and restore it afterward.
  • createDeferredPromise gives way to Promise.withResolvers.

⚙️ Tooling

  • packages/factory/.config/ is deleted whole — both the deferral list and the package's strict-lint config — along with the tsconfig.json include entry that reached it. Ceilings merge from the repository root down, so factory keeps the root's advisory set and loses only its own five entries.
  • The root .config/eslint/deferred-lint-rules.ts and the eslint.config.ts block that applied it are deleted; the root strict-lint config keeps advisoryRuleSeverities alone.
  • Three suppressions survive, each scoped to the one file that needs it. The Symbol.dispose sites take eslint-disable directives, so reportUnusedDisableDirectives will flag them as unused once unicorn's Symbol allowlist admits the well-known symbol. demos/catwalk/scenarios.js takes an ESLint configuration comment instead, exempt from that check, leaving a frozen prototype uncoupled from future rule churn.

Closes #1209

Factory's Vitest setup and hook tests no longer violate `unicorn/no-global-object-property-assignment`, `unicorn/no-top-level-assignment-in-function`, or `unicorn/prefer-promise-with-resolvers`.

The promise-chaining and `Symbol.dispose` violations remain before factory's deferral list can be retired.
Failures in persisting dismissed runs and in renaming the settings file into place are now covered: an optimistic update survives a rejected save and warns, and a failed rename propagates its error after clearing the temp file.
Factory's project fetching, dismissed-run persistence, watcher rescans, and settings cleanup await their promises instead of chaining, clearing the last of the deferred `unicorn/prefer-await` violations.

A failed dismissal save now reports a single warning covering both the single and batch paths.
The console-silencing test helper keeps its `using`/`Disposable` implementation. The sites reading `Symbol.dispose` now carry a rule suppression naming its cause, so eslint-plugin-unicorn's outdated `Symbol` allowlist no longer needs a package-wide downgrade.

Explicit Resource Management ships natively in the Node version this repo requires, and the rule accepts no options, so a site-scoped suppression is the only local remedy. It clears itself once the allowlist catches up.
Factory no longer downgrades any lint rule: its deferral list, the strict-lint configuration that held it, and the ESLint block that applied it are gone, and `nmr -F factory lint:strict` reports no lint.

Every rule the list once deferred either passes now or carries a site-scoped suppression.
The root config no longer downgrades any lint rule. Its two entries existed only for the frozen Catwalk prototype, which now names those rules in a file-scoped ESLint configuration comment instead.

A configuration comment is exempt from the unused-directive check, so an unmaintained demo file stays uncoupled from future rule churn. Scoping the suppression to the file rather than to a directory pattern leaves lint policy for later demos undecided.
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Dependency audit

Production dependency audit passed.

@williamthorsen williamthorsen self-assigned this Aug 6, 2026
@williamthorsen
williamthorsen marked this pull request as ready for review August 6, 2026 12:01
@williamthorsen williamthorsen added refactoring Improvement to code without change in functionality tooling Development tools scope:root and removed tooling Development tools labels Aug 6, 2026
@williamthorsen
williamthorsen merged commit eab5019 into main Aug 6, 2026
3 checks passed
@williamthorsen
williamthorsen deleted the 1209 branch August 6, 2026 12:07
williamthorsen added a commit that referenced this pull request Aug 7, 2026
…ssembly-mcp-v0.2.4 codeassembly-v0.6.0

codeassembly-v0.6.0
- #794 feat: Guide kb-add note placement with the store's declared taxonomy (#1223)
- #1111 feat: Declare which harnesses sync targets (#1221)
- #1214 feat: Allow an artifact to belong to more than one collection (#1219)
- #1186 drop!: Dissolve `common-mistakes` into its consumers' guidance (#1217)
- deps: Upgrade all deps to latest version
- #1203 fix: Bar acceptance-criteria revision prompts to genuine conflicts (#1212)
- #1196 feat: Add the .kb/taxonomy.yaml format with drift reporting and back-fill (#1210)
- #1165 feat: Make a vetted subset of the library declarable (#1207)
- #1197 feat: Report the retired `harnesses:` frontmatter key from `validate` (#1204)
- #963 feat!: Rename the harness id to rovo and qualify the frontmatter key (#1199)
- #1188 drop!: Retire the bundled Bitbucket inline-comment script (#1198)
- #1187 feat: Gate the boolean prefix on a test and add the tail rule it rests on (#1195)

factory-v0.2.4
- deps: Upgrade all deps to latest version
- deps: Upgrade all deps to latest version
- #1209 refactor: Clear factory's remaining lint violations and retire both deferral lists (#1216)
- #1208 refactor: Clear the visualizations lint violations and retire six rule deferrals (#1213)

kb-v0.4.0
- #794 feat: Guide kb-add note placement with the store's declared taxonomy (#1223)
- #1196 feat: Add the .kb/taxonomy.yaml format with drift reporting and back-fill (#1210)

codeassembly-lifecycle-v0.3.0
- #963 feat!: Rename the harness id to rovo and qualify the frontmatter key (#1199)

codeassembly-mcp-v0.2.4
- #1206 refactor: Retire fleet's lint deferrals (#1211)
- #1200 tooling: Retire mcp's lint deferrals and prune the dead root entries (#1205)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Improvement to code without change in functionality scope:factory scope:root tooling Development tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

factory: Fix lint violations and remove lint rule downgrades (part 2)

1 participant