Skip to content

Commit

Permalink
Add linting
Browse files Browse the repository at this point in the history
  • Loading branch information
arctixdev committed Feb 19, 2024
1 parent 3d79f67 commit aa86745
Show file tree
Hide file tree
Showing 112 changed files with 2,724 additions and 2,708 deletions.
2 changes: 2 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[codespell]
ignore-words-list = nd, falsk, vise, tekst, finde, selv, alle, mange
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ node_modules
.vercel
.output
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
vite.config.ts.timestamp-*
16 changes: 2 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,20 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-json
- id: end-of-file-fixer
- id: trailing-whitespace
- id: debug-statements
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
args: []
args: [--write-changes]
files: ^src/

- repo: local
hooks:
- id: lint
name: npm lint
entry: npm lint
language: system
files: ^src/
exclude_types: [csv, json, css, scss]
exclude: ^src/assets/
- repo:
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
files: ^frontend\/[^\/]+
args: [--config, .prettierrc,--write]
additional_dependencies:
- prettier
- prettier-plugin-svelte
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Akademia frontend

The frontend app used by the akademia [tauri app](https://github.com/Akademiaapp/companion) and [website](https://github.com/Akademiaapp/website).

## Developing
Expand Down
2 changes: 1 addition & 1 deletion bunfig.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[install.scopes]
"@tiptap-pro" = { url = "https://registry.tiptap.dev/", token = "l6TK35bBV+kmlfez71jdXCHJqeFqa7NaUA0zf2qmxmkaDEcGhOeMIIOfRdRzlhn9"}
"@tiptap-pro" = { url = "https://registry.tiptap.dev/", token = "l6TK35bBV+kmlfez71jdXCHJqeFqa7NaUA0zf2qmxmkaDEcGhOeMIIOfRdRzlhn9"}
24 changes: 12 additions & 12 deletions components.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"$schema": "https://shadcn-svelte.com/schema.json",
"style": "default",
"tailwind": {
"config": "tailwind.config.js",
"css": "src/app.pcss",
"baseColor": "zinc"
},
"aliases": {
"components": "$lib/components",
"utils": "$lib/utils"
}
}
"$schema": "https://shadcn-svelte.com/schema.json",
"style": "default",
"tailwind": {
"config": "tailwind.config.js",
"css": "src/app.pcss",
"baseColor": "zinc"
},
"aliases": {
"components": "$lib/components",
"utils": "$lib/utils"
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"tailwindcss": "^3.4.1",
"tslib": "^2.6.2",
"typescript": "^5.3.3",
"vite": "^5.1.1"
"vite": "^5.1.1",
"pre-commit": "1.2.2"
},
"type": "module",
"dependencies": {
Expand Down
8 changes: 4 additions & 4 deletions src/lib/components/ui/avatar/avatar-fallback.svelte
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<script lang="ts">
import { Avatar as AvatarPrimitive } from "bits-ui";
import { cn } from "$lib/utils";
import { Avatar as AvatarPrimitive } from 'bits-ui';
import { cn } from '$lib/utils';
type $$Props = AvatarPrimitive.FallbackProps;
let className: $$Props["class"] = undefined;
let className: $$Props['class'] = undefined;
export { className as class };
</script>

<AvatarPrimitive.Fallback
class={cn("flex h-full w-full items-center justify-center rounded-full bg-muted", className)}
class={cn('flex h-full w-full items-center justify-center rounded-full bg-muted', className)}
{...$$restProps}
>
<slot />
Expand Down
12 changes: 6 additions & 6 deletions src/lib/components/ui/avatar/avatar-image.svelte
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<script lang="ts">
import { Avatar as AvatarPrimitive } from "bits-ui";
import { cn } from "$lib/utils";
import { Avatar as AvatarPrimitive } from 'bits-ui';
import { cn } from '$lib/utils';
type $$Props = AvatarPrimitive.ImageProps;
let className: $$Props["class"] = undefined;
export let src: $$Props["src"] = undefined;
export let alt: $$Props["alt"] = undefined;
let className: $$Props['class'] = undefined;
export let src: $$Props['src'] = undefined;
export let alt: $$Props['alt'] = undefined;
export { className as class };
</script>

<AvatarPrimitive.Image
{src}
{alt}
class={cn("aspect-square h-full w-full", className)}
class={cn('aspect-square h-full w-full', className)}
{...$$restProps}
/>
10 changes: 5 additions & 5 deletions src/lib/components/ui/avatar/avatar.svelte
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<script lang="ts">
import { Avatar as AvatarPrimitive } from "bits-ui";
import { cn } from "$lib/utils";
import { Avatar as AvatarPrimitive } from 'bits-ui';
import { cn } from '$lib/utils';
type $$Props = AvatarPrimitive.Props;
let className: $$Props["class"] = undefined;
export let delayMs: $$Props["delayMs"] = undefined;
let className: $$Props['class'] = undefined;
export let delayMs: $$Props['delayMs'] = undefined;
export { className as class };
</script>

<AvatarPrimitive.Root
{delayMs}
class={cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className)}
class={cn('relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full', className)}
{...$$restProps}
>
<slot />
Expand Down
6 changes: 3 additions & 3 deletions src/lib/components/ui/avatar/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Root from "./avatar.svelte";
import Image from "./avatar-image.svelte";
import Fallback from "./avatar-fallback.svelte";
import Root from './avatar.svelte';
import Image from './avatar-image.svelte';
import Fallback from './avatar-fallback.svelte';

export {
Root,
Expand Down
14 changes: 7 additions & 7 deletions src/lib/components/ui/button/button.svelte
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<script lang="ts">
import { Button as ButtonPrimitive } from "bits-ui";
import { cn } from "$lib/utils";
import { buttonVariants, type Props, type Events } from ".";
import { Button as ButtonPrimitive } from 'bits-ui';
import { cn } from '$lib/utils';
import { buttonVariants, type Props, type Events } from '.';
type $$Props = Props;
type $$Events = Events;
let className: $$Props["class"] = undefined;
export let variant: $$Props["variant"] = "default";
export let size: $$Props["size"] = "default";
export let builders: $$Props["builders"] = [];
let className: $$Props['class'] = undefined;
export let variant: $$Props['variant'] = 'default';
export let size: $$Props['size'] = 'default';
export let builders: $$Props['builders'] = [];
export { className as class };
</script>

Expand Down
10 changes: 5 additions & 5 deletions src/lib/components/ui/calendar/calendar-cell.svelte
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<script lang="ts">
import { Calendar as CalendarPrimitive } from "bits-ui";
import { cn } from "$lib/utils";
import { Calendar as CalendarPrimitive } from 'bits-ui';
import { cn } from '$lib/utils';
type $$Props = CalendarPrimitive.CellProps;
export let date: $$Props["date"];
let className: $$Props["class"] = undefined;
export let date: $$Props['date'];
let className: $$Props['class'] = undefined;
export { className as class };
</script>

<CalendarPrimitive.Cell
{date}
class={cn(
"h-9 w-9 text-center text-sm p-0 relative [&:has([data-selected][data-outside-month])]:bg-accent/50 [&:has([data-selected])]:bg-accent first:[&:has([data-selected])]:rounded-l-md last:[&:has([data-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
'relative h-9 w-9 p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([data-selected])]:bg-accent first:[&:has([data-selected])]:rounded-l-md last:[&:has([data-selected])]:rounded-r-md [&:has([data-selected][data-outside-month])]:bg-accent/50',
className
)}
{...$$restProps}
Expand Down
26 changes: 13 additions & 13 deletions src/lib/components/ui/calendar/calendar-day.svelte
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<script lang="ts">
import { Calendar as CalendarPrimitive } from "bits-ui";
import { buttonVariants } from "$lib/components/ui/button";
import { cn } from "$lib/utils";
import { Calendar as CalendarPrimitive } from 'bits-ui';
import { buttonVariants } from '$lib/components/ui/button';
import { cn } from '$lib/utils';
type $$Props = CalendarPrimitive.DayProps;
type $$Events = CalendarPrimitive.DayEvents;
export let date: $$Props["date"];
export let month: $$Props["month"];
let className: $$Props["class"] = undefined;
export let date: $$Props['date'];
export let month: $$Props['month'];
let className: $$Props['class'] = undefined;
export { className as class };
</script>

Expand All @@ -17,17 +17,17 @@
{date}
{month}
class={cn(
buttonVariants({ variant: "ghost" }),
"h-9 w-9 p-0 font-normal ",
"[&[data-today]:not([data-selected])]:bg-accent [&[data-today]:not([data-selected])]:text-accent-foreground",
buttonVariants({ variant: 'ghost' }),
'h-9 w-9 p-0 font-normal ',
'[&[data-today]:not([data-selected])]:bg-accent [&[data-today]:not([data-selected])]:text-accent-foreground',
// Selected
"data-[selected]:bg-primary data-[selected]:text-primary-foreground data-[selected]:hover:bg-primary data-[selected]:hover:text-primary-foreground data-[selected]:focus:bg-primary data-[selected]:focus:text-primary-foreground data-[selected]:opacity-100",
'data-[selected]:bg-primary data-[selected]:text-primary-foreground data-[selected]:opacity-100 data-[selected]:hover:bg-primary data-[selected]:hover:text-primary-foreground data-[selected]:focus:bg-primary data-[selected]:focus:text-primary-foreground',
// Disabled
"data-[disabled]:text-muted-foreground data-[disabled]:opacity-50",
'data-[disabled]:text-muted-foreground data-[disabled]:opacity-50',
// Unavailable
"data-[unavailable]:line-through data-[unavailable]:text-destructive-foreground",
'data-[unavailable]:text-destructive-foreground data-[unavailable]:line-through',
// Outside months
"data-[outside-month]:text-muted-foreground data-[outside-month]:opacity-50 [&[data-outside-month][data-selected]]:bg-accent/50 [&[data-outside-month][data-selected]]:text-muted-foreground [&[data-outside-month][data-selected]]:opacity-30 data-[outside-month]:pointer-events-none",
'data-[outside-month]:pointer-events-none data-[outside-month]:text-muted-foreground data-[outside-month]:opacity-50 [&[data-outside-month][data-selected]]:bg-accent/50 [&[data-outside-month][data-selected]]:text-muted-foreground [&[data-outside-month][data-selected]]:opacity-30',
className
)}
{...$$restProps}
Expand Down
6 changes: 3 additions & 3 deletions src/lib/components/ui/calendar/calendar-grid-body.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script lang="ts">
import { Calendar as CalendarPrimitive } from "bits-ui";
import { cn } from "$lib/utils";
import { Calendar as CalendarPrimitive } from 'bits-ui';
import { cn } from '$lib/utils';
type $$Props = CalendarPrimitive.GridBodyProps;
let className: $$Props["class"] = undefined;
let className: $$Props['class'] = undefined;
export { className as class };
</script>

Expand Down
6 changes: 3 additions & 3 deletions src/lib/components/ui/calendar/calendar-grid-head.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script lang="ts">
import { Calendar as CalendarPrimitive } from "bits-ui";
import { cn } from "$lib/utils";
import { Calendar as CalendarPrimitive } from 'bits-ui';
import { cn } from '$lib/utils';
type $$Props = CalendarPrimitive.GridHeadProps;
let className: $$Props["class"] = undefined;
let className: $$Props['class'] = undefined;
export { className as class };
</script>

Expand Down
8 changes: 4 additions & 4 deletions src/lib/components/ui/calendar/calendar-grid-row.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<script lang="ts">
import { Calendar as CalendarPrimitive } from "bits-ui";
import { cn } from "$lib/utils";
import { Calendar as CalendarPrimitive } from 'bits-ui';
import { cn } from '$lib/utils';
type $$Props = CalendarPrimitive.GridRowProps;
let className: $$Props["class"] = undefined;
let className: $$Props['class'] = undefined;
export { className as class };
</script>

<CalendarPrimitive.GridRow class={cn("flex", className)} {...$$restProps}>
<CalendarPrimitive.GridRow class={cn('flex', className)} {...$$restProps}>
<slot />
</CalendarPrimitive.GridRow>
8 changes: 4 additions & 4 deletions src/lib/components/ui/calendar/calendar-grid.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<script lang="ts">
import { Calendar as CalendarPrimitive } from "bits-ui";
import { cn } from "$lib/utils";
import { Calendar as CalendarPrimitive } from 'bits-ui';
import { cn } from '$lib/utils';
type $$Props = CalendarPrimitive.GridProps;
let className: $$Props["class"] = undefined;
let className: $$Props['class'] = undefined;
export { className as class };
</script>

<CalendarPrimitive.Grid class={cn("w-full border-collapse space-y-1", className)} {...$$restProps}>
<CalendarPrimitive.Grid class={cn('w-full border-collapse space-y-1', className)} {...$$restProps}>
<slot />
</CalendarPrimitive.Grid>
8 changes: 4 additions & 4 deletions src/lib/components/ui/calendar/calendar-head-cell.svelte
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<script lang="ts">
import { Calendar as CalendarPrimitive } from "bits-ui";
import { cn } from "$lib/utils";
import { Calendar as CalendarPrimitive } from 'bits-ui';
import { cn } from '$lib/utils';
type $$Props = CalendarPrimitive.HeadCellProps;
let className: $$Props["class"] = undefined;
let className: $$Props['class'] = undefined;
export { className as class };
</script>

<CalendarPrimitive.HeadCell
class={cn("text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]", className)}
class={cn('w-9 rounded-md text-[0.8rem] font-normal text-muted-foreground', className)}
{...$$restProps}
>
<slot />
Expand Down
8 changes: 4 additions & 4 deletions src/lib/components/ui/calendar/calendar-header.svelte
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<script lang="ts">
import { Calendar as CalendarPrimitive } from "bits-ui";
import { cn } from "$lib/utils";
import { Calendar as CalendarPrimitive } from 'bits-ui';
import { cn } from '$lib/utils';
type $$Props = CalendarPrimitive.HeaderProps;
let className: $$Props["class"] = undefined;
let className: $$Props['class'] = undefined;
export { className as class };
</script>

<CalendarPrimitive.Header
class={cn("flex justify-between pt-1 relative items-center w-full", className)}
class={cn('relative flex w-full items-center justify-between pt-1', className)}
{...$$restProps}
>
<slot />
Expand Down
8 changes: 4 additions & 4 deletions src/lib/components/ui/calendar/calendar-heading.svelte
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<script lang="ts">
import { Calendar as CalendarPrimitive } from "bits-ui";
import { cn } from "$lib/utils";
import { Calendar as CalendarPrimitive } from 'bits-ui';
import { cn } from '$lib/utils';
type $$Props = CalendarPrimitive.HeadingProps;
let className: $$Props["class"] = undefined;
let className: $$Props['class'] = undefined;
export { className as class };
</script>

<CalendarPrimitive.Heading
let:headingValue
class={cn("text-sm font-medium", className)}
class={cn('text-sm font-medium', className)}
{...$$restProps}
>
<slot {headingValue}>
Expand Down
Loading

0 comments on commit aa86745

Please sign in to comment.