From 4b9a2e0260908fb57cb81514bc9a385ffaf7305c Mon Sep 17 00:00:00 2001 From: Alexander Liu Date: Sat, 12 Aug 2023 15:59:17 -0700 Subject: [PATCH] feat: prettier running prettier in each app/package to respect individual prettierignore files --- .eslintrc.js | 16 ++--- .prettierrc | 3 + .prettierrc.js | 7 --- package.json | 7 ++- pnpm-lock.yaml | 165 +++++++++---------------------------------------- turbo.json | 19 ++++-- 6 files changed, 59 insertions(+), 158 deletions(-) create mode 100644 .prettierrc delete mode 100644 .prettierrc.js diff --git a/.eslintrc.js b/.eslintrc.js index 5b999efa..2665bd73 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,10 +1,10 @@ module.exports = { - root: true, - // This tells ESLint to load the config from the package `eslint-config-custom` - extends: ["custom"], - settings: { - next: { - rootDir: ["apps/*/"], - }, - }, + root: true, + // This tells ESLint to load the config from the package `eslint-config-custom` + extends: ["custom"], + settings: { + next: { + rootDir: ["apps/*/"], + }, + }, }; diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..082bcddc --- /dev/null +++ b/.prettierrc @@ -0,0 +1,3 @@ +{ + "useTabs": true +} \ No newline at end of file diff --git a/.prettierrc.js b/.prettierrc.js deleted file mode 100644 index 4c3e3d8c..00000000 --- a/.prettierrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - "trailingComma": "es5", - "tabWidth": 4, - "useTabs": true, - "semi": true, - "singleQuote": false -} \ No newline at end of file diff --git a/package.json b/package.json index dabaa854..0d01a44b 100644 --- a/package.json +++ b/package.json @@ -4,16 +4,17 @@ "build": "turbo run build", "dev": "turbo run dev", "lint": "turbo run lint", - "format": "prettier --write \"**/*.{ts,tsx,md}\"" + "format:write": "turbo run format:write", + "format:check": "turbo run format:check" }, "devDependencies": { "@turbo/gen": "^1.9.7", "eslint": "^7.32.0", "eslint-config-custom": "workspace:*", "next": "^13.4.1", - "prettier": "^2.5.1", + "prettier": "3.0.1 ", "turbo": "latest" }, "packageManager": "pnpm@8.6.10", "name": "zothacks-site-2023" -} +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9e84eaf9..9c88d022 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,45 +21,11 @@ importers: specifier: ^13.4.1 version: 13.4.1(react-dom@18.2.0)(react@18.2.0)(sass@1.65.1) prettier: - specifier: ^2.5.1 - version: 2.8.8 + specifier: '3.0.1 ' + version: 3.0.1 turbo: specifier: latest - version: 1.10.12 - - apps/docs: - dependencies: - next: - specifier: ^13.4.1 - version: 13.4.1(react-dom@18.2.0)(react@18.2.0) - react: - specifier: ^18.2.0 - version: 18.2.0 - react-dom: - specifier: ^18.2.0 - version: 18.2.0(react@18.2.0) - ui: - specifier: workspace:* - version: link:../../packages/ui - devDependencies: - '@types/node': - specifier: ^17.0.12 - version: 17.0.45 - '@types/react': - specifier: ^18.0.22 - version: 18.2.5 - '@types/react-dom': - specifier: ^18.0.7 - version: 18.2.3 - eslint-config-custom: - specifier: workspace:* - version: link:../../packages/eslint-config-custom - tsconfig: - specifier: workspace:* - version: link:../../packages/tsconfig - typescript: - specifier: ^4.5.3 - version: 4.9.5 + version: 1.10.4 apps/site: dependencies: @@ -98,40 +64,6 @@ importers: specifier: workspace:* version: link:../../packages/eslint-config-custom - apps/web: - dependencies: - next: - specifier: ^13.4.1 - version: 13.4.1(react-dom@18.2.0)(react@18.2.0) - react: - specifier: ^18.2.0 - version: 18.2.0 - react-dom: - specifier: ^18.2.0 - version: 18.2.0(react@18.2.0) - ui: - specifier: workspace:* - version: link:../../packages/ui - devDependencies: - '@types/node': - specifier: ^17.0.12 - version: 17.0.45 - '@types/react': - specifier: ^18.0.22 - version: 18.2.5 - '@types/react-dom': - specifier: ^18.0.7 - version: 18.2.3 - eslint-config-custom: - specifier: workspace:* - version: link:../../packages/eslint-config-custom - tsconfig: - specifier: workspace:* - version: link:../../packages/tsconfig - typescript: - specifier: ^4.5.3 - version: 4.9.5 - apps/zothacks-site-2023-sanity: dependencies: '@sanity/vision': @@ -6347,51 +6279,6 @@ packages: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} dev: true - /next@13.4.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-JBw2kAIyhKDpjhEWvNVoFeIzNp9xNxg8wrthDOtMctfn3EpqGCmW0FSviNyGgOSOSn6zDaX48pmvbdf6X2W9xA==} - engines: {node: '>=16.8.0'} - hasBin: true - peerDependencies: - '@opentelemetry/api': ^1.1.0 - fibers: '>= 3.1.0' - node-sass: ^6.0.0 || ^7.0.0 - react: ^18.2.0 - react-dom: ^18.2.0 - sass: ^1.3.0 - peerDependenciesMeta: - '@opentelemetry/api': - optional: true - fibers: - optional: true - node-sass: - optional: true - sass: - optional: true - dependencies: - '@next/env': 13.4.1 - '@swc/helpers': 0.5.1 - busboy: 1.6.0 - caniuse-lite: 1.0.30001519 - postcss: 8.4.14 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - styled-jsx: 5.1.1(react@18.2.0) - zod: 3.21.4 - optionalDependencies: - '@next/swc-darwin-arm64': 13.4.1 - '@next/swc-darwin-x64': 13.4.1 - '@next/swc-linux-arm64-gnu': 13.4.1 - '@next/swc-linux-arm64-musl': 13.4.1 - '@next/swc-linux-x64-gnu': 13.4.1 - '@next/swc-linux-x64-musl': 13.4.1 - '@next/swc-win32-arm64-msvc': 13.4.1 - '@next/swc-win32-ia32-msvc': 13.4.1 - '@next/swc-win32-x64-msvc': 13.4.1 - transitivePeerDependencies: - - '@babel/core' - - babel-plugin-macros - dev: false - /next@13.4.1(react-dom@18.2.0)(react@18.2.0)(sass@1.65.1): resolution: {integrity: sha512-JBw2kAIyhKDpjhEWvNVoFeIzNp9xNxg8wrthDOtMctfn3EpqGCmW0FSviNyGgOSOSn6zDaX48pmvbdf6X2W9xA==} engines: {node: '>=16.8.0'} @@ -6889,6 +6776,12 @@ packages: hasBin: true dev: true + /prettier@3.0.1: + resolution: {integrity: sha512-fcOWSnnpCrovBsmFZIGIy9UqK2FaI7Hqax+DIO0A9UxeVoY4iweyaFjS5TavZN97Hfehph0nhsZnjlVKzEQSrQ==} + engines: {node: '>=14'} + hasBin: true + dev: true + /pretty-ms@7.0.1: resolution: {integrity: sha512-973driJZvxiGOQ5ONsFhOF/DtzPMOMtgC11kCpUrPGMTgqp2q/1gwzCquocrN33is0VZ5GFHXZYMM9l6h67v2Q==} engines: {node: '>=10'} @@ -8056,65 +7949,65 @@ packages: safe-buffer: 5.2.1 dev: false - /turbo-darwin-64@1.10.12: - resolution: {integrity: sha512-vmDfGVPl5/aFenAbOj3eOx3ePNcWVUyZwYr7taRl0ZBbmv2TzjRiFotO4vrKCiTVnbqjQqAFQWY2ugbqCI1kOQ==} + /turbo-darwin-64@1.10.4: + resolution: {integrity: sha512-oAILq0QZUvOxYZU71SXRsL7DFpqZutPl9CX7+rD48tReHrmhcm3HMeuAFY0S5FD/9fKub04UfAQwVtJSlhvISg==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /turbo-darwin-arm64@1.10.12: - resolution: {integrity: sha512-3JliEESLNX2s7g54SOBqqkqJ7UhcOGkS0ywMr5SNuvF6kWVTbuUq7uBU/sVbGq8RwvK1ONlhPvJne5MUqBCTCQ==} + /turbo-darwin-arm64@1.10.4: + resolution: {integrity: sha512-N0XPFLXsZRLE6gKDa5MREpPQp0drOz9PrADaaMXTlspxWS/tmmxyH+ZQ/uGqKC/0mqsNIhZuSFsEVZe1PGaqxw==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /turbo-linux-64@1.10.12: - resolution: {integrity: sha512-siYhgeX0DidIfHSgCR95b8xPee9enKSOjCzx7EjTLmPqPaCiVebRYvbOIYdQWRqiaKh9yfhUtFmtMOMScUf1gg==} + /turbo-linux-64@1.10.4: + resolution: {integrity: sha512-S8ZVNCPnrBU+GMKKUWcgg4MaTOdL1reOU1XQtDiHfEPskXjLE+10vr65xJJQb6CqO8ARFXUlFSAUfxZRX6WVNA==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-linux-arm64@1.10.12: - resolution: {integrity: sha512-K/ZhvD9l4SslclaMkTiIrnfcACgos79YcAo4kwc8bnMQaKuUeRpM15sxLpZp3xDjDg8EY93vsKyjaOhdFG2UbA==} + /turbo-linux-arm64@1.10.4: + resolution: {integrity: sha512-/C6vpo7kd2ae6dR0iZyRuvfjijuixidhwLzV026A+/1gmAMRXYkslBfgOGfoOquHmvqjCeDVTsMWwCY2NRQqtw==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-windows-64@1.10.12: - resolution: {integrity: sha512-7FSgSwvktWDNOqV65l9AbZwcoueAILeE4L7JvjauNASAjjbuzXGCEq5uN8AQU3U5BOFj4TdXrVmO2dX+lLu8Zg==} + /turbo-windows-64@1.10.4: + resolution: {integrity: sha512-fh6X/fJl9gNTu3r7zMmwCychxMlpQMFn32bpioPNIBxrTHCbQYeGSQuw2XWa/RswgNzCY3Xo34emYAKu9btrsw==} cpu: [x64] os: [win32] requiresBuild: true dev: true optional: true - /turbo-windows-arm64@1.10.12: - resolution: {integrity: sha512-gCNXF52dwom1HLY9ry/cneBPOKTBHhzpqhMylcyvJP0vp9zeMQQkt6yjYv+6QdnmELC92CtKNp2FsNZo+z0pyw==} + /turbo-windows-arm64@1.10.4: + resolution: {integrity: sha512-KzcKGl+bjwaSkxMNTutuoIM+xPuTBA13zJiC2vFM7fQ6XYM0/ZmUekfoxpMnWgSav8vlTk5tRYaPniLcVzLnTQ==} cpu: [arm64] os: [win32] requiresBuild: true dev: true optional: true - /turbo@1.10.12: - resolution: {integrity: sha512-WM3+jTfQWnB9W208pmP4oeehZcC6JQNlydb/ZHMRrhmQa+htGhWLCzd6Q9rLe0MwZLPpSPFV2/bN5egCLyoKjQ==} + /turbo@1.10.4: + resolution: {integrity: sha512-EVBt762wVGyZAXtp1UWQptRG2N/9TThUJ1tRawvt/pmB62VmdzgDuz80SQYXK5U5yKEID6OJdqAzq8HnIQVA6g==} hasBin: true requiresBuild: true optionalDependencies: - turbo-darwin-64: 1.10.12 - turbo-darwin-arm64: 1.10.12 - turbo-linux-64: 1.10.12 - turbo-linux-arm64: 1.10.12 - turbo-windows-64: 1.10.12 - turbo-windows-arm64: 1.10.12 + turbo-darwin-64: 1.10.4 + turbo-darwin-arm64: 1.10.4 + turbo-linux-64: 1.10.4 + turbo-linux-arm64: 1.10.4 + turbo-windows-64: 1.10.4 + turbo-windows-arm64: 1.10.4 dev: true /type-check@0.4.0: diff --git a/turbo.json b/turbo.json index ec4d016d..40af4823 100644 --- a/turbo.json +++ b/turbo.json @@ -1,15 +1,26 @@ { "$schema": "https://turbo.build/schema.json", - "globalDependencies": ["**/.env.*local"], + "globalDependencies": [ + "**/.env.*local" + ], "pipeline": { "build": { - "dependsOn": ["^build"], - "outputs": [".next/**", "!.next/cache/**"] + "dependsOn": [ + "^build" + ], + "outputs": [ + ".next/**", + "!.next/cache/**" + ] }, "lint": {}, + "format:write": { + "cache": false + }, + "format:check": {}, "dev": { "cache": false, "persistent": true } } -} +} \ No newline at end of file