Skip to content
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

Replace @ts-ignore by @ts-expect-error #9759

Closed
timroes opened this issue Jan 24, 2022 · 0 comments · Fixed by #14221
Closed

Replace @ts-ignore by @ts-expect-error #9759

timroes opened this issue Jan 24, 2022 · 0 comments · Fixed by #14221
Assignees
Labels
area/frontend Related to the Airbyte webapp autoteam technical-debt issues to fix code smell

Comments

@timroes
Copy link
Contributor

timroes commented Jan 24, 2022

We currently use @ts-ignore in a couple of places around the UI. In cases where it's really needed to deactivate the typed compiler (what this command do), we should favor @ts-expect-error above @ts-ignore. They both do pretty similar things (disabling the typed compiler for that place), but @ts-expect-error will actually fail, if the next line wouldn't throw a compiler error. The danger of @ts-ignore is that they might often be forgotten and left in places even if the underlying issue that throw the type error is actually fixed (e.g. here an example), but still keep the typed compiler disabled in those places and therefore decrease code safteyness in general.

To also prevent usage of @ts-ignore we should change the eslint config for the corresponding rule to:

    "@typescript-eslint/ban-ts-comment": [
      "error",
      {
        "ts-ignore": true,
        "ts-expect-error": "allow-with-description"
      }
    ],

Thus @ts-ignore would be forbidden completely and @ts-expect-error allowed only with a comment.

Priority: low

@timroes timroes added area/frontend technical-debt issues to fix code smell labels Jan 24, 2022
@bleonard bleonard added autoteam area/frontend Related to the Airbyte webapp labels Apr 26, 2022
@timroes timroes self-assigned this Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend Related to the Airbyte webapp autoteam technical-debt issues to fix code smell
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants