Skip to content

Linter usage

Usage

Add the following in tspconfig.yaml:

linter:
extends:
- "@azure-tools/typespec-azure-resource-manager/all"

RuleSets

Available ruleSets:

  • @azure-tools/typespec-azure-resource-manager/all

Rules

NameDescription
@azure-tools/typespec-azure-resource-manager/arm-no-recordDonā€™t use Record types for ARM resources.
@azure-tools/typespec-azure-resource-manager/arm-common-types-versionSpecify the ARM common-types version using @armCommonTypesVersion.
@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codesEnsure delete operations have the appropriate status codes.
@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codesEnsure put operations have the appropriate status codes.
@azure-tools/typespec-azure-resource-manager/arm-post-operation-response-codesEnsure post operations have the appropriate status codes.
@azure-tools/typespec-azure-resource-manager/arm-resource-action-no-segment@armResourceAction should not be used with @segment.
@azure-tools/typespec-azure-resource-manager/arm-resource-duplicate-propertyWarn about duplicate properties in resources.
@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-propertyCheck for invalid resource envelope properties.
@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-version-formatCheck for valid versions.
@azure-tools/typespec-azure-resource-manager/arm-resource-key-invalid-charsArm resource key must contain only alphanumeric characters.
@azure-tools/typespec-azure-resource-manager/arm-resource-name-patternThe resource name parameter should be defined with a ā€˜patternā€™ restriction.
@azure-tools/typespec-azure-resource-manager/arm-resource-operation-response[RPC 008]: PUT, GET, PATCH & LIST must return the same resource schema.
@azure-tools/typespec-azure-resource-manager/arm-resource-path-segment-invalid-charsArm resource name must contain only alphanumeric characters.
@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-stateCheck for properly configured provisioningState property.
@azure-tools/typespec-azure-resource-manager/beyond-nesting-levelsTracked Resources must use 3 or fewer levels of nesting.
@azure-tools/typespec-azure-resource-manager/arm-resource-operationValidate ARM Resource operations.
@azure-tools/typespec-azure-resource-manager/no-resource-delete-operationCheck for resources that must have a delete operation.
@azure-tools/typespec-azure-resource-manager/empty-updateable-propertiesShould have updateable properties.
@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decoratorEach resource interface must have an @armResourceOperations decorator.
@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-action-verbActions must be HTTP Post or Get operations.
@azure-tools/typespec-azure-resource-manager/improper-subscription-list-operationTenant and Extension resources should not define a list by subscription operation.
@azure-tools/typespec-azure-resource-manager/lro-location-headerA 202 response should include a Location response header.
@azure-tools/typespec-azure-resource-manager/missing-x-ms-identifiersArray properties should describe their identifying properties with x-ms-identifiers. Decorate the property with @OpenAPI.extension(ā€œx-ms-identifiersā€, [id-prop]) where ā€œid-propā€ is a list of the names of identifying properties in the item type.
@azure-tools/typespec-azure-resource-manager/no-response-bodyThe body of 202 response should be empty.
@azure-tools/typespec-azure-resource-manager/missing-operations-endpointCheck for missing Operations interface.
@azure-tools/typespec-azure-resource-manager/patch-envelopePatch envelope properties should match the resource properties.
@azure-tools/typespec-azure-resource-manager/arm-resource-patchValidate ARM PATCH operations.
@azure-tools/typespec-azure-resource-manager/resource-nameCheck the resource name.
@azure-tools/typespec-azure-resource-manager/retry-afterCheck if retry-after header appears in response body.
@azure-tools/typespec-azure-resource-manager/unsupported-typeCheck for unsupported ARM types.
@azure-tools/typespec-azure-resource-manager/no-empty-modelARM Properties with type:object that donā€™t reference a model definition are not allowed. ARM doesnā€™t allow generic type definitions as this leads to bad customer experience.