'factory' is defined but never used
8export const { componentLoader, definition, serverDataLoader } = createWidgetDefinition("hardwareUsage", {
9 icon: IconVideo,
10 supportedIntegrations: ["getDashDot"],
11 options: optionsBuilder.from((factory) => ({})),12})
13 .withServerData(() => import("./serverData"))
14 .withDynamicImport(() => import("./component"));
'z' is defined but never used
1import { IconVideo } from "@tabler/icons-react";
2
3import { z } from "@homarr/validation"; 4
5import { createWidgetDefinition } from "../definition";
6import { optionsBuilder } from "../options";
Description
Unused variables are generally considered a code smell and should be avoided.
Removing unused references - It prevents unused modules from being loaded at runtime, improving performance, and preventing the compiler from loading metadata that will never be used. - It prevents conflicts that may occur when trying to reference another variable.
NOTE: If you have intentionally left a variable unused, we suggest you to prefix the variable name with a _
to prevent them from being flagged by DeepSource.
Bad Practice
import fs from 'fs' // <- unused
import { readFileSync } from 'fs'
const text = readFileSync('declaration_of_independence.txt', 'utf-8')
console.log(text)
Recommended
import { readFileSync } from 'fs'
const text = readFileSync('declaration_of_independence.txt', 'utf-8')
console.log(text)