From 657a64ca7f5041f2fba18793cb559fd35cceacb1 Mon Sep 17 00:00:00 2001 From: Dominik Stahl Date: Mon, 30 Jun 2025 10:45:28 +0200 Subject: [PATCH] style: new prettier config modified the prettier config to force an import order for all files --- .prettierrc.json | 19 ++++++++++++++++++- eslint.config.mjs | 2 +- exportSwagger.ts | 3 ++- package.json | 1 + 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.prettierrc.json b/.prettierrc.json index e29d501..c9dddfe 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,4 +1,21 @@ { "singleQuote": true, - "jsxSingleQuote": true + "jsxSingleQuote": true, + "semi": true, + "trailingComma": "all", + "printWidth": 80, + "tabWidth": 2, + "useTabs": false, + "endOfLine": "lf", + "importOrder": [ + "^@/components/(.*)$", + "^@/lib/(.*)$", + "^@/app/(.*)$", + "^@/generated/(.*)$", + "^@/(auth|prisma)$", + "^[./]" + ], + "importOrderSeparation": true, + "importOrderSortSpecifiers": true, + "plugins": ["@trivago/prettier-plugin-sort-imports"] } diff --git a/eslint.config.mjs b/eslint.config.mjs index b557f04..0736038 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,6 +1,6 @@ +import { FlatCompat } from '@eslint/eslintrc'; import { dirname } from 'path'; import { fileURLToPath } from 'url'; -import { FlatCompat } from '@eslint/eslintrc'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/exportSwagger.ts b/exportSwagger.ts index 6b6df1e..4d033fd 100644 --- a/exportSwagger.ts +++ b/exportSwagger.ts @@ -1,8 +1,9 @@ -import { registry } from '@/lib/swagger'; import { OpenApiGeneratorV3 } from '@asteasolutions/zod-to-openapi'; import fs from 'fs'; import path from 'path'; +import { registry } from '@/lib/swagger'; + function recursiveFileSearch(dir: string, fileList: string[] = []): string[] { const files = fs.readdirSync(dir); files.forEach((file) => { diff --git a/package.json b/package.json index e5e8c9e..4db52a7 100644 --- a/package.json +++ b/package.json @@ -73,6 +73,7 @@ "devDependencies": { "@eslint/eslintrc": "3.3.1", "@tailwindcss/postcss": "4.1.11", + "@trivago/prettier-plugin-sort-imports": "^5.2.2", "@types/node": "22.15.34", "@types/react": "19.1.8", "@types/react-big-calendar": "1.16.2",