Comfy-Org / Comfy-Org/ComfyUI_frontend

Enable `curly` rule in oxlint

Open
#12,797 1 comment 1 reaction 1 assignee Claimed by @DrJKL View on GitHub
developer experience
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

## Summary

Enable the [`curly`](https://oxc.rs/docs/guide/usage/linter/rules/eslint/curly.html) rule in oxlint to require curly braces for all control-flow statements (`if`, `else`, `while`, `for`, etc.).

## Motivation

Bare single-line `if` bodies (e.g. `if (resolveEssentialsPath(node)) essentialNodes.push(node)`) silently invite bugs when a second statement is added to the branch without adding braces. Enforcing `curly` prevents this class of error uniformly across the codebase.

Flagged during review of #12744 (comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/12744#discussion_r3397751343).

## Suggested change

In the oxlint configuration (e.g. `.oxlintrc.json` or equivalent), add:

```json
"curly": "error"
```

Then fix any pre-existing violations surfaced by the rule.

Requested by @DrJKL.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.