Skip to content

Commit

Permalink
Create core-IntegerTypesRule-2024-3-5-18-54-1.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tjprescott committed Apr 8, 2024
1 parent bcbe56f commit a710224
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .chronus/changes/core-IntegerTypesRule-2024-3-5-18-54-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: feature
packages:
- "@azure-tools/typespec-autorest"
- "@azure-tools/typespec-azure-core"
---

Add `use-standard-integer` rule to disable LintDiff `IntegerTypeMustHaveFormat`.
2 changes: 1 addition & 1 deletion packages/typespec-autorest/test/formats.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe("typespec-autorest: format", () => {
});

it("ensures certain scalars emit int32 and int64 formats", async () => {
const [res, diagnostics] = await emitOpenApiWithDiagnostics(
const [res, _] = await emitOpenApiWithDiagnostics(
`
@service
namespace Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const useStandardInteger = createRule({
"uint32",
"uint64",
];
for (const [name, prop] of model.properties) {
for (const [_, prop] of model.properties) {
if (prop.type.kind === "Scalar") {
if (nonRecommendedInts.includes(prop.type.name)) {
context.reportDiagnostic({
Expand Down

0 comments on commit a710224

Please sign in to comment.