@azure-tools/typespec-azure-core 0.37.0-dev.2 → 0.37.0-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -8,6 +8,61 @@ TypeSpec Azure Core library
|
|
|
8
8
|
npm install @azure-tools/typespec-azure-core
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
## Linter
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
Add the following in `tspconfig.yaml`:
|
|
16
|
+
|
|
17
|
+
```yaml
|
|
18
|
+
linter:
|
|
19
|
+
extends:
|
|
20
|
+
- "@azure-tools/typespec-azure-core/all"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### RuleSets
|
|
24
|
+
|
|
25
|
+
Available ruleSets:
|
|
26
|
+
|
|
27
|
+
- [`@azure-tools/typespec-azure-core/all`](#@azure-tools/typespec-azure-core/all)
|
|
28
|
+
|
|
29
|
+
### Rules
|
|
30
|
+
|
|
31
|
+
| Name | Description |
|
|
32
|
+
| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
33
|
+
| `@azure-tools/typespec-azure-core/operation-missing-api-version` | Operations need an api version parameter. |
|
|
34
|
+
| `@azure-tools/typespec-azure-core/auth-required` | Enforce service authentication. |
|
|
35
|
+
| `@azure-tools/typespec-azure-core/no-operation-id` | Operation ID is automatically generated by the OpenAPI emitters and should not normally be specified. |
|
|
36
|
+
| `@azure-tools/typespec-azure-core/request-body-problem` | Request body should not be of raw array type. |
|
|
37
|
+
| `@azure-tools/typespec-azure-core/byos` | Use the BYOS pattern recommended for Azure Services. |
|
|
38
|
+
| `@azure-tools/typespec-azure-core/casing-style` | Ensure proper casing style. |
|
|
39
|
+
| `@azure-tools/typespec-azure-core/spread-discriminated-model` | Check a model with a discriminator has not been used in composition. |
|
|
40
|
+
| `@azure-tools/typespec-azure-core/composition-over-inheritance` | Check that if a model is used in an operation and has derived models that it has a discriminator or recommend to use composition via spread or `is`. |
|
|
41
|
+
| `@azure-tools/typespec-azure-core/prefer-csv-collection-format` | It is recommended to use "csv" for collection format of parameters. |
|
|
42
|
+
| `@azure-tools/typespec-azure-core/use-extensible-enum` | Enums should be extensible. |
|
|
43
|
+
| `@azure-tools/typespec-azure-core/known-encoding` | Check for supported encodings. |
|
|
44
|
+
| `@azure-tools/typespec-azure-core/use-standard-operations` | Operations should be defined using a signature from the Azure.Core namespace. |
|
|
45
|
+
| [`@azure-tools/typespec-azure-core/no-enum`](https://azure.github.io/typespec-azure/docs/libraries/azure-core/rules/no-enum) | Azure services should not use enums. |
|
|
46
|
+
| `@azure-tools/typespec-azure-core/no-error-status-codes` | Recommend using the error response defined by Azure REST API guidelines. |
|
|
47
|
+
| `@azure-tools/typespec-azure-core/no-fixed-enum-discriminator` | Discriminator shouldn't be a fixed enum. |
|
|
48
|
+
| `@azure-tools/typespec-azure-core/no-nullable` | Use `?` for optional properties. |
|
|
49
|
+
| `@azure-tools/typespec-azure-core/no-offsetdatetime` | Prefer using `utcDateTime` when representing a datetime unless an offset is necessary. |
|
|
50
|
+
| `@azure-tools/typespec-azure-core/no-rpc-path-params` | Operations defined using RpcOperation should not have path parameters. |
|
|
51
|
+
| `@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops` | The @route decorator should not be used on standard resource operation signatures. |
|
|
52
|
+
| `@azure-tools/typespec-azure-core/no-response-body` | Ensure that the body is set correctly for the response type. |
|
|
53
|
+
| `@azure-tools/typespec-azure-core/no-format` | Azure services should not use the `@format` decorator. |
|
|
54
|
+
| `@azure-tools/typespec-azure-core/no-multiple-discriminator` | Classes should have at most one discriminator. |
|
|
55
|
+
| `@azure-tools/typespec-azure-core/no-rest-library-interfaces` | Resource interfaces from the TypeSpec.Rest.Resource library are incompatible with Azure.Core. |
|
|
56
|
+
| `@azure-tools/typespec-azure-core/no-unknown` | Azure services must not have properties of type `unknown`. |
|
|
57
|
+
| `@azure-tools/typespec-azure-core/bad-record-type` | Identify bad record definitions. |
|
|
58
|
+
| `@azure-tools/typespec-azure-core/response-schema-problem` | Warn about operations having multiple non-error response schemas. |
|
|
59
|
+
| `@azure-tools/typespec-azure-core/property-name-conflict` | Avoid naming conflicts. |
|
|
60
|
+
| `@azure-tools/typespec-azure-core/rpc-operation-request-body` | Warning for RPC body problems. |
|
|
61
|
+
| `@azure-tools/typespec-azure-core/documentation-required` | Require documentation over enums, models, and operations. |
|
|
62
|
+
| `@azure-tools/typespec-azure-core/key-visibility-required` | Key properties need to have an explicit visibility setting. |
|
|
63
|
+
| `@azure-tools/typespec-azure-core/long-running-polling-operation-required` | Long-running operations should have a linked polling operation. |
|
|
64
|
+
| `@azure-tools/typespec-azure-core/use-standard-names` | Use recommended names for operations. |
|
|
65
|
+
|
|
11
66
|
## Decorators
|
|
12
67
|
|
|
13
68
|
### Azure.Core
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-enum.d.ts","sourceRoot":"","sources":["../../../src/rules/no-enum.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU;;
|
|
1
|
+
{"version":3,"file":"no-enum.d.ts","sourceRoot":"","sources":["../../../src/rules/no-enum.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU;;EAkBrB,CAAC"}
|
|
@@ -3,6 +3,7 @@ export const noEnumRule = createRule({
|
|
|
3
3
|
name: "no-enum",
|
|
4
4
|
description: "Azure services should not use enums.",
|
|
5
5
|
severity: "warning",
|
|
6
|
+
url: "https://azure.github.io/typespec-azure/docs/libraries/azure-core/rules/no-enum",
|
|
6
7
|
messages: {
|
|
7
8
|
default: paramMessage `Azure services should not use the enum keyword. Extensible enums should be defined as unions with "string" as an accepted variant (ex: \`union Choice { Yes: "yes", No: "no", string };\`).`,
|
|
8
9
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-enum.js","sourceRoot":"","sources":["../../../src/rules/no-enum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEpE,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAC;IACnC,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,sCAAsC;IACnD,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE;QACR,OAAO,EAAE,YAAY,CAAA,6LAA6L;KACnN;IACD,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,IAAI,EAAE,CAAC,EAAQ,EAAE,EAAE;gBACjB,OAAO,CAAC,gBAAgB,CAAC;oBACvB,MAAM,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC,IAAI,EAAE;oBAC7B,MAAM,EAAE,EAAE;iBACX,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"no-enum.js","sourceRoot":"","sources":["../../../src/rules/no-enum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEpE,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAC;IACnC,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,sCAAsC;IACnD,QAAQ,EAAE,SAAS;IACnB,GAAG,EAAE,gFAAgF;IACrF,QAAQ,EAAE;QACR,OAAO,EAAE,YAAY,CAAA,6LAA6L;KACnN;IACD,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,IAAI,EAAE,CAAC,EAAQ,EAAE,EAAE;gBACjB,OAAO,CAAC,gBAAgB,CAAC;oBACvB,MAAM,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC,IAAI,EAAE;oBAC7B,MAAM,EAAE,EAAE;iBACX,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure-tools/typespec-azure-core",
|
|
3
|
-
"version": "0.37.0-dev.
|
|
3
|
+
"version": "0.37.0-dev.3",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec Azure Core library",
|
|
6
6
|
"homepage": "https://azure.github.io/typespec-azure",
|
|
7
|
+
"docusaurusWebsite": "https://azure.github.io/typespec-azure/docs",
|
|
7
8
|
"readme": "https://github.com/Azure/typespec-azure/blob/main/packages/typespec-azure-core/README.md",
|
|
8
9
|
"license": "MIT",
|
|
9
10
|
"repository": {
|