Commit 152a0b7
committed
(lint/types): fix or ignore remaining lint type errors
- use TS 3.0 defaultProps support so that clearOnResize doesn't have to
be optional
- ignore consistent-type-assertions and no-non-null-assertion in places
where those hacks were intentionally used for simplicity's sake
- fix some strict-boolean-expressions by checking for types explicitly
or using nullish coalescing
- nullish coalescing on canvasProps isn't breaking because it already
had PropTypes.object defined
- nullish coalescing on DPR isn't breaking because it should be a
number (or undefined), and shouldn't be 0
- and even if it were 0, it would've been set to 1 before anyway
bc of the Math.max
- ignore several strict-boolean-expressions in _resizeCanvas because
checking for undefined specifically is a breaking change
- 0, '', null, etc falsey width/height was still resized previously,
so if we check for undefined instead, it will stop resizing falseys
- 0, '', null, etc don't make a lot of sense to set a width/height,
if these were used it may have been accidental or for some
temporary hack
- accidental would be a bug, so will consider a fix, but fixing
that bug would still be breaking :/ :/1 parent c6dc090 commit 152a0b7
1 file changed
+14
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | | - | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| 75 | + | |
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
| |||
87 | 90 | | |
88 | 91 | | |
89 | 92 | | |
| 93 | + | |
| 94 | + | |
90 | 95 | | |
91 | | - | |
| 96 | + | |
92 | 97 | | |
93 | 98 | | |
| 99 | + | |
94 | 100 | | |
95 | 101 | | |
96 | 102 | | |
| |||
99 | 105 | | |
100 | 106 | | |
101 | 107 | | |
102 | | - | |
| 108 | + | |
103 | 109 | | |
| 110 | + | |
104 | 111 | | |
105 | 112 | | |
106 | 113 | | |
| 114 | + | |
107 | 115 | | |
108 | 116 | | |
109 | 117 | | |
| 118 | + | |
110 | 119 | | |
111 | 120 | | |
112 | 121 | | |
| |||
0 commit comments