Open iscai-msft opened 3 months ago
This issue doesn't appear to be related to dotnet only (unless I am missing something).
It sounds like the error comes from when someone uses @clientName to create a naming conflict?
For example
//main.tsp
model Foo {
}
model Bar {
}
//client.tsp
@@clientName(Bar, "Foo", "python");
This should be an error diagnostic in tcgc since you have created a "compilation issue". I don't think this has anything to do with moving the existing linter to tcgc either (although there might be independent merits for that).
I think its worth considering how tcgc should raise these compilation errors and whether or not they should raise all errors if there are any in the client.tsp regardless of scope so we don't get the situation where it works great in dotnet then all of a sudden when someone tries python it fails because the bad rename was scoped to only python.
I think tcgc should throw regardless of current scope if any renames create a conflict so that customers see the error immediately and fix as early as possible.
rule here: https://github.com/Azure/typespec-azure/blob/main/packages/typespec-azure-core/src/rules/property-naming.ts
Since
@clientName
is a tcgc decorator, andazure-core
seems to be throwing this error forcsharp
, I think we should move this linter either into tcgc or typespec-csharp