Skip to content

Commit

Permalink
🎨 format everything with biome
Browse files Browse the repository at this point in the history
  • Loading branch information
thrzl committed Apr 28, 2024
1 parent 5376672 commit a2e5d0b
Show file tree
Hide file tree
Showing 24 changed files with 152 additions and 126 deletions.
14 changes: 7 additions & 7 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
module.exports = {
root: true,
extends: ['eslint:recommended', 'prettier'],
plugins: ['svelte3'],
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
extends: ["eslint:recommended", "prettier"],
plugins: ["svelte3"],
overrides: [{ files: ["*.svelte"], processor: "svelte3/svelte3" }],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020
sourceType: "module",
ecmaVersion: 2020,
},
env: {
browser: true,
es2017: true,
node: true
}
node: true,
},
};
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
"files": {
"ignore": ["node_modules/*", ".netlify/*", ".svelte-kit/", "build/"]
}
}
}
66 changes: 33 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
{
"name": "illusion",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
"lint": "prettier --plugin-search-dir . --check . && eslint .",
"format": "prettier --plugin-search-dir . --write ."
},
"devDependencies": {
"@biomejs/biome": "1.7.1",
"@sveltejs/adapter-auto": "^3.2.0",
"@sveltejs/kit": "^2.5.7",
"@unocss/preset-uno": "^0.59.4",
"eslint": "^9.1.1",
"eslint-config-biome": "^1.5.3",
"eslint-plugin-svelte3": "^4.0.0",
"svelte": "^4.2.1",
"svelte-check": "^3.5.2",
"svelte-preprocess": "^5.0.4",
"typescript": "^5.2.2",
"unocss": "^0.59.4",
"vite": "^5.2.10"
},
"type": "module",
"dependencies": {
"@selemondev/svelte-marquee": "^0.0.2",
"@sveltejs/adapter-netlify": "^4.2.0",
"rescript": "^11.1.0"
}
"name": "illusion",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
"lint": "prettier --plugin-search-dir . --check . && eslint .",
"format": "prettier --plugin-search-dir . --write ."
},
"devDependencies": {
"@biomejs/biome": "1.7.1",
"@sveltejs/adapter-auto": "^3.2.0",
"@sveltejs/kit": "^2.5.7",
"@unocss/preset-uno": "^0.59.4",
"eslint": "^9.1.1",
"eslint-config-biome": "^1.5.3",
"eslint-plugin-svelte3": "^4.0.0",
"svelte": "^4.2.1",
"svelte-check": "^3.5.2",
"svelte-preprocess": "^5.0.4",
"typescript": "^5.2.2",
"unocss": "^0.59.4",
"vite": "^5.2.10"
},
"type": "module",
"dependencies": {
"@selemondev/svelte-marquee": "^0.0.2",
"@sveltejs/adapter-netlify": "^4.2.0",
"rescript": "^11.1.0"
}
}
2 changes: 1 addition & 1 deletion src/app.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ declare global {
}
}

export {};
export type {};
6 changes: 3 additions & 3 deletions src/components/Background.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script>
export let text = "TEAMILLUSION";
export let first = false;
let _text = text.repeat(500)
export const text = "TEAMILLUSION";
export const first = false;
const _text = text.repeat(500);
</script>


Expand Down
6 changes: 3 additions & 3 deletions src/components/Link.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
export let href: string;
export let away: boolean = false;
export let back: boolean = false;
export let href: string;
export const away: boolean = false;
export const back: boolean = false;
</script>

{#if back}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Marquee.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Marquee.svelte -->
<script>
export let direction = 'left';
export const direction = "left";
</script>

<marquee direction={direction}>
Expand Down
4 changes: 2 additions & 2 deletions src/components/MarqueeContainer.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- MarqueeContainer.svelte -->
<script>
import Marquee from './Marquee.svelte';
import Marquee from "./Marquee.svelte";
const marqueeDirections = ['left', 'right'];
const marqueeDirections = ["left", "right"];
</script>

<div class="marquee-container">
Expand Down
6 changes: 3 additions & 3 deletions src/components/Rise.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
export let text: string;
export let _class: string = "";
export let text_class: string = "";
export let text: string;
export const _class: string = "";
export const text_class: string = "";
</script>

<div class={`rise-wrapper whitespace-pre w-fit ${_class}`}>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/+layout.server.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const prerender = true;
export const prerender = true;
4 changes: 2 additions & 2 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
import "../app.css";
import "virtual:uno.css"
import "virtual:uno.css";
import "../app.css";
</script>
<a href="/">
<div class="fixed top-5 right-5 md:top-15 md:right-15 z-999">
Expand Down
10 changes: 5 additions & 5 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script>
import Background from '../components/Background.svelte';
import { Marquee } from '@selemondev/svelte-marquee';
import '@selemondev/svelte-marquee/dist/style.css';
import links from "../data/links.json";
import sponsors from "../data/sponsors.json"
import { Marquee } from "@selemondev/svelte-marquee";
import "@selemondev/svelte-marquee/dist/style.css";
import Background from "../components/Background.svelte";
import links from "../data/links.json";
import sponsors from "../data/sponsors.json";
</script>

<Background text="TEAMILLUSION"/>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/+page.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
const prerender = true;
const prerender = true;
4 changes: 2 additions & 2 deletions src/routes/about/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
const date = 'April 2, 2023'
const title = "About Us"
const date = "April 2, 2023";
const title = "About Us";
</script>

<div class="min-h-screen max-w-screen px-0 m-0 overflow-x-clip overscroll-x-none" style="font-family: Inter">
Expand Down
10 changes: 6 additions & 4 deletions src/routes/api/finances/organization/+server.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { json } from "@sveltejs/kit"
import { json } from "@sveltejs/kit";

/** @type {import('./$types').RequestHandler} */
export async function GET({ url }) {
const res = await fetch("https://bank.hackclub.com/api/v3/organizations/org_rPurE1.json")
const data = await res.json()
const res = await fetch(
"https://bank.hackclub.com/api/v3/organizations/org_rPurE1.json",
);
const data = await res.json();

return json(data);
return json(data);
}
10 changes: 6 additions & 4 deletions src/routes/api/finances/transactions/+server.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { json } from "@sveltejs/kit"
import { json } from "@sveltejs/kit";

/** @type {import('./$types').RequestHandler} */
export async function GET({ url }) {
const res = await fetch("https://bank.hackclub.com/api/v3/organizations/teamillusion/transactions")
const data = await res.json()
const res = await fetch(
"https://bank.hackclub.com/api/v3/organizations/teamillusion/transactions",
);
const data = await res.json();

return json(data);
return json(data);
}
2 changes: 1 addition & 1 deletion src/routes/contact/+page.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const prerender = true;
export const prerender = true;
30 changes: 15 additions & 15 deletions src/routes/contact/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
title="Team Illusion Contact Form
"
></iframe><script>
var d = document,
w = 'https://tally.so/widgets/embed.js',
v = function () {
'undefined' != typeof Tally
? Tally.loadEmbeds()
: d.querySelectorAll('iframe[data-tally-src]:not([src])').forEach(function (e) {
e.src = e.dataset.tallySrc;
});
};
if ('undefined' != typeof Tally) v();
else if (d.querySelector('script[src="' + w + '"]') == null) {
var s = d.createElement('script');
(s.src = w), (s.onload = v), (s.onerror = v), d.body.appendChild(s);
}
</script>
var d = document,
w = "https://tally.so/widgets/embed.js",
v = () => {
"undefined" != typeof Tally
? Tally.loadEmbeds()
: d.querySelectorAll("iframe[data-tally-src]:not([src])").forEach((e) => {
e.src = e.dataset.tallySrc;
});
};
if ("undefined" != typeof Tally) v();
else if (d.querySelector('script[src="' + w + '"]') == null) {
var s = d.createElement("script");
(s.src = w), (s.onload = v), (s.onerror = v), d.body.appendChild(s);
}
</script>
</div>
</header>
</div>
26 changes: 13 additions & 13 deletions src/routes/finances/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<script lang="ts">
async function loadTransactions() {
const transactionRes = await fetch("/api/finances/transactions");
const transaction = await transactionRes.json();
async function loadTransactions() {
const transactionRes = await fetch("/api/finances/transactions");
const transaction = await transactionRes.json();
return { transaction };
}
let data = loadTransactions();
function formatDate(date: Date) {
return date.toLocaleDateString('en', {
month: 'short',
day: 'numeric',
year: 'numeric'
});
}
return { transaction };
}
const data = loadTransactions();
function formatDate(date: Date) {
return date.toLocaleDateString("en", {
month: "short",
day: "numeric",
year: "numeric",
});
}
</script>

{#await data}
Expand Down
2 changes: 1 addition & 1 deletion src/routes/finances/+page.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const prerender = true;
export const prerender = true;
20 changes: 19 additions & 1 deletion static/site.webmanifest
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
{
"name": "",
"short_name": "",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
6 changes: 3 additions & 3 deletions svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import adapter from '@sveltejs/adapter-netlify';
import preprocess from 'svelte-preprocess';
import adapter from "@sveltejs/adapter-netlify";
import preprocess from "svelte-preprocess";

/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: [preprocess()],
kit: {
adapter: adapter({
precompress: true,
})
}),
},
extensions: [".svelte"],
};
Expand Down
36 changes: 20 additions & 16 deletions uno.config.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
// uno.config.ts
import { defineConfig, presetUno } from 'unocss'
import { defineConfig, presetUno } from "unocss";

export default defineConfig(
{
presets: [presetUno()],
rules: [
// cursor
[/^cursor-emoji-(\w+)$/, ([, w]) => ({ cursor: `url('/emojis/${w}.webp') 64 64, auto` })],
[/^spacing-(\d)$/, ([, d]) => ({ 'letter-spacing': `${d}px` })],
['font-spacemono', { 'font-family': 'Space Mono' }]
],
shortcuts: {
'button': 'no-underline text-current text-center hover:scale-105 duration-250 ease-out rounded-full bg-[#6000FF] text-white b-none py-2 px-5 md:px-10 mt-5 text-xl font-bold -spacing-1 flex items-center justify-center',
'section-wrapper': 'h-screen w-screen font-[Inter]',
'section': 'mx-auto flex flex-col items-center justify-center text-white lg:max-w-screen-xl w-screen h-screen m-auto overflow-x-clip',
}
})
export default defineConfig({
presets: [presetUno()],
rules: [
// cursor
[
/^cursor-emoji-(\w+)$/,
([, w]) => ({ cursor: `url('/emojis/${w}.webp') 64 64, auto` }),
],
[/^spacing-(\d)$/, ([, d]) => ({ "letter-spacing": `${d}px` })],
["font-spacemono", { "font-family": "Space Mono" }],
],
shortcuts: {
button:
"no-underline text-current text-center hover:scale-105 duration-250 ease-out rounded-full bg-[#6000FF] text-white b-none py-2 px-5 md:px-10 mt-5 text-xl font-bold -spacing-1 flex items-center justify-center",
"section-wrapper": "h-screen w-screen font-[Inter]",
section:
"mx-auto flex flex-col items-center justify-center text-white lg:max-w-screen-xl w-screen h-screen m-auto overflow-x-clip",
},
});
6 changes: 3 additions & 3 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
import { sveltekit } from "@sveltejs/kit/vite";
import UnoCSS from "unocss/vite";
import { defineConfig } from "vite";

export default defineConfig({
plugins: [sveltekit(), UnoCSS()]
plugins: [sveltekit(), UnoCSS()],
});

0 comments on commit a2e5d0b

Please sign in to comment.