From cbec42831b4e5733865ceda84c5638647787b157 Mon Sep 17 00:00:00 2001 From: ycdesu Date: Fri, 10 Jun 2022 18:52:09 +0800 Subject: [PATCH] tool: setup prettier --- frontend/.prettierignore | 3 +++ frontend/.prettierrc.json | 3 +++ frontend/package.json | 4 +++- frontend/yarn.lock | 5 +++++ 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 frontend/.prettierignore create mode 100644 frontend/.prettierrc.json diff --git a/frontend/.prettierignore b/frontend/.prettierignore new file mode 100644 index 000000000..9b87eae9e --- /dev/null +++ b/frontend/.prettierignore @@ -0,0 +1,3 @@ +.next/ +out/ +node_modules/ \ No newline at end of file diff --git a/frontend/.prettierrc.json b/frontend/.prettierrc.json new file mode 100644 index 000000000..544138be4 --- /dev/null +++ b/frontend/.prettierrc.json @@ -0,0 +1,3 @@ +{ + "singleQuote": true +} diff --git a/frontend/package.json b/frontend/package.json index 110a60b4f..d2e5bc191 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -6,7 +6,8 @@ "dev": "yarn run next dev", "build": "yarn run next build", "start": "yarn run next start", - "export": "yarn run next build && yarn run next export" + "export": "yarn run next build && yarn run next export", + "prettier": "prettier --write ." }, "dependencies": { "@material-ui/core": "^4.11.2", @@ -33,6 +34,7 @@ "next-transpile-modules": "^6.1.0", "postcss-flexbugs-fixes": "^5.0.2", "postcss-preset-env": "^6.7.0", + "prettier": "^2.6.2", "typescript": "^4.1.3" } } diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 2988f4e84..e705c58a2 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -3201,6 +3201,11 @@ postcss@^7.0.14, postcss@^7.0.17, postcss@^7.0.2, postcss@^7.0.32, postcss@^7.0. picocolors "^0.2.1" source-map "^0.6.1" +prettier@^2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.2.tgz#e26d71a18a74c3d0f0597f55f01fb6c06c206032" + integrity sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew== + process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"