From 8f6c2fc8b822eb290f48ea2beb328f8a2a526bbd Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Wed, 20 May 2020 10:11:38 +0800 Subject: [PATCH] run prettier --- package.json | 2 +- resources/assets/src/styles/common.css | 3 ++- .../assets/src/views/user/profile/email.ts | 14 +++++++------- .../assets/src/views/user/profile/nickname.ts | 12 ++++++------ .../assets/src/views/user/profile/password.ts | 14 +++++++------- resources/assets/tests/tsconfig.json | 17 ++++------------- 6 files changed, 27 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index f8a0db64..0ca3e18b 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "dev": "webpack-dev-server", "build": "webpack --mode=production -p --progress", "lint": "eslint --ext=ts -f=beauty .", - "fmt": "prettier --write 'resources/assets/**/*.{ts,tsx}'", + "fmt": "prettier --write resources/assets", "test": "jest" }, "dependencies": { diff --git a/resources/assets/src/styles/common.css b/resources/assets/src/styles/common.css index 29b0f934..bc8e6bee 100644 --- a/resources/assets/src/styles/common.css +++ b/resources/assets/src/styles/common.css @@ -8,7 +8,8 @@ a { outline: none; } -.brand-link, .navbar-brand { +.brand-link, +.navbar-brand { font-family: Minecraft; } diff --git a/resources/assets/src/views/user/profile/email.ts b/resources/assets/src/views/user/profile/email.ts index e52fed57..0c43abf8 100644 --- a/resources/assets/src/views/user/profile/email.ts +++ b/resources/assets/src/views/user/profile/email.ts @@ -8,13 +8,13 @@ export default async function handler(event: Event) { const email: string = form.email.value const password: string = form.password.value - const { - code, - message, - }: ResponseBody = await post('/user/profile?action=email', { - new_email: email, - password, - }) + const { code, message }: ResponseBody = await post( + '/user/profile?action=email', + { + new_email: email, + password, + }, + ) await showModal({ mode: 'alert', text: message }) if (code === 0) { window.location.href = `${blessing.base_url}/auth/login` diff --git a/resources/assets/src/views/user/profile/nickname.ts b/resources/assets/src/views/user/profile/nickname.ts index 53eb761d..b6f4caee 100644 --- a/resources/assets/src/views/user/profile/nickname.ts +++ b/resources/assets/src/views/user/profile/nickname.ts @@ -7,12 +7,12 @@ export default async function handler(event: Event) { const form = event.target as HTMLFormElement const nickname: string = form.nickname.value - const { - code, - message, - }: ResponseBody = await post('/user/profile?action=nickname', { - new_nickname: nickname, - }) + const { code, message }: ResponseBody = await post( + '/user/profile?action=nickname', + { + new_nickname: nickname, + }, + ) showModal({ mode: 'alert', text: message }) if (code === 0) { document.querySelectorAll('[data-mark="nickname"]').forEach((el) => { diff --git a/resources/assets/src/views/user/profile/password.ts b/resources/assets/src/views/user/profile/password.ts index adc71c78..3aafc634 100644 --- a/resources/assets/src/views/user/profile/password.ts +++ b/resources/assets/src/views/user/profile/password.ts @@ -16,13 +16,13 @@ export default async function handler(event: Event) { return } - const { - code, - message, - }: ResponseBody = await post('/user/profile?action=password', { - current_password: oldPassword, - new_password: newPassword, - }) + const { code, message }: ResponseBody = await post( + '/user/profile?action=password', + { + current_password: oldPassword, + new_password: newPassword, + }, + ) await showModal({ mode: 'alert', text: message }) if (code === 0) { window.location.href = `${blessing.base_url}/auth/login` diff --git a/resources/assets/tests/tsconfig.json b/resources/assets/tests/tsconfig.json index f26b4eaf..bbbb6d23 100644 --- a/resources/assets/tests/tsconfig.json +++ b/resources/assets/tests/tsconfig.json @@ -4,20 +4,11 @@ "baseUrl": "..", "noEmit": true, "paths": { - "@/scripts/*": [ - "./tests/ts-shims/*", - "./src/scripts/*" - ], - "@/components/*": [ - "./src/components/*" - ], - "@/views/*": [ - "./src/views/*" - ], + "@/scripts/*": ["./tests/ts-shims/*", "./src/scripts/*"], + "@/components/*": ["./src/components/*"], + "@/views/*": ["./src/views/*"], "@/*": ["./src/*"] } }, - "include": [ - "." - ] + "include": ["."] }