-
Notifications
You must be signed in to change notification settings - Fork 670
fix(lint): keep remote Zod rule active #15535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import { ESLint } from 'eslint' | ||
| import path from 'node:path' | ||
| import { expect, it } from 'vitest' | ||
|
|
||
| it( | ||
| 'keeps the remote Zod restriction effective and cross-referenced', | ||
| { timeout: 30_000 }, | ||
| async () => { | ||
| const eslint = new ESLint({ | ||
| cwd: path.resolve('.') | ||
| }) | ||
| const config = await eslint.calculateConfigForFile( | ||
| 'src/platform/remote/probe.ts' | ||
| ) | ||
| const restriction = config.rules?.['no-restricted-syntax'] as unknown[] | ||
|
|
||
| expect(restriction?.[0]).toBe(2) | ||
| expect(restriction).toContainEqual( | ||
| expect.objectContaining({ | ||
| selector: "ImportDeclaration[source.value='zod']", | ||
| message: expect.stringContaining('comfy/no-duplicate-ingest-type') | ||
| }) | ||
| ) | ||
|
Comment on lines
+12
to
+23
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Test the resulting diagnostics and both remote file scopes. This test only inspects 🤖 Prompt for AI AgentsSource: Path instructions |
||
| } | ||
| ) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
Replace the unchecked rule-shape assertion.
as unknown[]assumes thatno-restricted-syntaxis always an options array. Narrow the value withArray.isArray()before indexing so configuration-shape changes produce a clear test failure instead of an unsafe type assumption.🤖 Prompt for AI Agents
Source: Path instructions