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

Add types to ListResources #874

Merged
merged 6 commits into from
Jun 5, 2024
Merged

Commits on May 31, 2024

  1. Remove .jsx extension from imports

    This makes imports flexible to .tsx file conversion.
    victorlin committed May 31, 2024
    Configuration menu
    Copy the full SHA
    5186c63 View commit details
    Browse the repository at this point in the history

Commits on Jun 5, 2024

  1. Simplify intermediate functions

    Inline the functions and use individual variables for each part of the
    two-tuple returned by Object.entries().
    victorlin committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    34a3140 View commit details
    Browse the repository at this point in the history
  2. Add types to ListResources

    Non-exhaustive attempt to add types. Note that with noImplicitAny
    disabled, there is still a decent chunk of untyped variables.
    victorlin committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    432577b View commit details
    Browse the repository at this point in the history
  3. Rename variables to reflect types

    - replace generic 'data|state' with 'card|resource|group'
    - replace generic 'error' with 'data fetch error'
    - replace 'modal' with 'modal resource'
    victorlin committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    82b0521 View commit details
    Browse the repository at this point in the history
  4. Fix error-prone code exposed by TypeScript conversion

    These "worked" in normal JS under expected usage but raise errors by the
    TypeScript compiler which generally catches unhandled edge cases. Each
    has been addressed with inline reasoning.
    victorlin committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    54be4d6 View commit details
    Browse the repository at this point in the history
  5. Add individual exceptions for unused vars

    The alternative of turning off noUnusedLocals is not desirable since we
    still want to catch unused imports which is done by the same rule. This
    is the same reason why no-unused-vars is enabled in ESLint with
    exceptions in the lines below each change.
    victorlin committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    7c750e2 View commit details
    Browse the repository at this point in the history