Skip to content

Commit

Permalink
Add linting jobs for website (#906)
Browse files Browse the repository at this point in the history
  • Loading branch information
SapiensAnatis authored Jun 29, 2024
1 parent 0ab3f1d commit 0b1c763
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 35 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/website.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,39 @@ jobs:
name: snapshots
path: Website/tests/__screenshots__/
retention-days: 3

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: "Website"

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Setup node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
cache-dependency-path: "Website/pnpm-lock.yaml"

- name: Install dependencies
working-directory: Website/
run: pnpm install

- name: Prettier
working-directory: Website/
run: pnpm run lint:prettier

- name: ESLint
working-directory: Website/
run: pnpm run lint:eslint

- name: svelte-check
working-directory: Website/
run: pnpm run check
7 changes: 6 additions & 1 deletion Website/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@
pnpm-lock.yaml
package-lock.json
yarn.lock

# SvelteKit artefacts
.svelte-

# Third party code
src/lib/shadcn/**/*
.svelte-
static/mockServiceWorker.js
9 changes: 5 additions & 4 deletions Website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check . && eslint .",
"lint:prettier": "prettier --check .",
"lint:eslint": "eslint .",
"format": "prettier --write .",
"shadcn": "pnpm dlx shadcn-svelte@latest add"
},
Expand All @@ -32,6 +34,7 @@
"eslint-config-prettier": "9.1.0",
"eslint-plugin-simple-import-sort": "12.1.0",
"eslint-plugin-svelte": "2.41.0",
"globals": "15.6.0",
"msw": "2.3.1",
"postcss": "8.4.38",
"postcss-load-config": "5.1.0",
Expand All @@ -44,21 +47,19 @@
"tslib": "2.6.3",
"typescript": "5.5.2",
"typescript-eslint": "8.0.0-alpha.14",
"vite": "5.3.1"
"vite": "5.3.1",
"vite-plugin-checker": "0.6.4"
},
"type": "module",
"dependencies": {
"@unpic/svelte": "0.0.53",
"bits-ui": "0.21.10",
"buffer": "6.0.3",
"clsx": "2.1.1",
"globals": "15.6.0",
"lucide-svelte": "0.397.0",
"mode-watcher": "0.3.1",
"tailwind-merge": "2.3.0",
"tailwind-variants": "0.2.1",
"vaul-svelte": "0.3.1",
"vite-plugin-checker": "0.6.4",
"zod": "3.23.8"
},
"pnpm": {
Expand Down
33 changes: 6 additions & 27 deletions Website/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Website/src/lib/components/loadingSpinner.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { cn } from '$shadcn/utils.js';
export let size: number = 24;
let className: string = undefined;
let className: string | undefined = undefined;
export { className as class };
</script>
Expand Down
5 changes: 5 additions & 0 deletions Website/src/routes/(main)/navigation/+page.server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type { PageServerLoad } from './$types';

export const load: PageServerLoad = ({ locals }) => ({
hasValidJwt: locals.hasValidJwt
});
6 changes: 5 additions & 1 deletion Website/src/routes/(main)/navigation/[email protected]
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<script lang="ts">
import Routes from '$main/routes.svelte';
import type { PageData } from './$types';
export let data: PageData;
</script>

<nav class="flex flex-col justify-center gap-1 p-3">
<h1 class="mb-4 text-3xl font-bold">Navigation</h1>
<Routes />
<Routes hasValidJwt={data.hasValidJwt} />
</nav>
2 changes: 1 addition & 1 deletion Website/svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const config = {
$static: './static',
$main: './src/routes/(main)'
}
},
}
};

export default config;

0 comments on commit 0b1c763

Please sign in to comment.