style: Update .prettierrc

This commit is contained in:
April Hall 2025-01-04 16:25:58 -05:00
parent bc1094d70c
commit 158f9e097d
Signed by: arithefirst
GPG Key ID: 4508A15C4DB91C5B
19 changed files with 223 additions and 221 deletions

View File

@ -1,9 +1,12 @@
{
"useTabs": true,
"tabWidth": 2,
"printWidth": 150,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"trailingComma": "all",
"bracketSameLine": true,
"plugins": ["prettier-plugin-svelte"],
"overrides": [
{
"files": "*.svelte",

View File

@ -1,5 +1,7 @@
# SVChat
A is a simple chat app built with SvelteKit, Drizzle ORM, and PostgreSQL
## Techstack
![Techstack](https://go-skill-icons.vercel.app/api/icons?i=daisyui,postgresql,svelte,tailwindcss,ts)

View File

@ -5,10 +5,10 @@ export default defineConfig({
schema: './src/lib/server/db/schema.ts',
dbCredentials: {
url: process.env.DATABASE_URL
url: process.env.DATABASE_URL,
},
verbose: true,
strict: true,
dialect: 'postgresql'
dialect: 'postgresql',
});

View File

@ -18,17 +18,17 @@ export default ts.config(
languageOptions: {
globals: {
...globals.browser,
...globals.node
}
}
...globals.node,
},
},
},
{
files: ['**/*.svelte'],
languageOptions: {
parserOptions: {
parser: ts.parser
}
}
}
parser: ts.parser,
},
},
},
);

View File

@ -1,6 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
autoprefixer: {},
},
};

View File

@ -12,7 +12,7 @@ io.on('connection', (socket) => {
io!.emit('message', `Hello from SvelteKit ${new Date().toLocaleString()} (${socket.id})`);
socket.on('disconnect', () => {
io!.emit('message', `client disconnected (${socket.id})`)
io!.emit('message', `client disconnected (${socket.id})`);
console.log(`[ws:kit] client disconnected (${socket.id})`);
});
});

View File

@ -10,6 +10,6 @@ export const handle = (async ({ event, resolve }) => {
event.locals.io = io;
}
return resolve(event, {
filterSerializedResponseHeaders: (name) => name === 'content-type'
filterSerializedResponseHeaders: (name) => name === 'content-type',
});
}) satisfies Handle;

View File

@ -5,5 +5,5 @@ export const users = pgTable('users', {
username: text('username'),
displayname: text('display_name'),
salt: text('salt'),
hash: text('hash')
hash: text('hash'),
});

View File

@ -10,7 +10,7 @@ export const GlobalThisWSS = Symbol.for('sveltekit.wss');
export interface ExtendedWebSocket extends WebSocketBase {
socketId: string;
// userId: string;
};
}
// You can define server-wide functions or class instances here
// export interface ExtendedServer extends Server<ExtendedWebSocket> {};

View File

@ -3,7 +3,6 @@ import type { HttpServer } from 'vite';
let io: SocketIOServer | undefined;
export function startupSocketIOServer(httpServer: HttpServer | null) {
if (io) return;
console.log('[ws:kit] setup');
@ -13,7 +12,7 @@ export function startupSocketIOServer(httpServer: HttpServer | null) {
io!.emit('message', `Hello from SvelteKit ${new Date().toLocaleString()} (${socket.id})`);
socket.on('disconnect', () => {
io!.emit('message', `client disconnected (${socket.id})`)
io!.emit('message', `client disconnected (${socket.id})`);
console.log(`[ws:kit] client disconnected (${socket.id})`);
});
});

View File

@ -32,9 +32,7 @@
<main>
<h1 class="text-lg"># SvelteKit with Socket.IO Integration</h1>
<button class="btn btn-primary" on:click={() => establishSocketIOConnection()}>
Establish Socket.IO connection
</button>
<button class="btn btn-primary" on:click={() => establishSocketIOConnection()}> Establish Socket.IO connection </button>
<ul>
{#each log as event}

View File

@ -11,8 +11,8 @@ const config = {
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
adapter: adapter()
}
adapter: adapter(),
},
};
export default config;

View File

@ -3,5 +3,5 @@ import daisyui from 'daisyui';
export default {
content: ['./src/**/*.{html,js,svelte,ts}'],
plugins: [daisyui]
plugins: [daisyui],
} satisfies Config;

View File

@ -12,7 +12,7 @@ export default defineConfig({
},
configurePreviewServer(server) {
startupSocketIOServer(server.httpServer);
}
},
]
},
],
});