nursery/useSvelteEventDispatcherTypes
nursery · since 2.6.4
{
"linter": {
"rules": {
"nursery": {
"useSvelteEventDispatcherTypes": "error"
}
}
}
}Require createEventDispatcher calls to declare the types of their events.
<script lang="ts">
import { createEventDispatcher } from "svelte";
const dispatch = createEventDispatcher();
</script><script lang="ts">
import { createEventDispatcher } from "svelte";
const dispatch = createEventDispatcher<{ save: string; close: null }>();
</script>Examples from the Biome documentation.
ESLint does not have this rule.
Oxlint does not have this rule.
nursery/useSvelteEventDispatcherTypes
nursery · since 2.6.4
{
"linter": {
"rules": {
"nursery": {
"useSvelteEventDispatcherTypes": "error"
}
}
}
}Disallow number literal object member names which are not base 10 or use underscore as separator.
Require internal navigation in SvelteKit apps to use paths built with resolve().
Require PlatformColor() and DynamicColorIOS() calls to use values written directly in the call.
Require importing SvelteKit's app state from $app/state instead of $app/stores.
Ensure that platform-specific React Native components are only imported in files named for that platform.
Require the reactive classes from svelte/reactivity instead of built-in objects that are modified.