Skip to content

chore: setup knip and remove unused exports, files, and dependencies #17608

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a75993a
chore: add knip as dev dep and create config
brettkolodny Apr 29, 2025
d947dc7
chore: update knip config to ignore exported types and interfaces
brettkolodny Apr 29, 2025
a23554c
chore: add unused imports to biome config
brettkolodny Apr 29, 2025
cf48a1b
chore: remove unused imports
brettkolodny Apr 29, 2025
1e2abbf
chore: remove unused exports
brettkolodny Apr 29, 2025
acb2dd3
chore: remove unused exports
brettkolodny Apr 29, 2025
952015b
chore: remove unused exports
brettkolodny Apr 29, 2025
fd1b1a6
chore: remove unused exports
brettkolodny Apr 29, 2025
f45a9c2
chore: remove duplicate exports
brettkolodny Apr 29, 2025
7b66bb4
chore: remove duplicate exports
brettkolodny Apr 29, 2025
4388699
chore: remove duplicate exports
brettkolodny Apr 29, 2025
85e845b
chore: remove unused dependencies
brettkolodny Apr 29, 2025
195a7e6
chore: remove unused script
brettkolodny Apr 29, 2025
28b3394
chore: update knip config to ignore protoc binary
brettkolodny Apr 29, 2025
c0ceb87
chore: remove unused files
brettkolodny Apr 29, 2025
e8b672e
chore: remove unused dev dependencies
brettkolodny Apr 29, 2025
662d812
chore: remove unused dev dependencies
brettkolodny Apr 29, 2025
e50ca41
chore: remove unused dev dependencies
brettkolodny Apr 29, 2025
2619b00
chore: remove unused dev dependencies
brettkolodny Apr 29, 2025
25ccd6c
Merge branch 'main' into brett-i600/add-knip-to-coder-coder-and-remov…
brettkolodny Apr 29, 2025
3c097a4
fix: re-add ts-proto as a dev dep
brettkolodny Apr 29, 2025
db6c7b5
Merge branch 'main' into brett-i600/add-knip-to-coder-coder-and-remov…
brettkolodny Apr 30, 2025
501187e
chore: move serviceWorker.ts to knip entry
brettkolodny Apr 30, 2025
b51d7f8
chore: add e2e files as knip project
brettkolodny Apr 30, 2025
c509697
chore: remove unused exports
brettkolodny Apr 30, 2025
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
Prev Previous commit
Next Next commit
chore: remove unused imports
  • Loading branch information
brettkolodny committed Apr 29, 2025
commit cf48a1b4c4853e9577777c54aada55815d43cedf
29 changes: 11 additions & 18 deletions site/.knip.jsonc
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
{
"$schema": "https://unpkg.com/knip@5/schema.json",
"entry": [
"./src/index.tsx"
],
"project": [
"./src/**/*.ts",
"./src/**/*.tsx"
],
"ignore": [
"**/*Generated.ts"
],
// This sets knip not to report unused exports of types and interfaces
// as long as they are used within the file.
"ignoreExportsUsedInFile": {
"interface": true,
"type": true
}
}
"$schema": "https://unpkg.com/knip@5/schema.json",
"entry": ["./src/index.tsx"],
"project": ["./src/**/*.ts", "./src/**/*.tsx"],
"ignore": ["**/*Generated.ts"],
// This sets knip not to report unused exports of types and interfaces
// as long as they are used within the file.
"ignoreExportsUsedInFile": {
"interface": true,
"type": true
}
}
1 change: 0 additions & 1 deletion site/e2e/tests/deployment/idpOrgSync.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
deleteOrganization,
setupApiCalls,
} from "../../api";
import { users } from "../../constants";
import { login, randomName, requiresLicense } from "../../helpers";
import { beforeCoderTest } from "../../hooks";

Expand Down
2 changes: 1 addition & 1 deletion site/e2e/tests/organizations/auditLogs.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Page, expect, test } from "@playwright/test";
import { expect, test } from "@playwright/test";
import {
createOrganization,
createOrganizationMember,
Expand Down
8 changes: 2 additions & 6 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,7 @@
"vite-plugin-checker": "0.8.0",
"vite-plugin-turbosnap": "1.0.3"
},
"browserslist": [
"chrome 110",
"firefox 111",
"safari 16.0"
],
"browserslist": ["chrome 110", "firefox 111", "safari 16.0"],
"resolutions": {
"optionator": "0.9.3",
"semver": "7.6.2"
Expand All @@ -221,4 +217,4 @@
"prismjs": "1.30.0"
}
}
}
}
1 change: 0 additions & 1 deletion site/src/api/queries/organizations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import type {
GroupSyncSettings,
PaginatedMembersRequest,
PaginatedMembersResponse,
ProvisionerJobStatus,
RoleSyncSettings,
UpdateOrganizationRequest,
} from "api/typesGenerated";
Expand Down
1 change: 0 additions & 1 deletion site/src/components/Avatar/AvatarDataSkeleton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Skeleton from "@mui/material/Skeleton";
import { Stack } from "components/Stack/Stack";
import type { FC } from "react";

export const AvatarDataSkeleton: FC = () => {
Expand Down
3 changes: 0 additions & 3 deletions site/src/modules/dashboard/Navbar/NavbarView.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import { API } from "api/api";
import { experiments } from "api/queries/experiments";
import type * as TypesGen from "api/typesGenerated";
import { Button } from "components/Button/Button";
import { ExternalImage } from "components/ExternalImage/ExternalImage";
import { CoderIcon } from "components/Icons/CoderIcon";
import type { ProxyContextValue } from "contexts/ProxyContext";
import { useWebpushNotifications } from "contexts/useWebpushNotifications";
import { useEmbeddedMetadata } from "hooks/useEmbeddedMetadata";
import { NotificationsInbox } from "modules/notifications/NotificationsInbox/NotificationsInbox";
import type { FC } from "react";
import { useQuery } from "react-query";
import { NavLink, useLocation } from "react-router-dom";
import { cn } from "utils/cn";
import { DeploymentDropdown } from "./DeploymentDropdown";
Expand Down
1 change: 0 additions & 1 deletion site/src/modules/management/DeploymentSidebarView.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { FeatureStageBadge } from "components/FeatureStageBadge/FeatureStageBadge";
import {
Sidebar as BaseSidebar,
SettingsSidebarNavItem as SidebarNavItem,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from "@storybook/react";
import { expect, fn, userEvent, waitFor, within } from "@storybook/test";
import { expect, fn, userEvent, within } from "@storybook/test";
import { MockNotifications } from "testHelpers/entities";
import { InboxPopover } from "./InboxPopover";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Meta, StoryObj } from "@storybook/react";
import { MockProvisionerJob } from "testHelpers/entities";
import { JobStatusIndicator } from "./JobStatusIndicator";

const meta: Meta<typeof JobStatusIndicator> = {
Expand Down
2 changes: 1 addition & 1 deletion site/src/modules/resources/AgentDevcontainerCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Link from "@mui/material/Link";
import Tooltip, { type TooltipProps } from "@mui/material/Tooltip";
import Tooltip from "@mui/material/Tooltip";
import type {
Workspace,
WorkspaceAgent,
Expand Down
1 change: 0 additions & 1 deletion site/src/modules/resources/AppLink/AppLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { API } from "api/api";
import type * as TypesGen from "api/typesGenerated";
import { displayError } from "components/GlobalSnackbar/utils";
import { useProxy } from "contexts/ProxyContext";
import { useEffect } from "react";
import { type FC, type MouseEvent, useState } from "react";
import { createAppLinkHref } from "utils/apps";
import { generateRandomString } from "utils/random";
Expand Down
1 change: 0 additions & 1 deletion site/src/pages/AuditPage/AuditPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { paginatedAudits } from "api/queries/audits";
import { ErrorAlert } from "components/Alert/ErrorAlert";
import { useFilter } from "components/Filter/Filter";
import { useUserFilterMenu } from "components/Filter/UserFilter";
import { isNonInitialPage } from "components/PaginationWidget/utils";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
selectTemplatesByGroup,
systemNotificationTemplates,
} from "api/queries/notifications";
import { FeatureStageBadge } from "components/FeatureStageBadge/FeatureStageBadge";
import { Loader } from "components/Loader/Loader";
import {
SettingsHeader,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import {
TableHeader,
TableRow,
} from "components/Table/Table";
import { TableLoader } from "components/TableLoader/TableLoader";
import { UserAutocomplete } from "components/UserAutocomplete/UserAutocomplete";
import type { PaginationResultInfo } from "hooks/usePaginatedQuery";
import { TriangleAlert } from "lucide-react";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from "@storybook/react";
import { expect, userEvent, waitFor, within } from "@storybook/test";
import { expect, userEvent, within } from "@storybook/test";
import { Table, TableBody } from "components/Table/Table";
import { MockProvisionerJob } from "testHelpers/entities";
import { daysAgo } from "utils/time";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import type { GetProvisionerJobsParams } from "api/api";
import { provisionerJobs } from "api/queries/organizations";
import type { ProvisionerJobStatus } from "api/typesGenerated";
import { useOrganizationSettings } from "modules/management/OrganizationSettingsLayout";
import type { FC } from "react";
import { useQuery } from "react-query";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useTheme } from "@emotion/react";
import AutorenewIcon from "@mui/icons-material/Autorenew";
import LoadingButton from "@mui/lab/LoadingButton";
import Badge from "@mui/material/Badge";
import Divider from "@mui/material/Divider";
import Table from "@mui/material/Table";
import TableBody from "@mui/material/TableBody";
Expand All @@ -10,8 +9,6 @@ import TableContainer from "@mui/material/TableContainer";
import TableHead from "@mui/material/TableHead";
import TableRow from "@mui/material/TableRow";
import Tooltip from "@mui/material/Tooltip";
// biome-ignore lint/nursery/noRestrictedImports: styled
import { styled } from "@mui/material/styles";
import visuallyHidden from "@mui/utils/visuallyHidden";
import { externalAuthProvider } from "api/queries/externalAuth";
import type {
Expand Down
1 change: 0 additions & 1 deletion site/src/pages/UserSettingsPage/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import AccountIcon from "@mui/icons-material/Person";
import VpnKeyOutlined from "@mui/icons-material/VpnKeyOutlined";
import type { User } from "api/typesGenerated";
import { Avatar } from "components/Avatar/Avatar";
import { FeatureStageBadge } from "components/FeatureStageBadge/FeatureStageBadge";
import { GitIcon } from "components/Icons/GitIcon";
import {
Sidebar as BaseSidebar,
Expand Down
1 change: 0 additions & 1 deletion site/src/pages/UsersPage/UsersPageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
SettingsHeaderDescription,
SettingsHeaderTitle,
} from "components/SettingsHeader/SettingsHeader";
import { Stack } from "components/Stack/Stack";
import { UserPlusIcon } from "lucide-react";
import type { ComponentProps, FC } from "react";
import { Link as RouterLink } from "react-router-dom";
Expand Down
1 change: 0 additions & 1 deletion site/vite.config.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as path from "node:path";
import react from "@vitejs/plugin-react";
import { buildSync } from "esbuild";
import { visualizer } from "rollup-plugin-visualizer";
import { type PluginOption, defineConfig } from "vite";
import checker from "vite-plugin-checker";
Expand Down