From 2b408eaa84d653437f776dc8356531bc2dbd5f35 Mon Sep 17 00:00:00 2001 From: Ruslan Konviser Date: Sat, 21 Oct 2023 20:03:23 +0200 Subject: [PATCH] chore: prettier --- apps/extensions/.prettierrc.cjs | 26 +++++++++++++------------- apps/mobile/.prettierrc | 27 +++++++++++++++++++++++++++ apps/web/.prettierrc | 25 +++++++++++++++++++++++-- package.json | 5 ++++- 4 files changed, 67 insertions(+), 16 deletions(-) create mode 100644 apps/mobile/.prettierrc diff --git a/apps/extensions/.prettierrc.cjs b/apps/extensions/.prettierrc.cjs index ee0bf6bd5..bdac24dc4 100644 --- a/apps/extensions/.prettierrc.cjs +++ b/apps/extensions/.prettierrc.cjs @@ -2,16 +2,16 @@ * @type {import('prettier').Options} */ module.exports = { - printWidth: 80, - tabWidth: 2, - useTabs: false, - semi: false, - singleQuote: false, - trailingComma: "none", - bracketSpacing: true, - bracketSameLine: true, - plugins: [require.resolve("@plasmohq/prettier-plugin-sort-imports")], - importOrder: ["^@plasmohq/(.*)$", "^~(.*)$", "^[./]"], - importOrderSeparation: true, - importOrderSortSpecifiers: true -} + printWidth: 120, + tabWidth: 4, + useTabs: true, + semi: true, + singleQuote: true, + trailingComma: 'none', + bracketSpacing: true, + bracketSameLine: true, + plugins: [require.resolve('@plasmohq/prettier-plugin-sort-imports')], + importOrder: ['^@plasmohq/(.*)$', '^~(.*)$', '^[./]'], + importOrderSeparation: true, + importOrderSortSpecifiers: true +}; diff --git a/apps/mobile/.prettierrc b/apps/mobile/.prettierrc new file mode 100644 index 000000000..1a058e296 --- /dev/null +++ b/apps/mobile/.prettierrc @@ -0,0 +1,27 @@ +{ + "printWidth": 120, + "singleQuote": true, + "semi": true, + "useTabs": true, + "tabWidth": 4, + "arrowParens": "always", + "trailingComma": "none", + "quoteProps": "as-needed", + "trimTrailingWhitespace": true, + "overrides": [ + { + "files": "*.scss", + "options": { + "useTabs": false, + "tabWidth": 2 + } + }, + { + "files": "*.yml", + "options": { + "useTabs": false, + "tabWidth": 2 + } + } + ] +} diff --git a/apps/web/.prettierrc b/apps/web/.prettierrc index ec9312c3d..1a058e296 100644 --- a/apps/web/.prettierrc +++ b/apps/web/.prettierrc @@ -1,6 +1,27 @@ { + "printWidth": 120, "singleQuote": true, - "trailingComma": "none", + "semi": true, "useTabs": true, - "tabWidth": 2 + "tabWidth": 4, + "arrowParens": "always", + "trailingComma": "none", + "quoteProps": "as-needed", + "trimTrailingWhitespace": true, + "overrides": [ + { + "files": "*.scss", + "options": { + "useTabs": false, + "tabWidth": 2 + } + }, + { + "files": "*.yml", + "options": { + "useTabs": false, + "tabWidth": 2 + } + } + ] } diff --git a/package.json b/package.json index d46a808fc..087675f59 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,10 @@ "lint-fix:scss": "cd apps/web && stylelint **/*.{scss,css} --fix", "e2e": "yarn run postinstall.web && yarn run config:dev && yarn ng e2e --browser chrome", "e2e:ci": "yarn run postinstall.web && yarn run config:prod && yarn --frozen-lockfile --cache-folder ~/.cache/yarn ng:ci e2e -c=production --prod --headless", - "prettier": "cd apps/web && prettier --write **/*.{js,jsx,ts,tsx,scss,css} --config ./.prettierrc", + "prettier": "yarn prettier:web && yarn prettier:mobile && yarn prettier:extensions", + "prettier:extensions": "cd apps/extensions && prettier --write **/*.{js,jsx,ts,tsx,scss,css} --config ./.prettierrc.cjs", + "prettier:web": "cd apps/web && prettier --write **/*.{js,jsx,ts,tsx,scss,css} --config ./.prettierrc", + "prettier:mobile": "cd apps/mobile && prettier --write **/*.{js,jsx,ts,tsx,scss,css} --config ./.prettierrc", "postinstall": "lerna bootstrap", "precommit": "yarn lint-fix && yarn lint-fix:scss && yarn prettier", "affected:apps": "yarn nx affected:apps",