style: fixed indent -> everything into 2 spaces

This commit is contained in:
axel 2025-04-17 03:26:15 +02:00
parent d2e064d40f
commit 2981887224
49 changed files with 1255 additions and 1253 deletions

View File

@ -1,5 +1,5 @@
{ {
"useTabs": true, "useTabs": false,
"singleQuote": true, "singleQuote": true,
"trailingComma": "all", "trailingComma": "all",
"printWidth": 100, "printWidth": 100,

View File

@ -2,5 +2,5 @@
@import 'tailwindcss'; @import 'tailwindcss';
* { * {
font-family: "Inter", sans-serif; font-family: 'Inter', sans-serif;
} }

2
src/app.d.ts vendored
View File

@ -1,6 +1,6 @@
// See https://svelte.dev/docs/kit/types#app.d.ts // See https://svelte.dev/docs/kit/types#app.d.ts
import type { Guard } from "$lib/server/guard"; import type { Guard } from '$lib/server/guard';
import 'unplugin-icons/types/svelte'; import 'unplugin-icons/types/svelte';
// for information about these interfaces // for information about these interfaces

View File

@ -2,9 +2,9 @@ import { JSONFilePreset } from 'lowdb/node';
import type { Device } from '../../types/device'; import type { Device } from '../../types/device';
import type { Group } from '../../types/group'; import type { Group } from '../../types/group';
import type { User } from '../../types/user'; import type { User } from '../../types/user';
import { LowUserRepo } from './userRepo';
import { LowGroupRepo } from './groupRepo';
import { LowDeviceRepo } from './deviceRepo'; import { LowDeviceRepo } from './deviceRepo';
import { LowGroupRepo } from './groupRepo';
import { LowUserRepo } from './userRepo';
const db = await JSONFilePreset<LowStorage.LowData>('./data/db.json', { const db = await JSONFilePreset<LowStorage.LowData>('./data/db.json', {
users: [], users: [],

View File

@ -1,8 +1,8 @@
import type { IDeviceRepo } from '../deviceRepo';
import type { Low } from 'lowdb'; import type { Low } from 'lowdb';
import { nanoid } from 'nanoid';
import { type New, type Updated } from '../../types'; import { type New, type Updated } from '../../types';
import { type Device, type DeviceError, DeviceErrors } from '../../types/device'; import { type Device, type DeviceError, DeviceErrors } from '../../types/device';
import { nanoid } from 'nanoid'; import type { IDeviceRepo } from '../deviceRepo';
import type { LowStorage } from './_init'; import type { LowStorage } from './_init';
export class LowDeviceRepo implements IDeviceRepo { export class LowDeviceRepo implements IDeviceRepo {

View File

@ -1,8 +1,8 @@
import type { IGroupRepo } from '../groupRepo';
import type { Low } from 'lowdb'; import type { Low } from 'lowdb';
import { nanoid } from 'nanoid';
import { type New, type Updated } from '../../types'; import { type New, type Updated } from '../../types';
import { type Group, type GroupError, GroupErrors } from '../../types/group'; import { type Group, type GroupError, GroupErrors } from '../../types/group';
import { nanoid } from 'nanoid'; import type { IGroupRepo } from '../groupRepo';
import type { LowStorage } from './_init'; import type { LowStorage } from './_init';
export class LowGroupRepo implements IGroupRepo { export class LowGroupRepo implements IGroupRepo {

View File

@ -1,8 +1,8 @@
import type { Low } from 'lowdb'; import type { Low } from 'lowdb';
import { nanoid } from 'nanoid';
import { type New, type Updated } from '../../types'; import { type New, type Updated } from '../../types';
import { UserErrors, type User } from '../../types/user'; import { UserErrors, type User } from '../../types/user';
import type { IUserRepo } from '../userRepo'; import type { IUserRepo } from '../userRepo';
import { nanoid } from 'nanoid';
import type { LowStorage } from './_init'; import type { LowStorage } from './_init';
export class LowUserRepo implements IUserRepo { export class LowUserRepo implements IUserRepo {

View File

@ -22,7 +22,9 @@
duration-300 ease-in-out cursor-pointer" duration-300 ease-in-out cursor-pointer"
> >
<IconCheck <IconCheck
class="transition-all duration-300 ease-in-out {checked ? 'opacity-100' : 'opacity-0'} test" class="transition-all duration-300 ease-in-out {checked
? 'opacity-100'
: 'opacity-0'} test"
/> />
</div> </div>
{/snippet} {/snippet}

View File

@ -1,17 +1,17 @@
<script lang="ts"> <script lang="ts">
import { page } from '$app/state'; import { page } from '$app/state';
import { pageTitle } from '$lib/v2/globalStores.js'; import { pageTitle } from '$lib/v2/globalStores.js';
import { slideFade } from '$lib/v2/transitions/slideFade.js';
import NavBar from '$lib/v2/ui/NavBar.svelte'; import NavBar from '$lib/v2/ui/NavBar.svelte';
import NavBarLink from '$lib/v2/ui/NavBarLink.svelte'; import NavBarLink from '$lib/v2/ui/NavBarLink.svelte';
import { Button, DropdownMenu } from 'bits-ui'; import { Button, DropdownMenu } from 'bits-ui';
import IconChevronDown from '~icons/tabler/chevron-down'; import IconChevronDown from '~icons/tabler/chevron-down';
import IconChevronRight from '~icons/tabler/chevron-right'; import IconChevronRight from '~icons/tabler/chevron-right';
import IconDeviceDesktopPin from '~icons/tabler/device-desktop-pin';
import IconHome from '~icons/tabler/home'; import IconHome from '~icons/tabler/home';
import IconLogout from '~icons/tabler/logout';
import IconUsers from '~icons/tabler/users'; import IconUsers from '~icons/tabler/users';
import IconUsersGroup from '~icons/tabler/users-group'; import IconUsersGroup from '~icons/tabler/users-group';
import IconDeviceDesktopPin from '~icons/tabler/device-desktop-pin';
import IconLogout from '~icons/tabler/logout';
import { slideFade } from '$lib/v2/transitions/slideFade.js';
let { data, children } = $props(); let { data, children } = $props();

View File

@ -1,5 +1,5 @@
import { users } from '$lib/server/db'; import { users } from '$lib/server/db';
import { toPublicUser, type User } from '$lib/server/db/types/user'; import { toPublicUser } from '$lib/server/db/types/user';
import type { ServerLoad } from '@sveltejs/kit'; import type { ServerLoad } from '@sveltejs/kit';
export const load: ServerLoad = async ({ locals: { guard } }) => { export const load: ServerLoad = async ({ locals: { guard } }) => {

View File

@ -1,9 +1,9 @@
import { dev } from '$app/environment';
import { users } from '$lib/server/db'; import { users } from '$lib/server/db';
import { createSession } from '$lib/server/sessions'; import { createSession } from '$lib/server/sessions';
import { fail, redirect } from '@sveltejs/kit'; import { fail, redirect } from '@sveltejs/kit';
import bcrypt from 'bcryptjs'; import bcrypt from 'bcryptjs';
import type { Actions } from './$types'; import type { Actions } from './$types';
import { dev } from '$app/environment';
export const actions = { export const actions = {
default: async ({ cookies, request, locals: { guard } }) => { default: async ({ cookies, request, locals: { guard } }) => {

View File

@ -7,11 +7,11 @@
<form method="POST"> <form method="POST">
<label> <label>
Username Username
<input name="username" type="text"> <input name="username" type="text" />
</label> </label>
<label> <label>
Password Password
<input name="password" type="password"> <input name="password" type="password" />
</label> </label>
<button>Log in</button> <button>Log in</button>
</form> </form>

View File

@ -1,8 +1,8 @@
import { deleteSession } from "$lib/server/sessions"; import { deleteSession } from '$lib/server/sessions';
import { redirect, type ServerLoad } from "@sveltejs/kit"; import { redirect, type ServerLoad } from '@sveltejs/kit';
export const load: ServerLoad = async ({ cookies }) => { export const load: ServerLoad = async ({ cookies }) => {
deleteSession(cookies.get("session")); deleteSession(cookies.get('session'));
cookies.delete("session", { path: "/" }); cookies.delete('session', { path: '/' });
redirect(302, "/login"); redirect(302, '/login');
}; };