Skip to content

Commit

Permalink
chore: change prettier and editor_config config (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
moonlitgrace authored Dec 11, 2024
1 parent 86b4a8e commit 692548d
Show file tree
Hide file tree
Showing 59 changed files with 4,199 additions and 4,173 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 92

[*.py]
indent_size = 4
26 changes: 13 additions & 13 deletions frontend/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
}
]
"singleQuote": true,
"trailingComma": "none",
"printWidth": 92,
"tabWidth": 2,
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
}
]
}
4 changes: 2 additions & 2 deletions frontend/e2e/demo.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, test } from '@playwright/test';

test('home page has expected h1', async ({ page }) => {
await page.goto('/');
await expect(page.locator('h1')).toBeVisible();
await page.goto('/');
await expect(page.locator('h1')).toBeVisible();
});
48 changes: 24 additions & 24 deletions frontend/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@ import globals from 'globals';
import ts from 'typescript-eslint';

export default ts.config(
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs['flat/recommended'],
prettier,
...svelte.configs['flat/prettier'],
{
languageOptions: {
globals: {
...globals.browser,
...globals.node
}
}
},
{
files: ['**/*.svelte'],
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
}
}
},
{
ignores: ['build/', '.svelte-kit/', 'dist/']
}
languageOptions: {
parserOptions: {
parser: ts.parser
}
}
},
{
ignores: ['build/', '.svelte-kit/', 'dist/']
}
);
100 changes: 50 additions & 50 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
{
"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 . --log-level silent",
"lint": "prettier --check . && eslint .",
"test": "npm run test:unit -- --run && npm run test:e2e",
"test:unit": "vitest",
"test:e2e": "playwright test",
"test:ts": "tsc --noEmit",
"openapi-ts": "dotenvx run -- node ./scripts/generate_schema.js"
},
"devDependencies": {
"@coreproject-moe/icons": "^0.0.67",
"@dotenvx/dotenvx": "^1.28.0",
"@playwright/test": "^1.45.3",
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/kit": "^2.8.3",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/forms": "^0.5.9",
"@tailwindcss/typography": "^0.5.15",
"@types/eslint": "^9.6.0",
"@types/node": "^22.10.1",
"autoprefixer": "^10.4.20",
"clsx": "^2.1.1",
"daisyui": "^4.12.14",
"eslint": "^9.7.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.36.0",
"globals": "^15.0.0",
"openapi-fetch": "^0.13.3",
"openapi-typescript": "^7.4.4",
"prettier": "^3.3.2",
"prettier-plugin-svelte": "^3.2.6",
"prettier-plugin-tailwindcss": "^0.6.5",
"readable-numbers": "^1.0.8",
"svelte": "^5.0.0",
"svelte-check": "^4.0.0",
"tailwind-merge": "^2.5.4",
"tailwind-scrollbar": "^3.1.0",
"tailwindcss": "^3.4.9",
"typescript": "^5.0.0",
"typescript-eslint": "^8.0.0",
"vite": "^5.0.3",
"vitest": "^2.0.4"
}
"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 . --log-level silent",
"lint": "prettier --check . && eslint .",
"test": "npm run test:unit -- --run && npm run test:e2e",
"test:unit": "vitest",
"test:e2e": "playwright test",
"test:ts": "tsc --noEmit",
"openapi-ts": "dotenvx run -- node ./scripts/generate_schema.js"
},
"devDependencies": {
"@coreproject-moe/icons": "^0.0.67",
"@dotenvx/dotenvx": "^1.28.0",
"@playwright/test": "^1.45.3",
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/kit": "^2.8.3",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/forms": "^0.5.9",
"@tailwindcss/typography": "^0.5.15",
"@types/eslint": "^9.6.0",
"@types/node": "^22.10.1",
"autoprefixer": "^10.4.20",
"clsx": "^2.1.1",
"daisyui": "^4.12.14",
"eslint": "^9.7.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.36.0",
"globals": "^15.0.0",
"openapi-fetch": "^0.13.3",
"openapi-typescript": "^7.4.4",
"prettier": "^3.3.2",
"prettier-plugin-svelte": "^3.2.6",
"prettier-plugin-tailwindcss": "^0.6.5",
"readable-numbers": "^1.0.8",
"svelte": "^5.0.0",
"svelte-check": "^4.0.0",
"tailwind-merge": "^2.5.4",
"tailwind-scrollbar": "^3.1.0",
"tailwindcss": "^3.4.9",
"typescript": "^5.0.0",
"typescript-eslint": "^8.0.0",
"vite": "^5.0.3",
"vitest": "^2.0.4"
}
}
10 changes: 5 additions & 5 deletions frontend/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { defineConfig } from '@playwright/test';

export default defineConfig({
webServer: {
command: 'npm run build && npm run preview',
port: 4173
},
webServer: {
command: 'npm run build && npm run preview',
port: 4173
},

testDir: 'e2e'
testDir: 'e2e'
});
8 changes: 4 additions & 4 deletions frontend/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
plugins: {
tailwindcss: {},
autoprefixer: {}
}
};
14 changes: 7 additions & 7 deletions frontend/scripts/generate_schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { fileURLToPath } from 'url';
const api_url = process.env.PUBLIC_API_URL;

if (!api_url) {
console.error('error: PUBLIC_API_URL is not defined in your .env file.');
process.exit(0);
console.error('error: PUBLIC_API_URL is not defined in your .env file.');
process.exit(0);
}

const __filename = fileURLToPath(import.meta.url);
Expand All @@ -16,9 +16,9 @@ const output_path = path.resolve(__dirname, '../src/lib/clients/v1.ts');
const command = `openapi-typescript ${api_url}/api/v1/schema/ -o ${output_path}`;

exec(command, (error, stdout) => {
if (error) {
console.log(`error: ${error}`);
return;
}
console.log(`stdout: ${stdout}`);
if (error) {
console.log(`error: ${error}`);
return;
}
console.log(`stdout: ${stdout}`);
});
118 changes: 59 additions & 59 deletions frontend/src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,82 +3,82 @@
@import 'tailwindcss/utilities';

@layer base {
@font-face {
font-family: 'DM Sans';
src: url('/fonts/dm-sans/DMSans-Thin.ttf') format('truetype');
font-weight: 100;
font-style: normal;
}
@font-face {
font-family: 'DM Sans';
src: url('/fonts/dm-sans/DMSans-Thin.ttf') format('truetype');
font-weight: 100;
font-style: normal;
}

@font-face {
font-family: 'DM Sans';
src: url('/fonts/dm-sans/DMSans-ExtraLight.ttf') format('truetype');
font-weight: 200;
font-style: normal;
}
@font-face {
font-family: 'DM Sans';
src: url('/fonts/dm-sans/DMSans-ExtraLight.ttf') format('truetype');
font-weight: 200;
font-style: normal;
}

@font-face {
font-family: 'DM Sans';
src: url('/fonts/dm-sans/DMSans-Light.ttf') format('truetype');
font-weight: 300;
font-style: normal;
}
@font-face {
font-family: 'DM Sans';
src: url('/fonts/dm-sans/DMSans-Light.ttf') format('truetype');
font-weight: 300;
font-style: normal;
}

@font-face {
font-family: 'DM Sans';
src: url('/fonts/dm-sans/DMSans-Regular.ttf') format('truetype');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'DM Sans';
src: url('/fonts/dm-sans/DMSans-Regular.ttf') format('truetype');
font-weight: 400;
font-style: normal;
}

@font-face {
font-family: 'DM Sans';
src: url('/fonts/dm-sans/DMSans-Medium.ttf') format('truetype');
font-weight: 500;
font-style: normal;
}
@font-face {
font-family: 'DM Sans';
src: url('/fonts/dm-sans/DMSans-Medium.ttf') format('truetype');
font-weight: 500;
font-style: normal;
}

@font-face {
font-family: 'DM Sans';
src: url('/fonts/dm-sans/DMSans-SemiBold.ttf') format('truetype');
font-weight: 600;
font-style: normal;
}
@font-face {
font-family: 'DM Sans';
src: url('/fonts/dm-sans/DMSans-SemiBold.ttf') format('truetype');
font-weight: 600;
font-style: normal;
}

@font-face {
font-family: 'DM Sans';
src: url('/fonts/dm-sans/DMSans-Bold.ttf') format('truetype');
font-weight: 700;
font-style: normal;
}
@font-face {
font-family: 'DM Sans';
src: url('/fonts/dm-sans/DMSans-Bold.ttf') format('truetype');
font-weight: 700;
font-style: normal;
}

@font-face {
font-family: 'DM Sans';
src: url('/fonts/dm-sans/DMSans-ExtraBold.ttf') format('truetype');
font-weight: 800;
font-style: normal;
}
@font-face {
font-family: 'DM Sans';
src: url('/fonts/dm-sans/DMSans-ExtraBold.ttf') format('truetype');
font-weight: 800;
font-style: normal;
}

@font-face {
font-family: 'DM Sans';
src: url('/fonts/dm-sans/DMSans-Black.ttf') format('truetype');
font-weight: 900;
font-style: normal;
}
@font-face {
font-family: 'DM Sans';
src: url('/fonts/dm-sans/DMSans-Black.ttf') format('truetype');
font-weight: 900;
font-style: normal;
}
}

@layer base {
:root {
@apply bg-base-300 text-base-content;
}
:root {
@apply bg-base-300 text-base-content;
}
}

html {
@apply scrollbar-thin;
@apply scrollbar-thin;
}

/* daisyui */

.btn {
@apply min-h-max;
@apply min-h-max;
}
Loading

0 comments on commit 692548d

Please sign in to comment.