rancher-sandbox / rancher-desktop

Container Management and Kubernetes on the Desktop
https://rancherdesktop.io
Apache License 2.0
6.04k stars 285 forks source link

Refactor `Function` type usage #5544

Open rak-phillip opened 1 year ago

rak-phillip commented 1 year ago
Don't use `Function` as a type. The `Function` type accepts any function-like value.
It provides no type safety when calling the function, which can be a common source of bugs.
It also accepts things like class declarations, which will throw at runtime as they will not be called with `new`.
If you are expecting the function to accept certain arguments, you should explicitly define the function shape.eslint[@typescript-eslint/ban-types](https://typescript-eslint.io/rules/ban-types)
interface Function

Files that need to be fixed

Please add a comment on why (I assume it's the Function?)

_Originally posted by @mook-as in https://github.com/rancher-sandbox/rancher-desktop/pull/5287#discussion_r1328987446_

jandubois commented 11 months ago

@mook-as Can this be closed? Should it be deferred?

mook-as commented 11 months ago

There's still usages (and code comments referencing this issue); in general we need a cleanup round to get rid of the vestiges of the nuxt removal, but there isn't a specific time frame for it as far as I know.