From bf2ae51fb0056047236480c34bd259d241999130 Mon Sep 17 00:00:00 2001 From: Brian Bowman Date: Tue, 19 Jul 2022 06:48:44 -0500 Subject: [PATCH] Add prettier formatter --- .eslintrc.json | 15 ++------------- .prettierignore | 4 ++++ .prettierrc.json | 4 ++++ package.json | 4 +++- yarn.lock | 10 ++++++++++ 5 files changed, 23 insertions(+), 14 deletions(-) create mode 100644 .prettierignore create mode 100644 .prettierrc.json diff --git a/.eslintrc.json b/.eslintrc.json index a683c1e..f2dd2be 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -7,7 +7,8 @@ "extends": [ "eslint:recommended", "plugin:react/recommended", - "plugin:@typescript-eslint/recommended" + "plugin:@typescript-eslint/recommended", + "prettier" ], "parser": "@typescript-eslint/parser", "parserOptions": { @@ -22,18 +23,6 @@ "@typescript-eslint" ], "rules": { - "indent": [ - "error", - 2 - ], - "quotes": [ - "error", - "single" - ], - "semi": [ - "error", - "never" - ], "@typescript-eslint/ban-types": [ "warn", { diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..76252dd --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +node_modules/ +src-tauri/resources/ +src-tauri/target/ +src-tauri/WixTools/ \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..b2095be --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,4 @@ +{ + "semi": false, + "singleQuote": true +} diff --git a/package.json b/package.json index 7573b1c..1f0a4d4 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "eject": "react-scripts eject", "tauri": "tauri", "start:dev": "tauri dev", - "format": "cargo fmt --manifest-path ./src-tauri/Cargo.toml --all", + "format": "cargo fmt --manifest-path ./src-tauri/Cargo.toml --all && yarn prettier --write --cache --loglevel warn .", "lint": "cargo clippy --manifest-path ./src-tauri/Cargo.toml --no-default-features && yarn tsc --noEmit && yarn eslint src" }, "eslintConfig": { @@ -55,7 +55,9 @@ "@typescript-eslint/parser": "^5.22.0", "cross-env": "^7.0.3", "eslint": "^8.15.0", + "eslint-config-prettier": "^8.5.0", "eslint-plugin-react": "^7.29.4", + "prettier": "^2.7.1", "run-script-os": "^1.1.6" } } diff --git a/yarn.lock b/yarn.lock index df0232e..54bdb1c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3922,6 +3922,11 @@ escodegen@^2.0.0: optionalDependencies: source-map "~0.6.1" +eslint-config-prettier@^8.5.0: + version "8.5.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz#5a81680ec934beca02c7b1a61cf8ca34b66feab1" + integrity sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q== + eslint-config-react-app@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/eslint-config-react-app/-/eslint-config-react-app-7.0.1.tgz#73ba3929978001c5c86274c017ea57eb5fa644b4" @@ -7105,6 +7110,11 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== +prettier@^2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" + integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== + pretty-bytes@^5.3.0, pretty-bytes@^5.4.1: version "5.6.0" resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb"