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

Opt in to stricter TypeScript checks #1422

Merged
merged 3 commits into from
May 5, 2023
Merged

Opt in to stricter TypeScript checks #1422

merged 3 commits into from
May 5, 2023

Commits on May 5, 2023

  1. Enable strictest TS settings and fix lints

    - exactOptionalPropertyTypes
    - noPropertyAccessFromIndexSignature
    - noImplicitOverride
    
    This commit also cleans up deprecated lints, migrates older lints to
    `n/` and sets up the import lint plugins needed for a good importing
    experience.
    
    There's a lot of changes in this commit, but most of it is minor tweaks
    to deal with stylistic issues raised by lints.
    
    The biggest substantive changes were required by
    `exactOptionalPropertyTypes` and `noPropertyAccessFromIndexSignature`.
    Both of these strict settings revealed many places where our code didn't
    clearly handle missing values and nulls, and this commit adds the
    necessary checks.
    
    Some common patterns:
    
    - Migrate C-style for loops to for/of loops, which eliminates nulls
    - Pervasive use of the (already existing) `PresentArray` pattern and its
      utilities. Added `getFirst` and `getLast` utilities, as well as some
      variations on the present array checks.
    - Used `?` to propagate undefined in testing situations where undefined
      would fail equality checks anyway.
    wycats committed May 5, 2023
    Configuration menu
    Copy the full SHA
    5d765cf View commit details
    Browse the repository at this point in the history
  2. Fix lint

    wycats committed May 5, 2023
    Configuration menu
    Copy the full SHA
    5bbd7b1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e9d8098 View commit details
    Browse the repository at this point in the history