Skip to content

Conversation

@JialinHuang803
Copy link
Member

@JialinHuang803 JialinHuang803 commented Nov 4, 2025

This PR is to fix the second error mentioned in #3452. The "Argument 'xxx' should be typed with a non-any type" lint errors are basically triggered by the deserializer functions in the generated models.ts files. Since these functions will not be exported, we would like to suppress the errors by disabling the explicit-module-boundary-types eslint rule for the models.ts files.

@JialinHuang803 JialinHuang803 marked this pull request as ready for review November 5, 2025 02:55
@MaryGao MaryGao requested a review from Copilot November 5, 2025 05:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a standardized comment block to all generated TypeScript model files that documents the purpose of the files and disables the @typescript-eslint/explicit-module-boundary-types ESLint rule. The changes affect both the code generator and the expected test outputs.

Key Changes

  • Modified the TypeScript emitter to automatically add a documentation comment and ESLint disable directive to generated model files
  • Updated all test snapshots to reflect the new comment block in generated models
  • Reformatted a sample parameter ordering example for improved readability

Reviewed Changes

Copilot reviewed 32 out of 59 changed files in this pull request and generated 1 comment.

File Description
packages/typespec-ts/src/modular/emitModels.ts Added logic to insert comment block when creating new model source files
packages/typespec-ts/test/modularUnit/scenarios/**/*.md Updated test snapshots to include the new comment block in expected output
packages/typespec-test/test/**/models.ts Updated generated model files with the new comment block
packages/typespec-ts/test/modularUnit/scenarios/samples/parameters/parameterOrdering.md Reformatted function call for better readability

Copy link
Member

@MaryGao MaryGao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Could you resolve copilot comments?

Co-authored-by: Copilot <[email protected]>
@qiaozha qiaozha added the p0 priority 0 label Nov 5, 2025
@JialinHuang803 JialinHuang803 merged commit 64fcbf3 into Azure:main Nov 5, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p0 priority 0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants