homarr-labs / homarr

Require template literals instead of string concatenation JS-0246
Anti-pattern
Minor
2 months ago7 months old
36    },
37  });
38
39  const attribute = options.entityUnit.length > 0 ? " " + options.entityUnit : "";40
41  const handleClick = React.useCallback(() => {
42    if (isEditMode) {
32
33  return rgbaColors.map((color) => {
34    return (
35      "#" +36      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion37      color38        .split("(")[1]!39        .replaceAll(" ", "")40        .replace(")", "")41        .split(",")42        .map((color) => parseInt(color, 10))43        .slice(0, 3)44        .map((color) => color.toString(16).padStart(2, "0"))45        .join("")46    );
47  }) as unknown as MantineColorsTuple;
48};
36    },
37  });
38
39  const attribute = options.entityUnit.length > 0 ? " " + options.entityUnit : "";40
41  const handleClick = React.useCallback(() => {
42    if (isEditMode) {
36    },
37  });
38
39  const attribute = options.entityUnit.length > 0 ? " " + options.entityUnit : "";40
41  const handleClick = React.useCallback(() => {
42    if (isEditMode) {
36    },
37  });
38
39  const attribute = options.entityUnit.length > 0 ? " " + options.entityUnit : "";40
41  const handleClick = React.useCallback(() => {
42    if (isEditMode) {