Repository navigation
Should linter diagnostics for library-defined query parameters appear at their usage site? #12553
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Question
Is it intended that a linter diagnostic is hidden when a user project explicitly uses a query parameter defined in a shared TypeSpec library? If so, what is the recommended way for a rule to report the violation at an actionable location in the user's project?
Example
The App Service AI gateway list operation uses
Azure.Core.StandardListQueryParameters. The resulting Swagger operation is a paged collection GET with atopquery parameter defined by Azure.Core.With the draft
no-query-in-collectionrule explicitly enabled, the rule attempts to reporttopon the parameter property, whose source location is in the Azure.Core library. The project receives no matching warning. In contrast, the staging Swagger ruleQueryParametersInCollectionGetreportstopon the emitted operation.The compiler's linter diagnostic collector retains diagnostics only when the target's location context is
project. This appears to explain the observed behavior.Related issues
For this case, should a rule target the consuming operation or another project-local location, or is there a preferred API/pattern for reporting a library-defined parameter at its usage site? How should a rule handle the same shared parameter being used by multiple operations?
All reactions