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(null): strict null checks for injected drawing-controller #6272

Merged
merged 6 commits into from
Dec 17, 2022

Conversation

dbjorge
Copy link
Contributor

@dbjorge dbjorge commented Dec 16, 2022

Details

This PR adds the injected DrawingController + a few related/dependent files to the strict null check list.

The most interesting of the changes was updating the DrawerInitData type to not be generic. Previously, it was genericized over the data type an individual drawer expected (in particular, svg-drawer expects to only be used with something special). But the generic type usage meant that in practice, the individual drawers were written looking like they could safely assume what type of input they were given with the relevant any conversions happening in the drawer controller/initiator, which wasn't really accurate - if a type assumption was wrong, it'd be the individual drawer that would have to be aware of the mistake. This change moves the type assertions in question to the drawer.

Overall, these changes enabled autoadding several more assessment folders and brought us from 78% to 80% null checked:

❯ yarn null:progress
yarn run v1.22.19
$ node ./tools/strict-null-checks/progress.js
## Web strict-null progress

**80%** complete (**1244**/1562 non-test files)

*Contribute at [#2869](https://github.com/microsoft/accessibility-insights-web/issues/2869). Last update: Fri Dec 16 2022*
Motivation

#2869

Context

n/a

Pull request checklist

  • Addresses an existing issue: Codebase should use strict null checks #2869
  • Ran yarn null:autoadd
  • Ran yarn fastpass
  • Added/updated relevant unit test(s) (and ran yarn test)
  • Verified code coverage for the changes made. Check coverage report at: <rootDir>/test-results/unit/coverage
  • PR title AND final merge commit title both start with a semantic tag (fix:, chore:, feat(feature-name):, refactor:). See CONTRIBUTING.md.
  • [n/a] (UI changes only) Added screenshots/GIFs to description above
  • [n/a] (UI changes only) Verified usability with NVDA/JAWS

@dbjorge dbjorge requested a review from a team as a code owner December 16, 2022 21:32
Copy link
Contributor

@peterdur peterdur left a comment

Choose a reason for hiding this comment

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

LGTM! Reviewed changes, built locally, smoke tested

@dbjorge dbjorge merged commit 2967c3f into microsoft:main Dec 17, 2022
@dbjorge dbjorge deleted the null-20221216 branch December 17, 2022 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants