Add custom prettierrc
This commit is contained in:
parent
fd2252bdad
commit
99c2ae6e33
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"printWidth": 150,
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"semi": true,
|
||||
"singleQuote": false,
|
||||
"trailingComma": "all",
|
||||
"bracketSpacing": false,
|
||||
"jsxBracketSameLine": false,
|
||||
"arrowParens": "avoid",
|
||||
"requirePragma": false,
|
||||
"insertPragma": false
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
import { loginStore, type LoginStore } from "../stores/login";
|
||||
import {loginStore, type LoginStore} from "../stores/login";
|
||||
|
||||
export function URL() {
|
||||
return import.meta.env.VITE_API_URL;
|
||||
|
@ -20,7 +20,7 @@ export async function sendSessionRequest(path: string, opt: RequestInit) {
|
|||
// Create jwt refresh request
|
||||
let refHead = new Headers();
|
||||
setLoginHeaders(headers, true);
|
||||
let y = await sendApiRequest("/v1/marigold/auth/refresh", { method: "POST", headers: refHead });
|
||||
let y = await sendApiRequest("/v1/marigold/auth/refresh", {method: "POST", headers: refHead});
|
||||
|
||||
// Success
|
||||
if (y.status === 200) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { sendSessionRequest } from "./api";
|
||||
import {sendSessionRequest} from "./api";
|
||||
|
||||
export async function postLogin(data: object, token?: string) {
|
||||
let headers = new Headers();
|
||||
|
@ -6,12 +6,12 @@ export async function postLogin(data: object, token?: string) {
|
|||
headers.set("Content-Type", "application/json");
|
||||
if (token !== undefined) headers.set("Authorization", "Bearer " + token);
|
||||
|
||||
let z = await sendSessionRequest("/v1/marigold/auth/login", { method: "POST", headers, body: JSON.stringify(data) });
|
||||
let z = await sendSessionRequest("/v1/marigold/auth/login", {method: "POST", headers, body: JSON.stringify(data)});
|
||||
return await z.json();
|
||||
}
|
||||
|
||||
export async function getUser(id: string | number) {
|
||||
let z = await sendSessionRequest("/v1/marigold/user/" + id, { method: "GET" });
|
||||
let z = await sendSessionRequest("/v1/marigold/user/" + id, {method: "GET"});
|
||||
if (z.status != 200) throw new Error("Request failed");
|
||||
return await z.json();
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import { sendApiRequest, sendSessionRequest } from "./api";
|
||||
import {sendApiRequest, sendSessionRequest} from "./api";
|
||||
|
||||
export async function getOAuthApp(id: string) {
|
||||
let z = await sendSessionRequest("/v1/marigold/app/" + id, { method: "GET" });
|
||||
let z = await sendSessionRequest("/v1/marigold/app/" + id, {method: "GET"});
|
||||
if (z.status != 200) throw new Error("Request failed");
|
||||
return await z.json();
|
||||
}
|
||||
|
||||
export async function getOAuthScopes() {
|
||||
let z = await sendApiRequest("/v1/marigold/scopes", { method: "GET" });
|
||||
let z = await sendApiRequest("/v1/marigold/scopes", {method: "GET"});
|
||||
if (z.status != 200) throw new Error("Request failed");
|
||||
return await z.json();
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
/* fallback */
|
||||
@font-face {
|
||||
font-family: 'Material Symbols Outlined';
|
||||
font-family: "Material Symbols Outlined";
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url(~/assets/material-symbols.woff2) format('woff2');
|
||||
src: url(~/assets/material-symbols.woff2) format("woff2");
|
||||
}
|
||||
|
||||
@mixin mso {
|
||||
font-family: 'Material Symbols Outlined';
|
||||
font-family: "Material Symbols Outlined";
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-size: 24px;
|
||||
|
@ -18,6 +18,6 @@
|
|||
white-space: nowrap;
|
||||
word-wrap: normal;
|
||||
direction: ltr;
|
||||
-moz-font-feature-settings: 'liga';
|
||||
-moz-font-feature-settings: "liga";
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
10
src/main.ts
10
src/main.ts
|
@ -1,8 +1,8 @@
|
|||
import './app.scss'
|
||||
import App from './App.svelte'
|
||||
import "./app.scss";
|
||||
import App from "./App.svelte";
|
||||
|
||||
const app = new App({
|
||||
target: document.getElementById('app')
|
||||
})
|
||||
target: document.getElementById("app"),
|
||||
});
|
||||
|
||||
export default app
|
||||
export default app;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { writable } from "svelte/store";
|
||||
import {writable} from "svelte/store";
|
||||
|
||||
export interface LoginStore {
|
||||
access: string;
|
||||
|
@ -12,7 +12,7 @@ export const loginStore = writable<LoginStore>(
|
|||
} catch (_) {
|
||||
return null;
|
||||
}
|
||||
})()
|
||||
})(),
|
||||
);
|
||||
|
||||
loginStore.subscribe((value) => localStorage.setItem("login-session", JSON.stringify(value)));
|
||||
loginStore.subscribe(value => localStorage.setItem("login-session", JSON.stringify(value)));
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import sveltePreprocess from 'svelte-preprocess'
|
||||
import sveltePreprocess from "svelte-preprocess";
|
||||
|
||||
export default {
|
||||
// Consult https://github.com/sveltejs/svelte-preprocess
|
||||
// for more information about preprocessors
|
||||
preprocess: sveltePreprocess()
|
||||
}
|
||||
preprocess: sveltePreprocess(),
|
||||
};
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"module": "ESNext",
|
||||
"resolveJsonModule": true,
|
||||
"baseUrl": "./src",
|
||||
"paths": { "~/*": ["./*"] },
|
||||
"paths": {"~/*": ["./*"]},
|
||||
/**
|
||||
* Typecheck JS in `.svelte` and `.js` files by default.
|
||||
* Disable checkJs if you'd like to use dynamic types in JS.
|
||||
|
@ -18,5 +18,5 @@
|
|||
"isolatedModules": true
|
||||
},
|
||||
"include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.js", "src/**/*.svelte", "src/**/*.mjs"],
|
||||
"references": [{ "path": "./tsconfig.node.json" }]
|
||||
"references": [{"path": "./tsconfig.node.json"}]
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { defineConfig } from "vite";
|
||||
import { svelte } from "@sveltejs/vite-plugin-svelte";
|
||||
import {defineConfig} from "vite";
|
||||
import {svelte} from "@sveltejs/vite-plugin-svelte";
|
||||
import sveltePreprocess from "svelte-preprocess";
|
||||
import { resolve as pathResolve } from "path";
|
||||
import {resolve as pathResolve} from "path";
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
|
@ -16,7 +16,7 @@ export default defineConfig({
|
|||
}),
|
||||
}),
|
||||
],
|
||||
optimizeDeps: { exclude: ["svelte-navigator"] },
|
||||
optimizeDeps: {exclude: ["svelte-navigator"]},
|
||||
resolve: {
|
||||
alias: {
|
||||
"~": pathResolve(__dirname, "src"),
|
||||
|
|
Reference in New Issue