Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/all-pandas-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"landscape-ui": patch
---

Sort the local repositories packages list so it stays consistent
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ describe("ValidationResult", () => {
).toBeInTheDocument();

expect(screen.getByText(/packages to import/i)).toBeInTheDocument();
expect(
screen.getByText("python3-snap-http_1.4.0-0ubuntu0_all"),
).toBeInTheDocument();
expect(screen.getByText("package1-0.2.1")).toBeInTheDocument();
expect(screen.getByText(/page 1 of 10/i)).toBeInTheDocument();
});

Expand All @@ -97,9 +95,7 @@ describe("ValidationResult", () => {
);

expect(screen.getByText(/packages to import/i)).toBeInTheDocument();
expect(
screen.getByText("python3-snap-http_1.4.0-0ubuntu0_all"),
).toBeInTheDocument();
expect(screen.getByText("package1-0.2.1")).toBeInTheDocument();
expect(screen.getByText("package2-1.0.0")).toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
import { renderWithProviders } from "@/tests/render";
import { describe, it, expect } from "vitest";
import LocalRepositoryPackagesList from "./LocalRepositoryPackagesList";
import { paginatedPackages } from "@/tests/mocks/localRepositories";
import {
paginatedPackages,
sortedPackages,
} from "@/tests/mocks/localRepositories";
import { screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";

const singlePagePackages = paginatedPackages.slice(0, 10);

describe("LocalRepositoryPackagesList", () => {
it("renders table with default column header", async () => {
it("renders table with default column header and paginated data", async () => {
renderWithProviders(
<LocalRepositoryPackagesList packages={singlePagePackages} />,
<LocalRepositoryPackagesList packages={paginatedPackages} />,
);

expect(
await screen.findByRole("columnheader", { name: "Package name" }),
).toBeInTheDocument();

for (const pkg of sortedPackages.slice(0, 10)) {
expect(await screen.findByText(pkg)).toBeInTheDocument();
}

expect(await screen.findByText(/page 1 of 3/i)).toBeInTheDocument();
});

it("renders custom header when provided", async () => {
renderWithProviders(
<LocalRepositoryPackagesList
packages={singlePagePackages}
packages={paginatedPackages}
header="Packages to import"
/>,
);
Expand All @@ -31,15 +38,6 @@ describe("LocalRepositoryPackagesList", () => {
).toBeInTheDocument();
});

it("renders package names in table rows", async () => {
renderWithProviders(
<LocalRepositoryPackagesList packages={singlePagePackages} />,
);

expect(await screen.findByText("package-1")).toBeInTheDocument();
expect(screen.getByText("package-2")).toBeInTheDocument();
});

it("renders empty message when no packages", async () => {
renderWithProviders(<LocalRepositoryPackagesList packages={[]} />);

Expand All @@ -48,28 +46,22 @@ describe("LocalRepositoryPackagesList", () => {
).toBeInTheDocument();
});

it("renders pagination info if more than 1 page", async () => {
renderWithProviders(
<LocalRepositoryPackagesList packages={paginatedPackages} />,
);

expect(await screen.findByText(/page 1 of 3/i)).toBeInTheDocument();
});

it("navigates to next page on click", async () => {
const user = userEvent.setup();
renderWithProviders(
<LocalRepositoryPackagesList packages={paginatedPackages} />,
);

await screen.findByText("package-1");
expect(screen.queryByText("package-11")).not.toBeInTheDocument();
assert(sortedPackages[0]);
assert(sortedPackages[10]);
await screen.findByText(sortedPackages[0]);
expect(screen.queryByText(sortedPackages[10])).not.toBeInTheDocument();

const nextButton = screen.getByRole("button", { name: /next/i });
await user.click(nextButton);

expect(screen.getByText("package-11")).toBeInTheDocument();
expect(screen.queryByText("package-1")).not.toBeInTheDocument();
expect(screen.getByText(sortedPackages[10])).toBeInTheDocument();
expect(screen.queryByText(sortedPackages[0])).not.toBeInTheDocument();
});

it("navigates to previous page on click", async () => {
Expand All @@ -78,16 +70,18 @@ describe("LocalRepositoryPackagesList", () => {
<LocalRepositoryPackagesList packages={paginatedPackages} />,
);

await screen.findByText("package-1");
assert(sortedPackages[0]);
assert(sortedPackages[10]);
await screen.findByText(sortedPackages[0]);

const nextButton = screen.getByRole("button", { name: /next/i });
await user.click(nextButton);

expect(screen.getByText("package-11")).toBeInTheDocument();
expect(screen.getByText(sortedPackages[10])).toBeInTheDocument();

const prevButton = screen.getByRole("button", { name: /previous/i });
await user.click(prevButton);

expect(screen.getByText("package-1")).toBeInTheDocument();
expect(screen.getByText(sortedPackages[0])).toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,26 @@
packages,
header = "Package name",
}) => {
const [currentPage, setCurrentPage] = useState(1);

Check warning on line 16 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 16, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 16 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 16, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
const pageSize = 10;

const formattedPackages: LocalPackage[] = packages.map((name) => ({ name }));
const formattedPackages = useMemo<LocalPackage[]>(

Check warning on line 19 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 19, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 19 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 19, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
() =>
packages

Check warning on line 21 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `any` typed value.

Blocking Level: 3, Category: Best Practices Line: 21, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 21 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe return of a value of type `any`.

Blocking Level: 3, Category: Best Practices Line: 21, TypeScript Coding Standard: no-unsafe-return Avoid returning any from a function. The any type can sometimes leak into your codebase. Returned any typed values not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-return
.map((name) => ({ name }))

Check warning on line 22 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .map on an `any` value.

Blocking Level: 3, Category: Best Practices Line: 22, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access

Check warning on line 22 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an `any` value.

Blocking Level: 3, Category: Style Line: 22, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
.toSorted((a, b) => a.name.localeCompare(b.name)),

Check warning on line 23 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `any` typed value.

Blocking Level: 3, Category: Best Practices Line: 23, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 23 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .name on an `any` value.

Blocking Level: 3, Category: Best Practices Line: 23, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access

Check warning on line 23 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .toSorted on an `any` value.

Blocking Level: 3, Category: Best Practices Line: 23, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access

Check warning on line 23 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe return of a value of type `any`.

Blocking Level: 3, Category: Best Practices Line: 23, TypeScript Coding Standard: no-unsafe-return Avoid returning any from a function. The any type can sometimes leak into your codebase. Returned any typed values not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-return
[packages],
);
const pagedPackages = useMemo(

Check warning on line 26 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 26, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 26 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 26, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
() =>
formattedPackages.slice(

Check warning on line 28 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 28, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 28 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .slice on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 28, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access

Check warning on line 28 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe return of a value of type error.

Blocking Level: 3, Category: Best Practices Line: 28, TypeScript Coding Standard: no-unsafe-return Avoid returning any from a function. The any type can sometimes leak into your codebase. Returned any typed values not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-return
(currentPage - 1) * pageSize,
currentPage * pageSize,
),
[formattedPackages, currentPage, pageSize],
);

const columns = useMemo<Column<LocalPackage>[]>(

Check warning on line 35 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 35, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 35 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 35, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
() => [
{
Header: header,
Expand All @@ -37,30 +43,30 @@
row: {
original: { name },
},
}: CellProps<LocalPackage>) => name,

Check warning on line 46 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe return of a value of type error.

Blocking Level: 3, Category: Best Practices Line: 46, TypeScript Coding Standard: no-unsafe-return Avoid returning any from a function. The any type can sometimes leak into your codebase. Returned any typed values not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-return
},
],
[header],
);

const maxPage = Math.ceil(formattedPackages.length / pageSize);

Check warning on line 52 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .length on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 52, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access

return (

Check warning on line 54 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe return of a value of type error.

Blocking Level: 3, Category: Best Practices Line: 54, TypeScript Coding Standard: no-unsafe-return Avoid returning any from a function. The any type can sometimes leak into your codebase. Returned any typed values not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-return
<>
<ResponsiveTable
columns={columns}

Check warning on line 57 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 57, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
data={pagedPackages}

Check warning on line 58 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 58, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
emptyMsg={"No packages associated with this local repository."}
minWidth={320}
/>
<ModalTablePagination
current={currentPage}

Check warning on line 63 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 63, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
max={maxPage}
onPrev={() => {
setCurrentPage((p) => Math.max(1, p - 1));

Check warning on line 66 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 66, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
}}
onNext={() => {
setCurrentPage((p) => Math.min(maxPage, p + 1));

Check warning on line 69 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Invalid operand for a '+' operation. Operands must each be a number or string. Got `any`.

Blocking Level: 2, Category: Functionality Line: 69, TypeScript Coding Standard: restrict-plus-operands When adding two variables, operands must both be of type number or of type string Rule-help: https://typescript-eslint.io/rules/restrict-plus-operands

Check warning on line 69 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 69, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 69 in src/features/local-repositories/components/LocalRepositoryPackagesList/LocalRepositoryPackagesList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe argument of type `any` assigned to a parameter of type `number`.

Blocking Level: 3, Category: Style Line: 69, TypeScript Coding Standard: no-unsafe-argument Avoid calling a function with any in its arguments, and it will disallow spreading any[]. the any type can sometimes leak into your codebase Rule-help: https://typescript-eslint.io/rules/no-unsafe-argument
}}
/>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { renderWithProviders } from "@/tests/render";
import { describe, it, expect } from "vitest";
import { screen } from "@testing-library/react";
import ViewRepositoryPackagesTab from "./ViewRepositoryPackagesTab";
import { repositories } from "@/tests/mocks/localRepositories";
import { repositories, sortedPackages } from "@/tests/mocks/localRepositories";

describe("ViewRepositoryPackagesTab", () => {
it("renders table with correct header after loading", async () => {
Expand All @@ -16,8 +16,7 @@ describe("ViewRepositoryPackagesTab", () => {
await screen.findByRole("columnheader", { name: "Package name" }),
).toBeInTheDocument();

expect(await screen.findByText("package-1")).toBeInTheDocument();
expect(screen.getByText("package-2")).toBeInTheDocument();
expect(screen.getByText("package-3")).toBeInTheDocument();
assert(sortedPackages[0]);
expect(await screen.findByText(sortedPackages[0])).toBeInTheDocument();
});
});
54 changes: 14 additions & 40 deletions src/features/overview/components/DonutChart/DonutChart.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,29 +136,17 @@ describe("DonutChart", () => {
it("uses light-mode default colors by default", () => {
const { container } = renderChart();
const arcs = getArcs(container);
expect(arcs[0]).toHaveAttribute(
"stroke",
colorMap.green.light.default,
);
expect(arcs[1]).toHaveAttribute(
"stroke",
colorMap.orange.light.default,
);
expect(arcs[0]).toHaveAttribute("stroke", colorMap.green.light.default);
expect(arcs[1]).toHaveAttribute("stroke", colorMap.orange.light.default);
expect(arcs[2]).toHaveAttribute("stroke", colorMap.red.light.default);
});

it("uses dark-mode default colors when dark mode is active", () => {
localStorage.setItem("_landscape_dark_theme", "true");
const { container } = renderChart();
const arcs = getArcs(container);
expect(arcs[0]).toHaveAttribute(
"stroke",
colorMap.green.dark.default,
);
expect(arcs[2]).toHaveAttribute(
"stroke",
colorMap.red.dark.default,
);
expect(arcs[0]).toHaveAttribute("stroke", colorMap.green.dark.default);
expect(arcs[2]).toHaveAttribute("stroke", colorMap.red.dark.default);
});

it("keeps default colors on every ring when one is hovered (dim via CSS opacity, not palette swap)", async () => {
Expand All @@ -168,14 +156,8 @@ describe("DonutChart", () => {
await user.hover(getRingGroup(0));

const arcs = getArcs(container);
expect(arcs[0]).toHaveAttribute(
"stroke",
colorMap.green.light.default,
);
expect(arcs[1]).toHaveAttribute(
"stroke",
colorMap.orange.light.default,
);
expect(arcs[0]).toHaveAttribute("stroke", colorMap.green.light.default);
expect(arcs[1]).toHaveAttribute("stroke", colorMap.orange.light.default);
expect(arcs[2]).toHaveAttribute("stroke", colorMap.red.light.default);
});

Expand All @@ -185,9 +167,7 @@ describe("DonutChart", () => {

await user.hover(getRingGroup(0));

expect(getRingGroup(0).getAttribute("class") ?? "").toMatch(
/ring--active/,
);
expect(getRingGroup(0).getAttribute("class") ?? "").toMatch(/ring--active/);
expect(getRingGroup(0).getAttribute("class") ?? "").not.toMatch(
/ring--inactive/,
);
Expand All @@ -211,9 +191,7 @@ describe("DonutChart", () => {
expect(getRingGroup(1).getAttribute("class") ?? "").toMatch(
/ring--inactive/,
);
expect(getRingGroup(2).getAttribute("class") ?? "").toMatch(
/ring--active/,
);
expect(getRingGroup(2).getAttribute("class") ?? "").toMatch(/ring--active/);
});

it("resets state when the inner container loses pointer", async () => {
Expand All @@ -228,7 +206,9 @@ describe("DonutChart", () => {
) as HTMLElement;
fireEvent.mouseLeave(inner);

expect(getRingGroup(0).getAttribute("class") ?? "").not.toMatch(/ring--active/);
expect(getRingGroup(0).getAttribute("class") ?? "").not.toMatch(
/ring--active/,
);
});

it("activates a ring on keyboard focus and clears on blur", () => {
Expand Down Expand Up @@ -291,9 +271,7 @@ describe("DonutChart", () => {
],
});

expect(screen.getByTestId("donut-center-number").textContent).toBe(
"12.3K",
);
expect(screen.getByTestId("donut-center-number").textContent).toBe("12.3K");
});

it("formats compactly when a large ring is hovered", async () => {
Expand All @@ -309,19 +287,15 @@ describe("DonutChart", () => {

await user.hover(getRingGroup(0));

expect(screen.getByTestId("donut-center-number").textContent).toBe(
"87.4K",
);
expect(screen.getByTestId("donut-center-number").textContent).toBe("87.4K");
expect(screen.getByTestId("donut-center-sublabel").textContent).toBe(
"of 100K",
);
});

it("renders a track circle behind each ring with the track class", () => {
const { container } = renderChart();
const tracks = container.querySelectorAll(
`circle[class*='track']`,
);
const tracks = container.querySelectorAll(`circle[class*='track']`);
expect(tracks).toHaveLength(3);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -28,38 +28,38 @@
activeIndex = null,
itemIdPrefix,
}) => {
const { setSidePanelContent } = useSidePanel();

Check warning on line 31 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 31, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
const isLargeScreen = useMediaQuery(`(min-width: ${BREAKPOINT_PX["lg"]}px)`);

Check warning on line 32 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 32, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 32 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 32, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment

// aria-activedescendant doesn't move DOM focus, so scroll the active item ourselves.
useEffect(() => {

Check warning on line 35 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 35, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
if (activeIndex === null || !itemIdPrefix) {
return;
}
const activeItem = document.getElementById(
`${itemIdPrefix}-${activeIndex}`,

Check warning on line 40 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Invalid type "any" of template literal expression.

Blocking Level: 3, Category: Functionality Line: 40, TypeScript Coding Standard: restrict-template-expressions Enforce template literal expressions to be of string type Rule-help: https://typescript-eslint.io/rules/restrict-template-expressions

Check warning on line 40 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Invalid type "never" of template literal expression.

Blocking Level: 3, Category: Functionality Line: 40, TypeScript Coding Standard: restrict-template-expressions Enforce template literal expressions to be of string type Rule-help: https://typescript-eslint.io/rules/restrict-template-expressions
);
activeItem?.scrollIntoView({ block: "nearest" });
}, [activeIndex, itemIdPrefix]);

if (!savedSearches.length) {

Check warning on line 45 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .length on an `any` value.

Blocking Level: 3, Category: Best Practices Line: 45, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
return null;
}

const handleManageSavedSearches = () => {
onManageSearches();

Check warning on line 50 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `any` typed value.

Blocking Level: 3, Category: Best Practices Line: 50, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
setSidePanelContent(

Check warning on line 51 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 51, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
"Manage saved searches",
<Suspense fallback={<LoadingState />}>

Check warning on line 53 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 53, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
<ManageSavedSearchesSidePanel />
</Suspense>,
SIDEPANEL_SIZE,
);
};

return (

Check warning on line 60 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe return of a value of type error.

Blocking Level: 3, Category: Best Practices Line: 60, TypeScript Coding Standard: no-unsafe-return Avoid returning any from a function. The any type can sometimes leak into your codebase. Returned any typed values not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-return
<div className={classes.container}>

Check warning on line 61 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .container on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 61, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access

Check warning on line 61 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 61, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
<div className={classes.header}>

Check warning on line 62 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .header on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 62, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access

Check warning on line 62 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 62, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
<p className="p-text--small-caps u-text--muted p-text--small">
Saved searches
</p>
Expand All @@ -73,58 +73,56 @@
</Button>
</div>
<ul
className={classNames(

Check warning on line 76 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 76, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 76 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 76, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
"p-list--divided u-no-margin--bottom",
classes.list,

Check warning on line 78 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .list on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 78, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
)}
>
{savedSearches.map((savedSearch, index) => (

Check warning on line 81 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `any` typed value.

Blocking Level: 3, Category: Best Practices Line: 81, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 81 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .map on an `any` value.

Blocking Level: 3, Category: Best Practices Line: 81, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
<li key={savedSearch.name}>

Check warning on line 82 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .name on an `any` value.

Blocking Level: 3, Category: Best Practices Line: 82, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access

Check warning on line 82 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe return of a value of type error.

Blocking Level: 3, Category: Best Practices Line: 82, TypeScript Coding Standard: no-unsafe-return Avoid returning any from a function. The any type can sometimes leak into your codebase. Returned any typed values not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-return

Check warning on line 82 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an `any` value.

Blocking Level: 3, Category: Style Line: 82, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
<div
className={classNames(classes.listItem, {

Check warning on line 84 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 84, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 84 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .listItem on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 84, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access

Check warning on line 84 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 84, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
[classes.activeItem]: index === activeIndex,

Check warning on line 85 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .activeItem on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 85, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
})}
>
<Button
type="button"
appearance="base"
id={
itemIdPrefix ? `${itemIdPrefix}-${index}` : undefined
}
id={itemIdPrefix ? `${itemIdPrefix}-${index}` : undefined}

Check warning on line 91 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Invalid type "any" of template literal expression.

Blocking Level: 3, Category: Functionality Line: 91, TypeScript Coding Standard: restrict-template-expressions Enforce template literal expressions to be of string type Rule-help: https://typescript-eslint.io/rules/restrict-template-expressions
aria-selected={index === activeIndex || undefined}
className={classes.search}

Check warning on line 93 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .search on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 93, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access

Check warning on line 93 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 93, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
onClick={() => {
onSavedSearchClick(savedSearch);

Check warning on line 95 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `any` typed value.

Blocking Level: 3, Category: Best Practices Line: 95, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
}}
>
<Row className={classes.row}>

Check warning on line 98 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .row on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 98, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access

Check warning on line 98 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 98, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
<Col size={4}>
<Tooltip
message={savedSearch.title}

Check warning on line 101 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .title on an `any` value.

Blocking Level: 3, Category: Best Practices Line: 101, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access

Check warning on line 101 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an `any` value.

Blocking Level: 3, Category: Style Line: 101, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
positionElementClassName={classes.truncated}

Check warning on line 102 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .truncated on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 102, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access

Check warning on line 102 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 102, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
>
<span>{savedSearch.title}</span>

Check warning on line 104 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .title on an `any` value.

Blocking Level: 3, Category: Best Practices Line: 104, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
</Tooltip>
</Col>
<Col
size={8}
className={classNames(

Check warning on line 109 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 109, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 109 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 109, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
!isLargeScreen && classes.searchQuery,

Check warning on line 110 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .searchQuery on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 110, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
)}
>
<Tooltip
message={savedSearch.search}

Check warning on line 114 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .search on an `any` value.

Blocking Level: 3, Category: Best Practices Line: 114, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access

Check warning on line 114 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an `any` value.

Blocking Level: 3, Category: Style Line: 114, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
positionElementClassName={classes.truncated}

Check warning on line 115 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .truncated on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 115, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access

Check warning on line 115 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 115, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
>
<code>{savedSearch.search}</code>

Check warning on line 117 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .search on an `any` value.

Blocking Level: 3, Category: Best Practices Line: 117, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
</Tooltip>
</Col>
</Row>
</Button>
<div className={classes.actions}>

Check warning on line 122 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .actions on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 122, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access

Check warning on line 122 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 122, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
<SavedSearchActions
savedSearch={savedSearch}

Check warning on line 124 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an `any` value.

Blocking Level: 3, Category: Style Line: 124, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
onSavedSearchRemove={onSavedSearchRemove}

Check warning on line 125 in src/features/saved-searches/components/SavedSearchList/SavedSearchList.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an `any` value.

Blocking Level: 3, Category: Style Line: 125, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import usePageParams from "@/hooks/usePageParams";
import { Form, SearchBox } from "@canonical/react-components";
import classNames from "classnames";
import type { FC, FocusEvent, KeyboardEvent } from "react";

Check warning on line 5 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

'KeyboardEvent' is already defined as a built-in global variable.

Blocking Level: 2, Category: Best Practices Line: 5, TypeScript Coding Standard: no-redeclare Disallow variable redeclaration Rule-help: https://typescript-eslint.io/rules/no-redeclare
import { useEffect, useId, useMemo, useRef, useState } from "react";
import { useOnClickOutside } from "usehooks-ts";
import { useGetSavedSearches } from "../../api";
Expand Down Expand Up @@ -30,36 +30,36 @@
onChange,
}) => {
const { query, setPageParams } = usePageParams();
const [inputText, setInputText] = useState(query);

Check warning on line 33 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 33, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 33 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 33, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
const [showDropdown, setShowDropdown] = useState(false);

Check warning on line 34 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 34, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 34 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 34, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment

const { savedSearches, isLoadingSavedSearches } = useGetSavedSearches();

Check warning on line 36 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe array destructuring of a tuple element with an error typed value.

Blocking Level: 3, Category: Style Line: 36, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment

const containerRef = useRef<HTMLDivElement>(null);

Check warning on line 38 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 38, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 38 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 38, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
const chipsContainerRef = useRef<HTMLDivElement>(null);

Check warning on line 39 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 39, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 39 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 39, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
const inputRef = useRef<HTMLInputElement>(null);

Check warning on line 40 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 40, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 40 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 40, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
const suppressFocusOpenRef = useRef(false);

Check warning on line 41 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 41, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 41 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 41, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
const panelId = useId();

Check warning on line 42 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 42, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 42 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 42, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
const itemIdPrefix = `${panelId}-item`;

Check warning on line 43 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Invalid type "any" of template literal expression.

Blocking Level: 3, Category: Functionality Line: 43, TypeScript Coding Standard: restrict-template-expressions Enforce template literal expressions to be of string type Rule-help: https://typescript-eslint.io/rules/restrict-template-expressions
const [activeIndex, setActiveIndex] = useState<number | null>(null);

Check warning on line 44 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 44, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 44 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 44, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment

const closeDropdown = () => {
setShowDropdown(false);

Check warning on line 47 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 47, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
setActiveIndex(null);

Check warning on line 48 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 48, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
};

const handleDropdownClose = (event: MouseEvent | TouchEvent | FocusEvent) => {

Check warning on line 51 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

'FocusEvent' is an 'error' type that acts as 'any' and overrides all other types in this union type.

Blocking Level: 2, Category: Best Practices Line: 51, TypeScript Coding Standard: no-redundant-type-constituents Disallow members of unions and intersections that do nothing or override type information Rule-help: https://typescript-eslint.io/rules/no-redundant-type-constituents
if (isInsideModalPortal(event.target as Node)) {

Check warning on line 52 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .target on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 52, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
return;
}
closeDropdown();
};

useOnClickOutside(containerRef, handleDropdownClose);

Check warning on line 58 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 58, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

const handleContainerBlur = (event: FocusEvent<HTMLDivElement>) => {
const next = event.relatedTarget as Node | null;

Check warning on line 61 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .relatedTarget on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 61, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
if (next && containerRef.current?.contains(next)) {

Check warning on line 62 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 62, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 62 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .current on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 62, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
return;
}
if (next && isInsideModalPortal(next)) {
Expand All @@ -69,221 +69,218 @@
};

const handleContainerKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {
if (event.key === "Escape" && showDropdown) {

Check warning on line 72 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .key on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 72, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
event.stopPropagation();

Check warning on line 73 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 73, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 73 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .stopPropagation on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 73, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
closeDropdown();
if (
inputRef.current &&
document.activeElement !== inputRef.current
) {
if (inputRef.current && document.activeElement !== inputRef.current) {

Check warning on line 75 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .current on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 75, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
suppressFocusOpenRef.current = true;

Check warning on line 76 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .current on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 76, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
inputRef.current.focus();

Check warning on line 77 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 77, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 77 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .current on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 77, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
}
}
};

useEffect(() => {

Check warning on line 82 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 82, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
setInputText(query);

Check warning on line 83 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 83, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
}, [query]);

const filteredSearches = useMemo(

Check warning on line 86 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 86, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 86 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 86, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
() =>
getFilteredSavedSearches({
inputText,

Check warning on line 89 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 89, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
savedSearches,

Check warning on line 90 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 90, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
search: query,
}),
[savedSearches, inputText, query],
);

// Clamp during render so a removed saved search doesn't leave a stale highlight.
const effectiveActiveIndex =

Check warning on line 97 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 97, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
activeIndex !== null && activeIndex < filteredSearches.length

Check warning on line 98 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .length on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 98, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
? activeIndex
: null;

const handleSearch = () => {
const nextQuery = inputText.trim();

Check warning on line 103 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 103, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 103 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .trim on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 103, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access

Check warning on line 103 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 103, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment

const searches = getFilteredSavedSearches({
inputText: "",
savedSearches,

Check warning on line 107 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 107, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
search: query,
});

const prefix = searches.some(
({ name }) => name.toLowerCase() === nextQuery.toLowerCase(),

Check warning on line 112 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 112, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 112 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .toLowerCase on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 112, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
)
? "search:"
: "";

setPageParams({ query: `${prefix}${nextQuery}` });

Check warning on line 117 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Invalid type "any" of template literal expression.

Blocking Level: 3, Category: Functionality Line: 117, TypeScript Coding Standard: restrict-template-expressions Enforce template literal expressions to be of string type Rule-help: https://typescript-eslint.io/rules/restrict-template-expressions
onChange?.();

Check warning on line 118 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `any` typed value.

Blocking Level: 3, Category: Best Practices Line: 118, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
};

const handleSavedSearchClick = (savedSearch: SavedSearch) => {
setPageParams({ query: `search:${savedSearch.name}` });
onChange?.();

Check warning on line 123 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `any` typed value.

Blocking Level: 3, Category: Best Practices Line: 123, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
};

const handleKeysOnSearchBox = (event: KeyboardEvent<HTMLInputElement>) => {
const { key } = event;

Check warning on line 127 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 127, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment

if (showDropdown) {
if (key === "Enter") {
const highlighted =

Check warning on line 131 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 131, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
effectiveActiveIndex !== null
? filteredSearches[effectiveActiveIndex]

Check warning on line 133 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Computed name [effectiveActiveIndex] resolves to an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 133, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access

Check warning on line 133 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access [effectiveActiveIndex] on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 133, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
: undefined;
if (highlighted) {
handleSavedSearchClick(highlighted);

Check warning on line 136 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe argument of type error typed assigned to a parameter of type `SavedSearch`.

Blocking Level: 3, Category: Style Line: 136, TypeScript Coding Standard: no-unsafe-argument Avoid calling a function with any in its arguments, and it will disallow spreading any[]. the any type can sometimes leak into your codebase Rule-help: https://typescript-eslint.io/rules/no-unsafe-argument
} else {
handleSearch();
}
}
} else if (key === "Enter") {
setShowDropdown(true);

Check warning on line 142 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 142, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
}
};

const handleArrowKeysOnSearchBox = (
event: KeyboardEvent<HTMLInputElement>,
) => {
const itemCount = filteredSearches.length;

Check warning on line 149 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .length on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 149, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access

Check warning on line 149 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 149, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment

if (event.key === "ArrowDown") {

Check warning on line 151 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .key on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 151, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
if (!showDropdown) {
setShowDropdown(true);

Check warning on line 153 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 153, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
return;
}
if (itemCount === 0) {
return;
}
event.preventDefault();

Check warning on line 159 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 159, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 159 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .preventDefault on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 159, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
setActiveIndex((current) => {

Check warning on line 160 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 160, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
if (current === null) {
return 0;
}
return Math.min(current + 1, itemCount - 1);

Check warning on line 164 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Invalid operand for a '+' operation. Operands must each be a number or string. Got `any`.

Blocking Level: 2, Category: Functionality Line: 164, TypeScript Coding Standard: restrict-plus-operands When adding two variables, operands must both be of type number or of type string Rule-help: https://typescript-eslint.io/rules/restrict-plus-operands

Check warning on line 164 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe argument of type `any` assigned to a parameter of type `number`.

Blocking Level: 3, Category: Style Line: 164, TypeScript Coding Standard: no-unsafe-argument Avoid calling a function with any in its arguments, and it will disallow spreading any[]. the any type can sometimes leak into your codebase Rule-help: https://typescript-eslint.io/rules/no-unsafe-argument
});
} else if (event.key === "ArrowUp") {

Check warning on line 166 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .key on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 166, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
if (!showDropdown || itemCount === 0) {
return;
}
event.preventDefault();

Check warning on line 170 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 170, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 170 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .preventDefault on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 170, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
setActiveIndex((current) => {

Check warning on line 171 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 171, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
if (current === null) {
return itemCount - 1;
}
return Math.max(current - 1, 0);
});
} else if (event.key === "Home" && showDropdown && itemCount > 0) {

Check warning on line 177 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .key on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 177, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
event.preventDefault();

Check warning on line 178 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 178, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 178 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .preventDefault on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 178, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
setActiveIndex(0);

Check warning on line 179 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 179, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
} else if (event.key === "End" && showDropdown && itemCount > 0) {

Check warning on line 180 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .key on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 180, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
event.preventDefault();

Check warning on line 181 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 181, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 181 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .preventDefault on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 181, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
setActiveIndex(itemCount - 1);

Check warning on line 182 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 182, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
}
};

return (

Check warning on line 186 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe return of a value of type error.

Blocking Level: 3, Category: Best Practices Line: 186, TypeScript Coding Standard: no-unsafe-return Avoid returning any from a function. The any type can sometimes leak into your codebase. Returned any typed values not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-return
<div
className="p-search-and-filter"
ref={containerRef}

Check warning on line 189 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 189, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
onBlur={handleContainerBlur}
onKeyDown={handleContainerKeyDown}
>
<div
className={classNames(

Check warning on line 194 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 194, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 194 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 194, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
"p-search-and-filter__search-container",
classes.searchContainer,

Check warning on line 196 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .searchContainer on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 196, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
)}
aria-expanded={showDropdown}

Check warning on line 198 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 198, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
ref={chipsContainerRef}

Check warning on line 199 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 199, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
onClick={() => {
setShowDropdown(true);

Check warning on line 201 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 201, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
}}
>
<Form
onSubmit={(event) => {
event.preventDefault();

Check warning on line 206 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `any` typed value.

Blocking Level: 3, Category: Best Practices Line: 206, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 206 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .preventDefault on an `any` value.

Blocking Level: 3, Category: Best Practices Line: 206, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
handleSearch();
}}
className={classNames("p-search-and-filter__box", classes.form)}

Check warning on line 209 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 209, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 209 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .form on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 209, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access

Check warning on line 209 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 209, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
>
<div className={classes.searchBoxContainer}>

Check warning on line 211 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .searchBoxContainer on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 211, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access

Check warning on line 211 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 211, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
<SearchBox
ref={inputRef}

Check warning on line 213 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 213, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
externallyControlled
shouldRefocusAfterReset
autocomplete="off"
className={classes.input}

Check warning on line 217 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .input on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 217, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access

Check warning on line 217 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 217, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
value={inputText}

Check warning on line 218 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 218, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
aria-expanded={showDropdown}

Check warning on line 219 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 219, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
aria-controls={showDropdown ? panelId : undefined}

Check warning on line 220 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 220, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
aria-activedescendant={
showDropdown && effectiveActiveIndex !== null
? `${itemIdPrefix}-${effectiveActiveIndex}`

Check warning on line 223 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Invalid type "any" of template literal expression.

Blocking Level: 3, Category: Functionality Line: 223, TypeScript Coding Standard: restrict-template-expressions Enforce template literal expressions to be of string type Rule-help: https://typescript-eslint.io/rules/restrict-template-expressions
: undefined
}
onChange={(inputValue) => {
setInputText(inputValue);

Check warning on line 227 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 227, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
setActiveIndex(null);

Check warning on line 228 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 228, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
}}
onClear={() => {
setInputText("");

Check warning on line 231 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 231, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
setActiveIndex(null);

Check warning on line 232 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 232, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
setPageParams({ query: "" });
onChange?.();

Check warning on line 234 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `any` typed value.

Blocking Level: 3, Category: Best Practices Line: 234, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
}}
onSearch={handleSearch}
onClick={() => {
setShowDropdown(true);

Check warning on line 238 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 238, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
}}
onFocus={() => {
if (suppressFocusOpenRef.current) {

Check warning on line 241 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .current on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 241, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
suppressFocusOpenRef.current = false;

Check warning on line 242 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .current on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 242, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
return;
}
setShowDropdown(true);

Check warning on line 245 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 245, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
}}
onKeyDown={handleArrowKeysOnSearchBox}
onKeyUp={handleKeysOnSearchBox}
/>
</div>
</Form>
<SearchInfoBox onHelpButtonClick={onHelpButtonClick} />

Check warning on line 252 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an `any` value.

Blocking Level: 3, Category: Style Line: 252, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
</div>
{showDropdown && isLoadingSavedSearches && <LoadingState />}
{showDropdown && !isLoadingSavedSearches && (
<div
id={panelId}

Check warning on line 257 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 257, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
role="group"
aria-label={SAVED_SEARCHES_PANEL_LABEL}
className="p-search-and-filter__panel"
>
<SearchPrompt
onSearchSave={() => {
setInputText("");

Check warning on line 264 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 264, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
}}
search={inputText.trim()}

Check warning on line 266 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 266, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 266 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .trim on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 266, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access

Check warning on line 266 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 266, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
/>

<SavedSearchList
onSavedSearchClick={handleSavedSearchClick}
onManageSearches={closeDropdown}
onSavedSearchRemove={() => {
setShowDropdown(true);

Check warning on line 273 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 273, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call
}}
savedSearches={filteredSearches}

Check warning on line 275 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 275, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
activeIndex={effectiveActiveIndex}

Check warning on line 276 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 276, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
itemIdPrefix={itemIdPrefix}
/>
{filteredSearches.length > 0 && (

Check warning on line 279 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .length on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 279, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
<p
className={classNames(

Check warning on line 281 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe call of a(n) `error` type typed value.

Blocking Level: 3, Category: Best Practices Line: 281, TypeScript Coding Standard: no-unsafe-call Avoid calling an any type value. The any type can sometimes leak into your codebase. The arguments to, and return value of calling an any typed variable are not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-call

Check warning on line 281 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe assignment of an error typed value.

Blocking Level: 3, Category: Style Line: 281, TypeScript Coding Standard: no-unsafe-assignment Avoid assigning any to variables and properties Rule-help: https://typescript-eslint.io/rules/no-unsafe-assignment
"p-text--small u-text--muted u-no-margin--bottom",
classes.keyboardHint,

Check warning on line 283 in src/features/saved-searches/components/SearchBoxWithSavedSearches/SearchBoxWithSavedSearches.tsx

View workflow job for this annotation

GitHub Actions / TICS annotations

Unsafe member access .keyboardHint on an `error` typed value.

Blocking Level: 3, Category: Best Practices Line: 283, TypeScript Coding Standard: no-unsafe-member-access Avoid member access on any typed variables. The any type can sometimes leak into your codebase. Member access on any typed variables is not checked at all by TypeScript, so it creates a potential safety hole Rule-help: https://typescript-eslint.io/rules/no-unsafe-member-access
)}
>
Use <kbd>↑</kbd> <kbd>↓</kbd> to navigate, <kbd>Enter</kbd> to
Expand Down
4 changes: 4 additions & 0 deletions src/tests/mocks/localRepositories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ export const paginatedPackages = Array.from(
{ length: 25 },
(_, i) => `package-${i + 1}`,
);

export const sortedPackages = paginatedPackages.toSorted((a, b) =>
a.localeCompare(b),
);
4 changes: 2 additions & 2 deletions src/tests/mocks/operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const succeededOperation: PackagesValidationOperation = {
"@type":
"type.googleapis.com/canonical.landscape.debarchive.v1beta1.TaskResponse",
output:
"Would add: python3-snap-http_1.4.0-0ubuntu0_all\nWould add: package2-1.0.0\nTotal packages that would be added: 2\n",
"Would add: package1-0.2.1\nWould add: package2-1.0.0\nTotal packages that would be added: 2\n",
},
};

Expand Down Expand Up @@ -122,7 +122,7 @@ export const overCountOperation: PackagesValidationOperation = {
"@type":
"type.googleapis.com/canonical.landscape.debarchive.v1beta1.TaskResponse",
output: [
"Would add: python3-snap-http_1.4.0-0ubuntu0_all",
"Would add: package1-0.2.1",
"Would add: package2-1.0.0",
"Would add: package3-2.1.0",
"Would add: package4-0.9.1",
Expand Down
Loading