Skip to content

Linter usage

Add the following in tspconfig.yaml:

linter:
extends:
- "@azure-tools/typespec-client-generator-core/all"

Available ruleSets:

  • @azure-tools/typespec-client-generator-core/all
  • @azure-tools/typespec-client-generator-core/best-practices:csharp
NameDescription
@azure-tools/typespec-client-generator-core/use-correct-verbPUT, PATCH, and DELETE SDK method names should start with ‘create’, ‘update’, and ‘delete’, respectively.
@azure-tools/typespec-client-generator-core/require-client-suffixClient names should end with ‘Client’.
@azure-tools/typespec-client-generator-core/property-name-conflictAvoid naming conflicts between a property and a model of the same name.
@azure-tools/typespec-client-generator-core/csharp-no-url-suffixProperties ending with ‘Url’ should use ‘Uri’ suffix instead to follow .NET naming conventions.
@azure-tools/typespec-client-generator-core/csharp-model-suffixModel names should use recommended suffixes for C# SDKs.
@azure-tools/typespec-client-generator-core/csharp-use-standard-acronymsC# SDK names should use standard acronym casing.
@azure-tools/typespec-client-generator-core/get-operation-nameGET SDK method names should use ‘Get’ or ‘List’ as the verb prefix.
@azure-tools/typespec-client-generator-core/no-operation-group-name-conflictOperation group names should not conflict with type names in the same namespace.
@azure-tools/typespec-client-generator-core/use-union-hierarchyNamed unions other than string unions should declare an extends constraint, with model variants inheriting from the base and belonging to only one union hierarchy.
@azure-tools/typespec-client-generator-core/no-repeated-client-nameSDK method names should not repeat their owning subclient name.