-
Notifications
You must be signed in to change notification settings - Fork 323
Closed
Milestone
Description
Write a style guide of what is the recommended way of naming things(camelCase,PascalCase, etc.)
Table of the different cadl types and the current pattern or where its still ambiguous
| Type | Naming | Example |
|---|---|---|
| scalar | camelCase | scalar uuid extends string; |
| model | PascalCase | model Pet {} |
| model property | camelCase | model Pet {furColor: string} |
| enum | PascalCase | model Pet {furColor: string} |
| enum member | camelCase | enum Direction {up, down} |
| namespace | PascalCase | namespace Cadl.Rest |
| interface | PascalCase | interface Stores {} |
| operation | camelCase | op listPets(): Pet[]; |
| operation params | camelCase | op getPet(petId: string): Pet; |
| unions | PascalCase | union Pet {cat: Cat, dog: Dog} |
| unions variants | camelCase | union Pet {cat: Cat, dog: Dog} |
| alias | camelCase or PascalCase depending on context | alias myString = string or alias MyPet = Pet |
| decorators | camelCase | @format, @resourceCollection |
| functions | camelCase | addedAfter |
| file name | kebab-case | my-lib.cadl |
As a follow up we could provide a linter rule to validate those
TimLovellSmith
Metadata
Metadata
Assignees
Labels
No labels