Skip to content

[linting] Enable eslint/no-unsafe-argument #18965

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 23, 2023
Merged

Conversation

svenefftinge
Copy link
Member

@svenefftinge svenefftinge commented Oct 20, 2023

Description

Enable "@typescript-eslint/no-unsafe-argument": "error" (docs) as a linting rule.

It flags any assignments from any to a more specific type and forces us to explicitly handle use of any.
Since we have a few places where this flags, I went through those cases and either fixed or explicitly ignored (only in unit tests and very old code where fixing is riskier).

Summary generated by Copilot

🤖 Generated by Copilot at b3ebeae

This pull request improves the reliability, readability, and type safety of the code in the gitpod-db and gitpod-protocol components, by adding and fixing ESLint rules, error handling, type annotations, and test cases. It also refactors and simplifies some of the database and proxy-factory modules.

Related Issue(s)

Fixes #

How to test

Documentation

Preview status

Gitpod was successfully deployed to your preview environment.

Build Options

Build
  • /werft with-werft
    Run the build with werft instead of GHA
  • leeway-no-cache
  • /werft no-test
    Run Leeway with --dont-test
Publish
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer
  • analytics=segment
  • with-dedicated-emulation
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh. If enabled, with-preview and with-large-vm will be enabled.
  • with-monitoring

/hold

@svenefftinge svenefftinge force-pushed the se/lint-unsafe-arg branch 2 times, most recently from 84b57a2 to cb1ff7e Compare October 23, 2023 07:57
@svenefftinge
Copy link
Member Author

/unhold

@roboquat roboquat merged commit ae38d86 into main Oct 23, 2023
@roboquat roboquat deleted the se/lint-unsafe-arg branch October 23, 2023 09:20
@@ -3072,8 +3052,11 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
const result = await this.authProviderService.createOrgAuthProvider(newProvider);
return AuthProviderEntry.redact(result);
} catch (error) {
const message = error && error.message ? error.message : "Failed to create the provider.";
throw new ApplicationError(ErrorCodes.CONFLICT, message);
if (ApplicationError.hasErrorCode(error)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👁️ now
That means essentially, errors like Host could not be reached. ☝🏻 are responded with INTERNAL_SERVER_ERROR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants