Skip to content

Commit

Permalink
Merge pull request #5095 from sher/args-typecheck-ignore
Browse files Browse the repository at this point in the history
Ignore method arguments typechecking in typescript
  • Loading branch information
andrueastman authored Aug 6, 2024
2 parents d836cf4 + 2bbf705 commit 3612506
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Adds generation of default 'color.png` and `outline.png` files when generating plugins. [#4993](https://github.com/microsoft/kiota/issues/4993)
- Adds generation of default 'color.png`and`outline.png` files when generating plugins. [#4993](https://github.com/microsoft/kiota/issues/4993)

### Changed

Expand All @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed a bug in Go where certain namespaces were escaped unexpectedly. [#5012](https://github.com/microsoft/kiota/issues/5012)
- Exclude the `x-openai-isConsequential` extension from cleanup. [#4962](https://github.com/microsoft/kiota/issues/4962)
- Fixed file name and namespace sanitization when generating plugins. [#5019](https://github.com/microsoft/kiota/issues/5019)
- Added TypeScript typecheck suppression to generated method prototype, where anused arguments can cause build fail in projects which use `noUnusedLocals: true` compiler option. [#5095](https://github.com/microsoft/kiota/issues/5095)

## [1.16.0] - 2024-07-05

Expand Down Expand Up @@ -54,7 +55,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added uri-form encoded serialization for PHP. [#2074](https://github.com/microsoft/kiota/issues/2074)
- Added information message with base URL in the CLI experience. [#4635](https://github.com/microsoft/kiota/issues/4635)
- Added optional parameter --disable-ssl-validation for generate, show, and download commands. [#4176](https://github.com/microsoft/kiota/issues/4176)
- For *Debug* builds of kiota, the `--log-level` / `--ll` option is now observed if specified explicitly on the command line. It still defaults to `Debug` for *Debug* builds and `Warning` for *Release* builds. [#4739](https://github.com/microsoft/kiota/pull/4739)
- For _Debug_ builds of kiota, the `--log-level` / `--ll` option is now observed if specified explicitly on the command line. It still defaults to `Debug` for _Debug_ builds and `Warning` for _Release_ builds. [#4739](https://github.com/microsoft/kiota/pull/4739)

### Changed

Expand Down Expand Up @@ -655,7 +656,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Removed unused generated import for PHP Generation.
- Fixed a bug where long namespaces would make Ruby packaging fail.
- Fixed a bug where classes with namespace names are generated outside namespace in Python. [#2188](https://github.com/microsoft/kiota/issues/2188)
- Changed signature of escaped reserved names from {x}*escaped to {x}* in line with Python style guides.
- Changed signature of escaped reserved names from {x}_escaped to {x}_ in line with Python style guides.
- Add null checks in generated Shell language code.
- Fixed a bug where Go indexers would fail to pass the index parameter.
- Fixed a bug where path segments with parameters could be missing words. [#2209](https://github.com/microsoft/kiota/issues/2209)
Expand Down
1 change: 1 addition & 0 deletions src/Kiota.Builder/Writers/TypeScript/CodeFunctionWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public override void WriteCodeElement(CodeFunction codeElement, LanguageWriter w
conventions.GetTypeString(codeMethod.ReturnType, codeElement);
var isVoid = "void".EqualsIgnoreCase(returnType);
CodeMethodWriter.WriteMethodDocumentationInternal(codeElement.OriginalLocalMethod, writer, isVoid, conventions);
CodeMethodWriter.WriteMethodTypecheckIgnoreInternal(codeElement.OriginalLocalMethod, writer);
CodeMethodWriter.WriteMethodPrototypeInternal(codeElement.OriginalLocalMethod, writer, returnType, isVoid, conventions, true);

writer.IncreaseIndent();
Expand Down
5 changes: 5 additions & 0 deletions src/Kiota.Builder/Writers/TypeScript/CodeMethodWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,9 @@ internal static void WriteMethodPrototypeInternal(CodeMethod code, LanguageWrite
var openBracketSuffix = code.Parent is CodeClass || isFunction ? " {" : ";";
writer.WriteLine($"{accessModifier}{functionPrefix}{accessorPrefix}{staticPrefix}{methodName}{(isFunction ? string.Empty : asyncPrefix)}({parameters}){returnTypeSuffix}{openBracketSuffix}");
}

internal static void WriteMethodTypecheckIgnoreInternal(CodeMethod code, LanguageWriter writer)
{
writer.WriteLine("// @ts-ignore");
}
}

0 comments on commit 3612506

Please sign in to comment.