Skip to content
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

Add linter rule for models that are only used as spread sources #848

Open
4 tasks done
johanste opened this issue May 16, 2024 · 0 comments
Open
4 tasks done

Add linter rule for models that are only used as spread sources #848

johanste opened this issue May 16, 2024 · 0 comments
Labels
feature New feature or request lib:azure-core Issues for @azure-tools/typespec-azure-core library
Milestone

Comments

@johanste
Copy link
Member

Clear and concise description of the problem

In general, models that are only referenced in spreads into other models are not things that we want to emit (note: spreading into op parameters is different). We usually "fix" the problem by erasing unreferenced models in our emitters, but that is work that shouldn't be necessary. Having a model also has the downside of a) us having to give it a (good) name and b) requires documentation. Neither of which are that helpful. It also risks introducing ghost breaking change warnings/confuse our generators if the models were not intended for reuse outside the scope of a given spec (i.e. they are not part of the public surface area in a library)

Checklist

  • Follow our Code of Conduct
  • Check that this issue is about the Azure libraries for typespec. For feature request in the typespec language or core libraries file it in the TypeSpec repo
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
@markcowl markcowl added this to the Backlog milestone May 30, 2024
@markcowl markcowl added the lib:azure-core Issues for @azure-tools/typespec-azure-core library label May 30, 2024
@markcowl markcowl added feature New feature or request needs-area and removed needs-area labels May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request lib:azure-core Issues for @azure-tools/typespec-azure-core library
Projects
None yet
Development

No branches or pull requests

2 participants