Remove and forbid @ts-expect-error (#36513)
Removes `@ts-expect-error` in the code base and forbids it. --------- Signed-off-by: wxiaoguang <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: silverwind <[email protected]> Co-authored-by: silverwind <[email protected]> Co-authored-by: wxiaoguang <[email protected]>
This commit is contained in:
co-authored by
copilot-swe-agent[bot] <198982749+[email protected]>
silverwind
silverwind
wxiaoguang
parent
c2dea22926
commit
7883f6dde9
@@ -1,9 +1,9 @@
|
||||
import type {SortableOptions, SortableEvent} from 'sortablejs';
|
||||
import type SortableType from 'sortablejs';
|
||||
|
||||
export async function createSortable(el: Element, opts: {handle?: string} & SortableOptions = {}): Promise<SortableType> {
|
||||
// @ts-expect-error: wrong type derived by typescript
|
||||
const {Sortable} = await import(/* webpackChunkName: "sortablejs" */'sortablejs');
|
||||
export async function createSortable(el: HTMLElement, opts: {handle?: string} & SortableOptions = {}): Promise<SortableType> {
|
||||
// type reassigned because typescript derives the wrong type from this import
|
||||
const {Sortable} = (await import(/* webpackChunkName: "sortablejs" */'sortablejs') as unknown as {Sortable: typeof SortableType});
|
||||
|
||||
return new Sortable(el, {
|
||||
animation: 150,
|
||||
|
||||
Reference in New Issue
Block a user