Skip to content

chore(eslint): require block statements via curly: all#2188

Merged
julien-c merged 2 commits into
mainfrom
chore/eslint-curly
May 22, 2026
Merged

chore(eslint): require block statements via curly: all#2188
julien-c merged 2 commits into
mainfrom
chore/eslint-curly

Conversation

@julien-c
Copy link
Copy Markdown
Member

@julien-c julien-c commented May 22, 2026

Summary

  • Enables ESLint's curly: ["error", "all"] so single-line if/else/for/while bodies must be wrapped in { }.
  • Auto-fixes the ~59 existing violations across 8 packages with eslint --fix + oxfmt.

Affected packages: agents, gguf, hub, inference, jinja, ollama-utils, space-header, tasks.

Test plan

  • pnpm -r --parallel lint passes (rule applied, no remaining violations).
  • pnpm format clean.
  • CI green.

Note

Low Risk
Low risk: this is a repo-wide linting/style change that only adds required braces to single-line control statements, with no intended behavior changes.

Overview
Enforces brace-wrapped control statements by enabling ESLint curly: ["error", "all"].

Updates existing code across multiple packages (agents, hub, inference, jinja, scripts, etc.) to comply by converting one-line if/for/while bodies into block statements, without changing logic.

Reviewed by Cursor Bugbot for commit 06f6557. Bugbot is set up for automated code reviews on this repo. Configure here.

Adds the `curly: ["error", "all"]` ESLint rule so single-line bodies
on `if`/`else`/`for`/`while` must be wrapped in `{ }`. Runs
`eslint --fix` + `oxfmt` over the affected files (8 packages, 25
sources).
Comment thread packages/hub/src/lib/cache-management.ts Outdated
Comment thread packages/hub/src/lib/cache-management.ts Outdated
Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
@julien-c julien-c merged commit ddf959f into main May 22, 2026
7 checks passed
@julien-c julien-c deleted the chore/eslint-curly branch May 22, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants