From e6f345bd3bc9a90bfce398d6cddf0c09a0a47efd Mon Sep 17 00:00:00 2001 From: static Date: Wed, 25 Dec 2024 22:27:43 +0900 Subject: [PATCH] =?UTF-8?q?Prettier=20=EA=B7=9C=EC=B9=99=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .prettierrc | 23 +++++----- drizzle.config.ts | 18 ++++---- eslint.config.js | 60 +++++++++++++------------- package.json | 84 ++++++++++++++++++------------------- postcss.config.js | 8 ++-- src/app.css | 6 +-- src/app.d.ts | 14 +++---- src/app.html | 18 ++++---- src/lib/server/db/index.ts | 8 ++-- src/lib/server/db/schema.ts | 8 ++-- src/routes/+layout.svelte | 4 +- svelte.config.js | 22 +++++----- tailwind.config.ts | 12 +++--- tsconfig.json | 34 +++++++-------- vite.config.ts | 6 +-- 15 files changed, 161 insertions(+), 164 deletions(-) diff --git a/.prettierrc b/.prettierrc index 7ebb855..323a4ae 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,15 +1,12 @@ { - "useTabs": true, - "singleQuote": true, - "trailingComma": "none", - "printWidth": 100, - "plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"], - "overrides": [ - { - "files": "*.svelte", - "options": { - "parser": "svelte" - } - } - ] + "printWidth": 100, + "plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"], + "overrides": [ + { + "files": "*.svelte", + "options": { + "parser": "svelte" + } + } + ] } diff --git a/drizzle.config.ts b/drizzle.config.ts index e28ca0c..68872c7 100644 --- a/drizzle.config.ts +++ b/drizzle.config.ts @@ -1,14 +1,14 @@ -import { defineConfig } from 'drizzle-kit'; -if (!process.env.DATABASE_URL) throw new Error('DATABASE_URL is not set'); +import { defineConfig } from "drizzle-kit"; +if (!process.env.DATABASE_URL) throw new Error("DATABASE_URL is not set"); export default defineConfig({ - schema: './src/lib/server/db/schema.ts', + schema: "./src/lib/server/db/schema.ts", - dbCredentials: { - url: process.env.DATABASE_URL - }, + dbCredentials: { + url: process.env.DATABASE_URL, + }, - verbose: true, - strict: true, - dialect: 'sqlite' + verbose: true, + strict: true, + dialect: "sqlite", }); diff --git a/eslint.config.js b/eslint.config.js index aa5987f..612cb6b 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,34 +1,34 @@ -import prettier from 'eslint-config-prettier'; -import js from '@eslint/js'; -import { includeIgnoreFile } from '@eslint/compat'; -import svelte from 'eslint-plugin-svelte'; -import globals from 'globals'; -import { fileURLToPath } from 'node:url'; -import ts from 'typescript-eslint'; -const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url)); +import prettier from "eslint-config-prettier"; +import js from "@eslint/js"; +import { includeIgnoreFile } from "@eslint/compat"; +import svelte from "eslint-plugin-svelte"; +import globals from "globals"; +import { fileURLToPath } from "node:url"; +import ts from "typescript-eslint"; +const gitignorePath = fileURLToPath(new URL("./.gitignore", import.meta.url)); export default ts.config( - includeIgnoreFile(gitignorePath), - js.configs.recommended, - ...ts.configs.recommended, - ...svelte.configs['flat/recommended'], - prettier, - ...svelte.configs['flat/prettier'], - { - languageOptions: { - globals: { - ...globals.browser, - ...globals.node - } - } - }, - { - files: ['**/*.svelte'], + includeIgnoreFile(gitignorePath), + js.configs.recommended, + ...ts.configs.recommended, + ...svelte.configs["flat/recommended"], + prettier, + ...svelte.configs["flat/prettier"], + { + languageOptions: { + globals: { + ...globals.browser, + ...globals.node, + }, + }, + }, + { + files: ["**/*.svelte"], - languageOptions: { - parserOptions: { - parser: ts.parser - } - } - } + languageOptions: { + parserOptions: { + parser: ts.parser, + }, + }, + }, ); diff --git a/package.json b/package.json index b6b7098..4b09ce6 100644 --- a/package.json +++ b/package.json @@ -1,44 +1,44 @@ { - "name": "arkvault", - "private": true, - "version": "0.0.1", - "type": "module", - "scripts": { - "dev": "vite dev", - "build": "vite build", - "preview": "vite preview", - "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", - "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", - "format": "prettier --write .", - "lint": "prettier --check . && eslint .", - "db:push": "drizzle-kit push", - "db:migrate": "drizzle-kit migrate", - "db:studio": "drizzle-kit studio" - }, - "devDependencies": { - "@eslint/compat": "^1.2.3", - "@sveltejs/adapter-node": "^5.2.9", - "@sveltejs/kit": "^2.0.0", - "@sveltejs/vite-plugin-svelte": "^4.0.0", - "@types/better-sqlite3": "^7.6.11", - "autoprefixer": "^10.4.20", - "drizzle-kit": "^0.22.0", - "eslint": "^9.7.0", - "eslint-config-prettier": "^9.1.0", - "eslint-plugin-svelte": "^2.36.0", - "globals": "^15.0.0", - "prettier": "^3.3.2", - "prettier-plugin-svelte": "^3.2.6", - "prettier-plugin-tailwindcss": "^0.6.5", - "svelte": "^5.0.0", - "svelte-check": "^4.0.0", - "tailwindcss": "^3.4.9", - "typescript": "^5.0.0", - "typescript-eslint": "^8.0.0", - "vite": "^5.4.11" - }, - "dependencies": { - "better-sqlite3": "^11.1.2", - "drizzle-orm": "^0.33.0" - } + "name": "arkvault", + "private": true, + "version": "0.0.1", + "type": "module", + "scripts": { + "dev": "vite dev", + "build": "vite build", + "preview": "vite preview", + "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", + "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", + "format": "prettier --write .", + "lint": "prettier --check . && eslint .", + "db:push": "drizzle-kit push", + "db:migrate": "drizzle-kit migrate", + "db:studio": "drizzle-kit studio" + }, + "devDependencies": { + "@eslint/compat": "^1.2.3", + "@sveltejs/adapter-node": "^5.2.9", + "@sveltejs/kit": "^2.0.0", + "@sveltejs/vite-plugin-svelte": "^4.0.0", + "@types/better-sqlite3": "^7.6.11", + "autoprefixer": "^10.4.20", + "drizzle-kit": "^0.22.0", + "eslint": "^9.7.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-svelte": "^2.36.0", + "globals": "^15.0.0", + "prettier": "^3.3.2", + "prettier-plugin-svelte": "^3.2.6", + "prettier-plugin-tailwindcss": "^0.6.5", + "svelte": "^5.0.0", + "svelte-check": "^4.0.0", + "tailwindcss": "^3.4.9", + "typescript": "^5.0.0", + "typescript-eslint": "^8.0.0", + "vite": "^5.4.11" + }, + "dependencies": { + "better-sqlite3": "^11.1.2", + "drizzle-orm": "^0.33.0" + } } diff --git a/postcss.config.js b/postcss.config.js index 0f77216..2aa7205 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,6 +1,6 @@ export default { - plugins: { - tailwindcss: {}, - autoprefixer: {} - } + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, }; diff --git a/src/app.css b/src/app.css index a31e444..76fcadc 100644 --- a/src/app.css +++ b/src/app.css @@ -1,3 +1,3 @@ -@import 'tailwindcss/base'; -@import 'tailwindcss/components'; -@import 'tailwindcss/utilities'; +@import "tailwindcss/base"; +@import "tailwindcss/components"; +@import "tailwindcss/utilities"; diff --git a/src/app.d.ts b/src/app.d.ts index da08e6d..520c421 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -1,13 +1,13 @@ // See https://svelte.dev/docs/kit/types#app.d.ts // for information about these interfaces declare global { - namespace App { - // interface Error {} - // interface Locals {} - // interface PageData {} - // interface PageState {} - // interface Platform {} - } + namespace App { + // interface Error {} + // interface Locals {} + // interface PageData {} + // interface PageState {} + // interface Platform {} + } } export {}; diff --git a/src/app.html b/src/app.html index 77a5ff5..84ffad1 100644 --- a/src/app.html +++ b/src/app.html @@ -1,12 +1,12 @@ - - - - - %sveltekit.head% - - -
%sveltekit.body%
- + + + + + %sveltekit.head% + + +
%sveltekit.body%
+ diff --git a/src/lib/server/db/index.ts b/src/lib/server/db/index.ts index 205b05b..8093e19 100644 --- a/src/lib/server/db/index.ts +++ b/src/lib/server/db/index.ts @@ -1,6 +1,6 @@ -import { drizzle } from 'drizzle-orm/better-sqlite3'; -import Database from 'better-sqlite3'; -import { env } from '$env/dynamic/private'; -if (!env.DATABASE_URL) throw new Error('DATABASE_URL is not set'); +import { drizzle } from "drizzle-orm/better-sqlite3"; +import Database from "better-sqlite3"; +import { env } from "$env/dynamic/private"; +if (!env.DATABASE_URL) throw new Error("DATABASE_URL is not set"); const client = new Database(env.DATABASE_URL); export const db = drizzle(client); diff --git a/src/lib/server/db/schema.ts b/src/lib/server/db/schema.ts index 01ed1b3..d6309dd 100644 --- a/src/lib/server/db/schema.ts +++ b/src/lib/server/db/schema.ts @@ -1,6 +1,6 @@ -import { sqliteTable, text, integer } from 'drizzle-orm/sqlite-core'; +import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core"; -export const user = sqliteTable('user', { - id: integer('id').primaryKey(), - age: integer('age') +export const user = sqliteTable("user", { + id: integer("id").primaryKey(), + age: integer("age"), }); diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 9b776b7..3fa208a 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,6 +1,6 @@ {@render children()} diff --git a/svelte.config.js b/svelte.config.js index e0a641e..bbef2bb 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,18 +1,18 @@ -import adapter from '@sveltejs/adapter-node'; -import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; +import adapter from "@sveltejs/adapter-node"; +import { vitePreprocess } from "@sveltejs/vite-plugin-svelte"; /** @type {import('@sveltejs/kit').Config} */ const config = { - // Consult https://svelte.dev/docs/kit/integrations - // for more information about preprocessors - preprocess: vitePreprocess(), + // Consult https://svelte.dev/docs/kit/integrations + // for more information about preprocessors + preprocess: vitePreprocess(), - kit: { - // 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() - } + kit: { + // 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(), + }, }; export default config; diff --git a/tailwind.config.ts b/tailwind.config.ts index aa4bc77..9d75afa 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -1,11 +1,11 @@ -import type { Config } from 'tailwindcss'; +import type { Config } from "tailwindcss"; export default { - content: ['./src/**/*.{html,js,svelte,ts}'], + content: ["./src/**/*.{html,js,svelte,ts}"], - theme: { - extend: {} - }, + theme: { + extend: {}, + }, - plugins: [] + plugins: [], } satisfies Config; diff --git a/tsconfig.json b/tsconfig.json index 0b2d886..f4d0a0e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,19 +1,19 @@ { - "extends": "./.svelte-kit/tsconfig.json", - "compilerOptions": { - "allowJs": true, - "checkJs": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true, - "skipLibCheck": true, - "sourceMap": true, - "strict": true, - "moduleResolution": "bundler" - } - // Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias - // except $lib which is handled by https://svelte.dev/docs/kit/configuration#files - // - // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes - // from the referenced tsconfig.json - TypeScript does not merge them in + "extends": "./.svelte-kit/tsconfig.json", + "compilerOptions": { + "allowJs": true, + "checkJs": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "sourceMap": true, + "strict": true, + "moduleResolution": "bundler" + } + // Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias + // except $lib which is handled by https://svelte.dev/docs/kit/configuration#files + // + // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes + // from the referenced tsconfig.json - TypeScript does not merge them in } diff --git a/vite.config.ts b/vite.config.ts index bbf8c7d..80864b9 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,6 +1,6 @@ -import { sveltekit } from '@sveltejs/kit/vite'; -import { defineConfig } from 'vite'; +import { sveltekit } from "@sveltejs/kit/vite"; +import { defineConfig } from "vite"; export default defineConfig({ - plugins: [sveltekit()] + plugins: [sveltekit()], });