Skip to content

Commit 7321cb2

Browse files
committed
fix: try to fix lint
1 parent 283524c commit 7321cb2

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

src/core.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export function zoom(chart, amount, transition = 'none', trigger = 'api') {
8383

8484
chart.update(transition);
8585

86-
// @ts-expect-error args not assignable to unknonw[]
86+
// @ts-expect-error args not assignable to unknown[]
8787
call(zoomOptions.onZoom, [{chart, trigger}]);
8888
}
8989

@@ -113,7 +113,7 @@ export function zoomRect(chart, p0, p1, transition = 'none', trigger = 'api') {
113113

114114
chart.update(transition);
115115

116-
// @ts-expect-error args not assignable to unknonw[]
116+
// @ts-expect-error args not assignable to unknown[]
117117
call(zoomOptions.onZoom, [{chart, trigger}]);
118118
}
119119

@@ -131,7 +131,7 @@ export function zoomScale(chart, scaleId, range, transition = 'none', trigger =
131131
updateRange(scale, range, undefined, true);
132132
chart.update(transition);
133133

134-
// @ts-expect-error args not assignable to unknonw[]
134+
// @ts-expect-error args not assignable to unknown[]
135135
call(state.options.zoom?.onZoom, [{chart, trigger}]);
136136
}
137137

@@ -156,7 +156,7 @@ export function resetZoom(chart, transition = 'default') {
156156
});
157157
chart.update(transition);
158158

159-
// @ts-expect-error args not assignable to unknonw[]
159+
// @ts-expect-error args not assignable to unknown[]
160160
call(state.options.zoom.onZoomComplete, [{chart}]);
161161
}
162162

@@ -231,7 +231,7 @@ export function pan(chart, delta, enabledScales, transition = 'none') {
231231

232232
chart.update(transition);
233233

234-
// @ts-expect-error args not assignable to unknonw[]
234+
// @ts-expect-error args not assignable to unknown[]
235235
call(onPan, [{chart}]);
236236
}
237237

src/handlers.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,18 @@ function getPointPosition(event, chart) {
6868
return getRelativePosition(event, chart);
6969
}
7070

71+
/**
72+
* @param {import('chart.js').Chart} chart
73+
* @param {*} event
74+
* @param {import('../types/options').ZoomOptions} zoomOptions
75+
*/
7176
function zoomStart(chart, event, zoomOptions) {
7277
const {onZoomStart, onZoomRejected} = zoomOptions;
7378
if (onZoomStart) {
7479
const point = getPointPosition(event, chart);
80+
// @ts-expect-error args not assignable to unknown[]
7581
if (call(onZoomStart, [{chart, event, point}]) === false) {
82+
// @ts-expect-error args not assignable to unknown[]
7683
call(onZoomRejected, [{chart, event}]);
7784
return false;
7885
}
@@ -93,7 +100,7 @@ export function mouseDown(chart, event) {
93100
keyPressed(getModifierKey(panOptions), event) ||
94101
keyNotPressed(getModifierKey(zoomOptions.drag), event)
95102
) {
96-
// @ts-expect-error args not assignable to unknonw[]
103+
// @ts-expect-error args not assignable to unknown[]
97104
return call(zoomOptions.onZoomRejected, [{chart, event}]);
98105
}
99106

@@ -194,13 +201,19 @@ export function mouseUp(chart, event) {
194201

195202
state.dragging = false;
196203
state.filterNextClick = true;
197-
// @ts-expect-error args not assignable to unknonw[]
204+
// @ts-expect-error args not assignable to unknown[]
198205
call(onZoomComplete, [{chart}]);
199206
}
200207

208+
/**
209+
* @param {import('chart.js').Chart} chart
210+
* @param {*} event
211+
* @param {import('../types/options').ZoomOptions} zoomOptions
212+
*/
201213
function wheelPreconditions(chart, event, zoomOptions) {
202214
// Before preventDefault, check if the modifier key required and pressed
203215
if (keyNotPressed(getModifierKey(zoomOptions.wheel), event)) {
216+
// @ts-expect-error args not assignable to unknown[]
204217
call(zoomOptions.onZoomRejected, [{chart, event}]);
205218
return;
206219
}

0 commit comments

Comments
 (0)