Closed vatro closed 2 years ago
svelte-check: no errors / warnings / hints lint: 5 errors ( - 0 ), 357 warnings ( - 51 )
8 out of 9 no-explicit-any
warnings in components are related to lifecycle functions, since:
// Svelte lifecycle d.ts
export declare function beforeUpdate(fn: () => any): void;
export declare function onMount(fn: () => any): void;
export declare function afterUpdate(fn: () => any): void;
export declare function onDestroy(fn: () => any): void;
... I'll just eslint-ignore them.
svelte-check: no errors / warnings / hints lint: 5 errors ( - 0 ), 105 warnings ( - 252 )
Next (e.g. ìn Mesh
):
https://github.com/vatro/svelthree/blob/00e3fada8d93f9bf24363fca84e396d37833d177/src/lib/components/Mesh.svelte#L705 https://github.com/vatro/svelthree/blob/00e3fada8d93f9bf24363fca84e396d37833d177/src/lib/components/Mesh.svelte#L725 https://github.com/vatro/svelthree/blob/00e3fada8d93f9bf24363fca84e396d37833d177/src/lib/components/Mesh.svelte#L862
concerning on
and onx
methods, e.g. ìn Mesh
:
https://github.com/vatro/svelthree/blob/00e3fada8d93f9bf24363fca84e396d37833d177/src/lib/components/Mesh.svelte#L705
https://github.com/vatro/svelthree/blob/00e3fada8d93f9bf24363fca84e396d37833d177/src/lib/components/Mesh.svelte#L725
there are several $on
type definitions in Svelte (runtime + dev):
// svelte/types/runtime/internal/Component.d.ts
export declare class SvelteComponent {
...
$on(type: any, callback: any): () => void;
...
}
// svelte/types/runtime/internal/dev.d.ts
export interface SvelteComponentDev {
...
$on(event: string, callback: (event: any) => void): () => void;
...
}
// svelte/types/runtime/internal/dev.d.ts
export interface SvelteComponentTyped {
...
$on<K extends Extract<keyof Events, string>>(type: K, callback: (e: Events[K]) => void): () => void;
...
}
I believe the first one is the relevant one, so we could
a) just ignore no-explicit-any
here too
b) use the second one + replace any
with unknown or ignore no-explicit-any
I'll go with a) for now and reconsider it later.
svelte-check: no errors / warnings / hints lint: 5 errors ( - 0 ), 89 warnings ( - 16 )
concerning no-explicit-any
warning for get_animation
(e.g. in Mesh
):
https://github.com/vatro/svelthree/blob/00e3fada8d93f9bf24363fca84e396d37833d177/src/lib/components/Mesh.svelte#L862
fix this along with:
.\src\lib\ani\SvelthreeAnimation.ts
8:13 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
36:25 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
.\src\lib\ani\SvelthreeAnimationManager.ts
7:38 error Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
13:50 error Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
171:18 error Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
.\src\lib\ani\SvelthreeAnimationProp.ts
11:35 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
11:43 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
12:20 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
svelte-check: no errors / warnings / hints lint: 0 errors ( - 5 ), 69 warnings ( - 20 )
svelte-check: no errors / warnings / hints lint: 0 errors, 54 warnings ( - 15 )
svelte-check: no errors / warnings / hints lint: 0 errors, 52 warnings ( - 2 )
svelte-check: no errors / warnings / hints lint: 0 errors, 49 warnings ( - 2 )
...\lib\utils\LightTarget.ts
48:51 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
should be fixed by #135
...\lib\components\WebGLRenderer.svelte
15:19 warning '_self' is defined but never used @typescript-eslint/no-unused-vars
will be fixed by #175
...\lib\components\Canvas.svelte
17:19 warning '_self' is defined but never used @typescript-eslint/no-unused-vars
will be fixed by #176
svelte-check: no errors / warnings / hints lint: 0 errors, 44 warnings ( - 5 )
svelte-check: no errors / warnings / hints lint: 0 errors, 40 warnings ( - 4 )
svelte-check: no errors / warnings / hints lint: 0 errors, 3 warnings ( - 37 )
The remaining 3 warnings should be fixed by: #135, #175 and #176
Current status: #169
Whole project:
no-explicit-any
: type properly or ignore warning.no-unused-vars
: fix.