Skip to content
Merged
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
26 changes: 26 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,31 @@ jobs:
run: npm test


frontend-knip:
name: Check the frontend for unused dependencies
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- name: Checkout the code
uses: actions/[email protected]

- name: Install Node
uses: actions/[email protected]
with:
node-version: 20

- name: Install Node dependencies
working-directory: ./frontend
run: npm ci

- name: Check for unused dependencies
working-directory: ./frontend
run: npm run knip


rustfmt:
name: Check Rust style
runs-on: ubuntu-latest
Expand Down Expand Up @@ -362,6 +387,7 @@ jobs:
- opa-lint
- frontend-lint
- frontend-test
- frontend-knip
- rustfmt
- cargo-deny
- clippy
Expand Down
6 changes: 2 additions & 4 deletions frontend/i18next-parser.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import type { UserConfig } from "i18next-parser";

const config: UserConfig = {
export default {
keySeparator: ".",
pluralSeparator: ":",
defaultNamespace: "frontend",
Expand All @@ -30,6 +30,4 @@ const config: UserConfig = {
output: "locales/$LOCALE.json",
input: ["src/**/*.{ts,tsx}"],
sort: true,
};

export default config;
} satisfies UserConfig;
22 changes: 22 additions & 0 deletions frontend/knip.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright 2024 New Vector Ltd.
//
// SPDX-License-Identifier: AGPL-3.0-only
// Please see LICENSE in the repository root for full details.

import type { KnipConfig } from "knip";

export default {
entry: [
"src/main.tsx",
"src/swagger.tsx",
"src/routes/*",
"i18next-parser.config.ts",
],
ignore: ["src/gql/*", "src/routeTree.gen.ts", ".storybook/locales.ts"],
ignoreDependencies: [
// This is used by the tailwind PostCSS plugin, but not detected by knip
"postcss-nesting",
// We're using @storybook/addon-essentials to simplify upgrades, but knip doesn't detect them
"@storybook/addon-*",
],
} satisfies KnipConfig;
1 change: 0 additions & 1 deletion frontend/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@
"settings": "Settings"
},
"not_found_alert_title": "Not found.",
"not_logged_in_alert": "You're not logged in.",
"oauth2_client_detail": {
"details_title": "Client info",
"name": "Name",
Expand Down
Loading
Loading