Comfy-Org / Comfy-Org/ComfyUI_frontend
Ingest-type lint tests write probe files into src/ and browser_tests/, and lint both trees on every unit run
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 702
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 512
Description
`tools/oxlint-plugins/comfyIngestTypes.test.ts` verifies the rule by writing probe files into the real source trees and linting them through the repo's own `.oxlintrc.json`:
```ts
const tsProbeDir = path.resolve('src', PROBE_DIR)
const vueProbeDir = path.resolve('src/platform', PROBE_DIR)
const browserTestProbeDir = path.resolve('browser_tests/fixtures', PROBE_DIR)
...
findings = lint(['src', 'browser_tests'])
```
Testing against the real config is the right call and was a deliberate fix (a bespoke tmpdir config proved the rule logic but nothing about scoping or severity). The cost is the mechanism, not the intent.
## Problems
1. **Interrupted runs leave probes in the working tree.** Cleanup is `afterAll`, so a crash, a `SIGINT`, or a worker timeout leaves `src/__ingest_type_probes__/` and `browser_tests/fixtures/__ingest_type_probes__/` on disk. They are not gitignored, so they show up in `git status` and can be committed by an unlucky `git add -A`. `reported.ts` contains deliberate rule violations, so a stray probe also reddens `pnpm lint` for reasons unrelated to the change under test.
2. **Every unit-test run lints all of `src` and `browser_tests`.** `beforeAll` shells out to oxlint over both trees, roughly 3,000 files, to read back findings for a handful of probes. That cost lands on anyone running `pnpm test:unit`, including watch mode.
3. **Concurrent runs collide.** Two vitest processes, or a vitest run overlapping a `pnpm lint`, share the same fixed probe paths.
## Options
- Point the probes at a temp directory and pass the repo config explicitly (`oxlint --config .oxlintrc.json `), if oxlint resolves `overrides` globs against the config's location rather than the target path. Keeps the real-config property without touching the source trees.
- Keep the probes in-tree but make the paths unique per run and register cleanup on process exit rather than `afterAll` only.
- Narrow the lint targets to the probe directories instead of `src` and `browser_tests`, which removes most of the runtime cost even if the probes stay in-tree.
At minimum, add `__ingest_type_probes__/` to `.gitignore` so an interrupted run cannot leak into a commit.
Introduced in #14839.
Contributor guide
Research direction
Start in tools/oxlint-plugins/comfyIngestTypes.test.ts and inspect its probe paths, beforeAll lint invocation, and afterAll cleanup alongside .oxlintrc.json and .gitignore. Run the focused test and unit test command to establish the current cost and probe behavior. Done means interrupted or concurrent runs do not leak or collide, and unit tests no longer lint unrelated trees unnecessarily.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100