diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..f20f94c --- /dev/null +++ b/.prettierignore @@ -0,0 +1,9 @@ +node_modules +dist +build +.next +coverage +*.min.js +pnpm-lock.yaml +**/prisma/migrations +**/prisma/client diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..10de7ee --- /dev/null +++ b/.prettierrc @@ -0,0 +1,20 @@ +{ + "semi": false, + "singleQuote": false, + "tabWidth": 2, + "trailingComma": "es5", + "printWidth": 80, + "plugins": ["@trivago/prettier-plugin-sort-imports"], + "importOrder": [ + "^react(-dom)?$", + "^react-", + "^next", + "^@?\\w", + "^@repo/", + "^@/", + "^\\.\\./", + "^\\./" + ], + "importOrderSeparation": false, + "importOrderSortSpecifiers": true +} diff --git a/Dockerfile b/Dockerfile index dc48c10..6394bfe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ COPY packages/eslint-config/package.json ./packages/eslint-config/ COPY packages/typescript-config/package.json ./packages/typescript-config/ COPY packages/ui/package.json ./packages/ui/ -RUN pnpm install --frozen-lockfile +RUN timeout 60 pnpm install --frozen-lockfile COPY . . diff --git a/Dockerfile.node b/Dockerfile.node index 814fae8..341ac22 100644 --- a/Dockerfile.node +++ b/Dockerfile.node @@ -12,7 +12,7 @@ COPY packages/eslint-config/package.json ./packages/eslint-config/ COPY packages/typescript-config/package.json ./packages/typescript-config/ COPY packages/ui/package.json ./packages/ui/ -RUN pnpm install --frozen-lockfile +RUN timeout 60 pnpm install --frozen-lockfile COPY . . diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index d201bb5..fbe7ea9 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -9,3 +9,4 @@ - Added ESLint configurations for all packages and apps - Updated TypeScript configurations across the monorepo - Consolidated `@types/react` version overrides for consistency +- Added Prettier configuration with automatic import sorting diff --git a/package.json b/package.json index 89e2af2..7e6e580 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "0.10.3", + "version": "0.10.4", "name": "letterspace", "private": true, "scripts": { @@ -7,10 +7,11 @@ "dev": "turbo dev", "lint": "turbo lint", "check-types": "turbo check-types", - "format": "prettier --write \"**/*.{ts,tsx,md}\"", + "format": "prettier --write .", "knip": "knip" }, "devDependencies": { + "@trivago/prettier-plugin-sort-imports": "^6.0.0", "@types/node": "^24.0.3", "bun-types": "^1.2.17", "knip": "^5.77.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c4a86df..fee0ffc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,6 +12,9 @@ importers: .: devDependencies: + '@trivago/prettier-plugin-sort-imports': + specifier: ^6.0.0 + version: 6.0.0(prettier@3.4.2) '@types/node': specifier: ^24.0.3 version: 24.0.3 @@ -729,11 +732,6 @@ packages: resolution: {integrity: sha512-FCvFTm0sWV8Fxhpp2McP5/W53GPllQ9QeQ7SiqGWjMf/LVG07lFa5+pgK05IRhVwtvafT22KF+ZSnM9I545CvQ==} engines: {node: '>=6.9.0'} - '@babel/parser@7.27.1': - resolution: {integrity: sha512-I0dZ3ZpCrJ1c04OqlNsQcKiZlsrXf/kkE4FXzID9rIOYICsAbA8mMDzhW/luRNAHdCNt7os/u8wenklZDlUVUQ==} - engines: {node: '>=6.0.0'} - hasBin: true - '@babel/parser@7.28.5': resolution: {integrity: sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==} engines: {node: '>=6.0.0'} @@ -1138,10 +1136,6 @@ packages: resolution: {integrity: sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==} engines: {node: '>=6.9.0'} - '@babel/traverse@7.27.1': - resolution: {integrity: sha512-ZCYtZciz1IWJB4U61UPu4KEaqyfj+r5T1Q5mqPo+IBpcG9kHv30Z0aD8LXPgC1trYa6rK0orRyAhqUgk4MjmEg==} - engines: {node: '>=6.9.0'} - '@babel/traverse@7.28.5': resolution: {integrity: sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ==} engines: {node: '>=6.9.0'} @@ -3444,6 +3438,25 @@ packages: '@theguild/remark-npm2yarn@0.3.3': resolution: {integrity: sha512-ma6DvR03gdbvwqfKx1omqhg9May/VYGdMHvTzB4VuxkyS7KzfZ/lzrj43hmcsggpMje0x7SADA/pcMph0ejRnA==} + '@trivago/prettier-plugin-sort-imports@6.0.0': + resolution: {integrity: sha512-Xarx55ow0R8oC7ViL5fPmDsg1EBa1dVhyZFVbFXNtPPJyW2w9bJADIla8YFSaNG9N06XfcklA9O9vmw4noNxkQ==} + engines: {node: '>= 20'} + peerDependencies: + '@vue/compiler-sfc': 3.x + prettier: 2.x - 3.x + prettier-plugin-ember-template-tag: '>= 2.0.0' + prettier-plugin-svelte: 3.x + svelte: 4.x || 5.x + peerDependenciesMeta: + '@vue/compiler-sfc': + optional: true + prettier-plugin-ember-template-tag: + optional: true + prettier-plugin-svelte: + optional: true + svelte: + optional: true + '@trpc/client@11.0.4': resolution: {integrity: sha512-2xIXqRNc8wH3zgcGp1yZ8P2ZL15BoFWq2RS8S3ldjvxsdJfnoYmcvCNzySw8nIrWbKiXl9prdw+bGIUOdG/omw==} peerDependencies: @@ -5307,10 +5320,6 @@ packages: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} deprecated: Glob versions prior to v9 are no longer supported - globals@11.12.0: - resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} - engines: {node: '>=4'} - globals@14.0.0: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} engines: {node: '>=18'} @@ -5684,6 +5693,9 @@ packages: engines: {node: '>=10'} hasBin: true + javascript-natural-sort@0.7.1: + resolution: {integrity: sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==} + jiti@1.21.7: resolution: {integrity: sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==} hasBin: true @@ -6459,12 +6471,18 @@ packages: parse-entities@4.0.2: resolution: {integrity: sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw==} + parse-imports-exports@0.2.4: + resolution: {integrity: sha512-4s6vd6dx1AotCx/RCI2m7t7GCh5bDRUtGNvRfHSP2wbBQdMi67pPe7mtzmgwcaQ8VKK/6IB7Glfyu3qdZJPybQ==} + parse-latin@7.0.0: resolution: {integrity: sha512-mhHgobPPua5kZ98EF4HWiH167JWBfl4pvAIXXdbaVohtK7a6YBOy56kvhCqduqyo/f3yrHFWmqmiMg/BkBkYYQ==} parse-numeric-range@1.3.0: resolution: {integrity: sha512-twN+njEipszzlMJd4ONUYgSfZPDxgHhT9Ahed5uTigpQn90FggW4SA/AIPq/6a149fTbE9qBEcSwE3FAEp6wQQ==} + parse-statements@1.0.11: + resolution: {integrity: sha512-HlsyYdMBnbPQ9Jr/VgJ1YF4scnldvJpJxCVx6KgqPL4dxppsWrJHCIIxQXMJrqGnsRkNPATbeMJ8Yxu7JMsYcA==} + parse5@7.3.0: resolution: {integrity: sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==} @@ -8116,8 +8134,8 @@ snapshots: '@ampproject/remapping@2.3.0': dependencies: - '@jridgewell/gen-mapping': 0.3.8 - '@jridgewell/trace-mapping': 0.3.25 + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 '@antfu/install-pkg@1.0.0': dependencies: @@ -8156,7 +8174,7 @@ snapshots: '@babel/code-frame@7.27.1': dependencies: - '@babel/helper-validator-identifier': 7.27.1 + '@babel/helper-validator-identifier': 7.28.5 js-tokens: 4.0.0 picocolors: 1.1.1 @@ -8168,14 +8186,14 @@ snapshots: dependencies: '@ampproject/remapping': 2.3.0 '@babel/code-frame': 7.27.1 - '@babel/generator': 7.27.1 + '@babel/generator': 7.28.5 '@babel/helper-compilation-targets': 7.27.1 '@babel/helper-module-transforms': 7.27.1(@babel/core@7.27.1) '@babel/helpers': 7.27.1 - '@babel/parser': 7.27.1 + '@babel/parser': 7.28.5 '@babel/template': 7.27.1 - '@babel/traverse': 7.27.1 - '@babel/types': 7.27.1 + '@babel/traverse': 7.28.5 + '@babel/types': 7.28.5 convert-source-map: 2.0.0 debug: 4.4.3 gensync: 1.0.0-beta.2 @@ -8186,8 +8204,8 @@ snapshots: '@babel/generator@7.27.1': dependencies: - '@babel/parser': 7.27.1 - '@babel/types': 7.27.1 + '@babel/parser': 7.28.5 + '@babel/types': 7.28.5 '@jridgewell/gen-mapping': 0.3.8 '@jridgewell/trace-mapping': 0.3.25 jsesc: 3.1.0 @@ -8262,7 +8280,7 @@ snapshots: '@babel/helper-module-imports@7.27.1': dependencies: - '@babel/traverse': 7.27.1 + '@babel/traverse': 7.28.5 '@babel/types': 7.28.5 transitivePeerDependencies: - supports-color @@ -8271,8 +8289,8 @@ snapshots: dependencies: '@babel/core': 7.27.1 '@babel/helper-module-imports': 7.27.1 - '@babel/helper-validator-identifier': 7.27.1 - '@babel/traverse': 7.27.1 + '@babel/helper-validator-identifier': 7.28.5 + '@babel/traverse': 7.28.5 transitivePeerDependencies: - supports-color @@ -8334,12 +8352,8 @@ snapshots: '@babel/helpers@7.27.1': dependencies: - '@babel/template': 7.27.1 - '@babel/types': 7.27.1 - - '@babel/parser@7.27.1': - dependencies: - '@babel/types': 7.27.1 + '@babel/template': 7.27.2 + '@babel/types': 7.28.5 '@babel/parser@7.28.5': dependencies: @@ -8834,7 +8848,7 @@ snapshots: dependencies: '@babel/code-frame': 7.27.1 '@babel/parser': 7.28.5 - '@babel/types': 7.27.1 + '@babel/types': 7.28.5 '@babel/template@7.27.2': dependencies: @@ -8842,18 +8856,6 @@ snapshots: '@babel/parser': 7.28.5 '@babel/types': 7.28.5 - '@babel/traverse@7.27.1': - dependencies: - '@babel/code-frame': 7.27.1 - '@babel/generator': 7.27.1 - '@babel/parser': 7.28.5 - '@babel/template': 7.27.1 - '@babel/types': 7.27.1 - debug: 4.4.3 - globals: 11.12.0 - transitivePeerDependencies: - - supports-color - '@babel/traverse@7.28.5': dependencies: '@babel/code-frame': 7.27.1 @@ -10790,6 +10792,20 @@ snapshots: npm-to-yarn: 3.0.1 unist-util-visit: 5.0.0 + '@trivago/prettier-plugin-sort-imports@6.0.0(prettier@3.4.2)': + dependencies: + '@babel/generator': 7.28.5 + '@babel/parser': 7.28.5 + '@babel/traverse': 7.28.5 + '@babel/types': 7.28.5 + javascript-natural-sort: 0.7.1 + lodash-es: 4.17.21 + minimatch: 9.0.5 + parse-imports-exports: 0.2.4 + prettier: 3.4.2 + transitivePeerDependencies: + - supports-color + '@trpc/client@11.0.4(@trpc/server@11.0.4(typescript@5.7.3))(typescript@5.7.3)': dependencies: '@trpc/server': 11.0.4(typescript@5.7.3) @@ -10833,24 +10849,24 @@ snapshots: '@types/babel__core@7.20.5': dependencies: - '@babel/parser': 7.27.1 - '@babel/types': 7.27.1 + '@babel/parser': 7.28.5 + '@babel/types': 7.28.5 '@types/babel__generator': 7.27.0 '@types/babel__template': 7.4.4 '@types/babel__traverse': 7.20.7 '@types/babel__generator@7.27.0': dependencies: - '@babel/types': 7.27.1 + '@babel/types': 7.28.5 '@types/babel__template@7.4.4': dependencies: '@babel/parser': 7.28.5 - '@babel/types': 7.27.1 + '@babel/types': 7.28.5 '@types/babel__traverse@7.20.7': dependencies: - '@babel/types': 7.27.1 + '@babel/types': 7.28.5 '@types/body-parser@1.19.5': dependencies: @@ -12554,7 +12570,7 @@ snapshots: '@next/eslint-plugin-next': 16.1.1 eslint: 9.26.0(jiti@2.6.1) eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.8.0(eslint-plugin-import@2.32.0)(eslint@9.26.0(jiti@2.6.1)) + eslint-import-resolver-typescript: 3.8.0(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.50.1(eslint@9.26.0(jiti@2.6.1))(typescript@5.7.3))(eslint@9.26.0(jiti@2.6.1)))(eslint@9.26.0(jiti@2.6.1)) eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.50.1(eslint@9.26.0(jiti@2.6.1))(typescript@5.7.3))(eslint-import-resolver-typescript@3.8.0)(eslint@9.26.0(jiti@2.6.1)) eslint-plugin-jsx-a11y: 6.10.2(eslint@9.26.0(jiti@2.6.1)) eslint-plugin-react: 7.37.4(eslint@9.26.0(jiti@2.6.1)) @@ -12601,7 +12617,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.8.0(eslint-plugin-import@2.32.0)(eslint@9.26.0(jiti@2.6.1)): + eslint-import-resolver-typescript@3.8.0(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.50.1(eslint@9.26.0(jiti@2.6.1))(typescript@5.7.3))(eslint@9.26.0(jiti@2.6.1)))(eslint@9.26.0(jiti@2.6.1)): dependencies: '@nolyfill/is-core-module': 1.0.39 debug: 4.4.3 @@ -12616,11 +12632,36 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.1(@typescript-eslint/parser@8.50.1(eslint@9.26.0(jiti@2.6.1))(typescript@5.7.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.8.0)(eslint@9.26.0(jiti@2.6.1)): + eslint-import-resolver-typescript@3.8.0(eslint-plugin-import@2.32.0)(eslint@9.26.0(jiti@2.6.1)): + dependencies: + '@nolyfill/is-core-module': 1.0.39 + debug: 4.4.3 + enhanced-resolve: 5.18.1 + eslint: 9.26.0(jiti@2.6.1) + get-tsconfig: 4.10.0 + is-bun-module: 1.3.0 + stable-hash: 0.0.4 + tinyglobby: 0.2.15 + optionalDependencies: + eslint-plugin-import: 2.32.0(eslint-import-resolver-typescript@3.8.0)(eslint@9.26.0(jiti@2.6.1)) + transitivePeerDependencies: + - supports-color + + eslint-module-utils@2.12.1(@typescript-eslint/parser@8.50.1(eslint@9.26.0(jiti@2.6.1))(typescript@5.7.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.8.0(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.50.1(eslint@9.26.0(jiti@2.6.1))(typescript@5.7.3))(eslint@9.26.0(jiti@2.6.1)))(eslint@9.26.0(jiti@2.6.1)))(eslint@9.26.0(jiti@2.6.1)): dependencies: debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 8.50.1(eslint@9.26.0(jiti@2.6.1))(typescript@5.7.3) + eslint: 9.26.0(jiti@2.6.1) + eslint-import-resolver-node: 0.3.9 + eslint-import-resolver-typescript: 3.8.0(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.50.1(eslint@9.26.0(jiti@2.6.1))(typescript@5.7.3))(eslint@9.26.0(jiti@2.6.1)))(eslint@9.26.0(jiti@2.6.1)) + transitivePeerDependencies: + - supports-color + + eslint-module-utils@2.12.1(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.8.0)(eslint@9.26.0(jiti@2.6.1)): + dependencies: + debug: 3.2.7 + optionalDependencies: eslint: 9.26.0(jiti@2.6.1) eslint-import-resolver-node: 0.3.9 eslint-import-resolver-typescript: 3.8.0(eslint-plugin-import@2.32.0)(eslint@9.26.0(jiti@2.6.1)) @@ -12638,7 +12679,7 @@ snapshots: doctrine: 2.1.0 eslint: 9.26.0(jiti@2.6.1) eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.50.1(eslint@9.26.0(jiti@2.6.1))(typescript@5.7.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.8.0)(eslint@9.26.0(jiti@2.6.1)) + eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.50.1(eslint@9.26.0(jiti@2.6.1))(typescript@5.7.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.8.0(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.50.1(eslint@9.26.0(jiti@2.6.1))(typescript@5.7.3))(eslint@9.26.0(jiti@2.6.1)))(eslint@9.26.0(jiti@2.6.1)))(eslint@9.26.0(jiti@2.6.1)) hasown: 2.0.2 is-core-module: 2.16.1 is-glob: 4.0.3 @@ -12667,7 +12708,7 @@ snapshots: doctrine: 2.1.0 eslint: 9.26.0(jiti@2.6.1) eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.50.1(eslint@9.26.0(jiti@2.6.1))(typescript@5.7.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.8.0)(eslint@9.26.0(jiti@2.6.1)) + eslint-module-utils: 2.12.1(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.8.0)(eslint@9.26.0(jiti@2.6.1)) hasown: 2.0.2 is-core-module: 2.16.1 is-glob: 4.0.3 @@ -13223,8 +13264,6 @@ snapshots: once: 1.4.0 path-is-absolute: 1.0.1 - globals@11.12.0: {} - globals@14.0.0: {} globals@15.15.0: {} @@ -13664,6 +13703,8 @@ snapshots: filelist: 1.0.4 picocolors: 1.1.1 + javascript-natural-sort@0.7.1: {} + jiti@1.21.7: {} jiti@2.4.2: {} @@ -14802,6 +14843,10 @@ snapshots: is-decimal: 2.0.1 is-hexadecimal: 2.0.1 + parse-imports-exports@0.2.4: + dependencies: + parse-statements: 1.0.11 + parse-latin@7.0.0: dependencies: '@types/nlcst': 2.0.3 @@ -14813,6 +14858,8 @@ snapshots: parse-numeric-range@1.3.0: {} + parse-statements@1.0.11: {} + parse5@7.3.0: dependencies: entities: 6.0.0