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

chore(typescript): enable useUnknownInCatchVariables in core #3211

Merged
merged 1 commit into from
Jan 27, 2022

Commits on Jan 27, 2022

  1. chore(typescript): enable useUnknownInCatchVariables in core

    this commit enables the 'useUnknownInCatchVariables' flag in the core
    compiler's tsconfig.json file. the remainder of the changes related
    directly to errors emitted by the TypeScript compiler as a result of
    this change.
    
    the most common change in this commit is updating a `catch` block that
    consists of a single call to stencil's `catchError` function. because
    `catchError` may theoretically accept a value or object that does not
    conform to the `Error` interface, we annotate many of the error
    variables declared in the `catch` block as type `any`, in a good-faith
    effort not to lose any useful information that we would otherwise turn
    into a `Diagnostic`. Using a type guard or other type narrowing
    mechanism would be feasible if any value that is not of type `Error`
    were logged in some other way. However in an attempt to not pollute the
    codebase with two different logging paths, we accept the ambiguity of
    `catchError` and catching errors of type `any`  for the time being.
    rwaskiewicz committed Jan 27, 2022
    Configuration menu
    Copy the full SHA
    f223d61 View commit details
    Browse the repository at this point in the history