Comfy-Org / Comfy-Org/ComfyUI_frontend

Warn-level DOM no-restricted-syntax block silently disables no-unsafe-error-assertion and no-new-zod-for-remote-api-types for all non-test src files

Open
#15,744 0 comments 0 reactions 1 assignee Claimed by @christian-byrne View on GitHub
Potential Bug
Dominant language
TypeScript
Stars
2k
Forks
697
Avg merge
1d 3h
Merged PRs (30d)
495

Description

Two error-level lint bans are silently disabled for all non-test `src/**` files since 2026-08-18: `comfy/no-unsafe-error-assertion` (#11429) and `comfy/no-new-zod-for-remote-api-types` (#14951). The warn-level DOM-in-computed `no-restricted-syntax` block added in #14472 matches `src/**/*.{ts,vue}` (non-test) last, and ESLint flat config **replaces** a rule's entry when multiple config blocks match the same file, so the resolved `no-restricted-syntax` for every non-test src file is warn severity + the 2 DOM selectors only.

## Runtime proof (at `f1bfb313d6`, pre-exists on main `296fc5cd07` with identical block order)

| Probe | Location | Expected if healthy | Measured |
| --- | --- | --- | --- |
| `return e as Error` | `src/stores/__probe.ts` | error (#11429 ban) | **exit 0, zero findings** |
| `return e as Error` | `apps/desktop-ui/src/utils/__probe.ts` (positive control) | error | **severity-2 `no-restricted-syntax` fires** |
| `--print-config src/stores/graphStore.ts` | | error + 2 Error selectors | **warn + 2 DOM selectors only** |
| `--print-config src/platform/remote/comfyui/jobs/fetchJobs.ts` | | error + Error selectors + Zod selector | **warn + 2 DOM selectors only** |

The config itself documents the replace-not-merge behavior in a comment at the `comfy/no-new-zod-for-remote-api-types` block, but the DOM block (currently ~L316) was appended after both without spreading their selectors.

## Fix options

1. **Consolidate:** extract each selector group into a shared const and have every overlapping block spread ALL restriction consts that should apply to its files. Severity cannot vary per selector within one rule entry, so warn and error selectors cannot share a block — either promote the DOM selectors to error with inline disables on the 4 grandfathered instances (the block's own comment says "promote once fixed"), or keep two blocks whose `files`/`ignores` globs are made disjoint.
2. **Reorder + narrow:** scope the DOM block's glob to exclude files matched by the error-level blocks. Fragile; not recommended.

## Notes

- Any future `no-restricted-syntax` addition (e.g. the branded-ID minting rule proposed separately) hits the same trap until this is fixed, so this blocks that proposal.
- eslint 10.8.1's stylish formatter crashes on Node v20.11.1 (`util.styleText is not a function`); use `-f json` when reproducing.
- Found during ECS migration review (PR #14246 QA program); the defect is upstream of the branch.

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.