diff --git a/.gitignore b/.gitignore index 585c32ce..35294998 100644 --- a/.gitignore +++ b/.gitignore @@ -48,4 +48,6 @@ next-env.d.ts .env.sentry-build-plugin # for packages/lib -generated/ \ No newline at end of file +generated/ +.eslintcache +.prettiercache diff --git a/.lintstagedrc.cjs b/.lintstagedrc.cjs deleted file mode 100644 index e7c0252e..00000000 --- a/.lintstagedrc.cjs +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - '*.{js,jsx,ts,tsx}': ['eslint --fix', 'bash -c "pnpm run typecheck"'], - '*.{md,json,yaml,ts,tsx}': 'prettier --write', - '*.css': 'stylelint --fix', -}; diff --git a/apps/beets-frontend-v3/.lintstagedrc.mjs b/apps/beets-frontend-v3/.lintstagedrc.mjs index 77d0d7fd..5e15c4bb 100644 --- a/apps/beets-frontend-v3/.lintstagedrc.mjs +++ b/apps/beets-frontend-v3/.lintstagedrc.mjs @@ -1,13 +1,7 @@ -// https://nextjs.org/docs/pages/building-your-application/configuring/eslint#lint-staged -import baseConfig from '../../.lintstagedrc.cjs' -import path from 'path' - -const buildEslintCommand = filenames => - `next lint --fix --max-warnings 0 --file ${filenames - .map(f => path.relative(process.cwd(), f)) - .join(' --file ')}` - export default { - ...baseConfig, - '*.{js,jsx,ts,tsx}': [buildEslintCommand, 'bash -c "pnpm run typecheck"'], + '*.{js,jsx,ts,tsx}': "eslint --fix --cache --max-warnings 0", + '**/*.ts?(x)': 'bash -c "pnpm typecheck"', + '*.{md,json,yaml,ts,tsx}': 'prettier --write', + '*.css': 'stylelint --fix', } + diff --git a/apps/beets-frontend-v3/package.json b/apps/beets-frontend-v3/package.json index 9b13b3d2..d1235484 100644 --- a/apps/beets-frontend-v3/package.json +++ b/apps/beets-frontend-v3/package.json @@ -8,12 +8,12 @@ "dev": "concurrently \"pnpm --filter @repo/lib graphql:gen --watch\" \"next dev -p 3001\"", "dev:no-gen": "next dev -p 3001", "gen:wagmi": "pnpm wagmi generate", - "lint": "next lint", - "lint:fix": "next lint --fix", - "format": "prettier '**/*.*(md|json|yaml|ts|js|tsx)' --check --cache --cache-location='node_modules/.cache/.prettiercache' --log-level=warn", - "format:fix": "prettier '**/*.*(md|json|yaml|ts|js|tsx)' --write --cache --cache-location='node_modules/.cache/.prettiercache' --log-level=warn", + "lint": "eslint . --cache", + "lint:fix": "eslint . --fix --max-warnings 0 --cache", + "format": "prettier '**/*.*(md|json|yaml|ts|js|tsx)' --check --cache --log-level=warn", + "format:fix": "prettier '**/*.*(md|json|yaml|ts|js|tsx)' --write --cache --log-level=warn", "start": "next start", - "typecheck": "tsc --project tsconfig.json --noEmit", + "typecheck": "tsc --project tsconfig.json --noEmit --incremental", "gen:theme-typings": "chakra-cli tokens ./lib/services/chakra/themes/beets/beets.theme.ts", "postinstall": "npm run gen:theme-typings" }, diff --git a/apps/beets-frontend-v3/tsconfig.json b/apps/beets-frontend-v3/tsconfig.json index 69f8b278..d17c2f93 100644 --- a/apps/beets-frontend-v3/tsconfig.json +++ b/apps/beets-frontend-v3/tsconfig.json @@ -22,5 +22,5 @@ ".next/types/**/*.ts", "../../packages/lib/global.d.ts" ], - "exclude": ["node_modules", ".next"] + "exclude": ["node_modules", ".next", "**/generated/**"] } diff --git a/apps/frontend-v3/.lintstagedrc.mjs b/apps/frontend-v3/.lintstagedrc.mjs index 77d0d7fd..5e15c4bb 100644 --- a/apps/frontend-v3/.lintstagedrc.mjs +++ b/apps/frontend-v3/.lintstagedrc.mjs @@ -1,13 +1,7 @@ -// https://nextjs.org/docs/pages/building-your-application/configuring/eslint#lint-staged -import baseConfig from '../../.lintstagedrc.cjs' -import path from 'path' - -const buildEslintCommand = filenames => - `next lint --fix --max-warnings 0 --file ${filenames - .map(f => path.relative(process.cwd(), f)) - .join(' --file ')}` - export default { - ...baseConfig, - '*.{js,jsx,ts,tsx}': [buildEslintCommand, 'bash -c "pnpm run typecheck"'], + '*.{js,jsx,ts,tsx}': "eslint --fix --cache --max-warnings 0", + '**/*.ts?(x)': 'bash -c "pnpm typecheck"', + '*.{md,json,yaml,ts,tsx}': 'prettier --write', + '*.css': 'stylelint --fix', } + diff --git a/apps/frontend-v3/app/opengraphimage-old.jpg b/apps/frontend-v3/app/opengraphimage-old.jpg deleted file mode 100644 index 6f92f2d5..00000000 Binary files a/apps/frontend-v3/app/opengraphimage-old.jpg and /dev/null differ diff --git a/apps/frontend-v3/package.json b/apps/frontend-v3/package.json index 70446f9d..720091f0 100644 --- a/apps/frontend-v3/package.json +++ b/apps/frontend-v3/package.json @@ -8,12 +8,12 @@ "dev": "concurrently \"pnpm --filter @repo/lib graphql:gen --watch\" \"next dev\"", "dev:no-gen": "next dev", "gen:wagmi": "pnpm wagmi generate", - "lint": "next lint", - "lint:fix": "next lint --fix", - "format": "prettier '**/*.*(md|json|yaml|ts|js|tsx)' --check --cache --cache-location='node_modules/.cache/.prettiercache' --log-level warn", - "format:fix": "prettier '**/*.*(md|json|yaml|ts|js|tsx)' --write --cache --cache-location='node_modules/.cache/.prettiercache' --log-level=warn", + "lint": "eslint . --max-warnings 0 --cache", + "lint:fix": "eslint . --fix --max-warnings 0 --cache", + "format": "prettier '**/*.*(md|json|yaml|ts|js|tsx)' --check --cache --log-level warn", + "format:fix": "prettier '**/*.*(md|json|yaml|ts|js|tsx)' --write --cache --log-level=warn", "start": "next start", - "typecheck": "tsc --project tsconfig.json --noEmit", + "typecheck": "tsc --project tsconfig.json --noEmit --incremental", "gen:theme-typings": "chakra-cli tokens ./lib/services/chakra/themes/bal/bal.theme.ts", "postinstall": "npm run gen:theme-typings" }, diff --git a/apps/frontend-v3/tsconfig.json b/apps/frontend-v3/tsconfig.json index 69f8b278..d17c2f93 100644 --- a/apps/frontend-v3/tsconfig.json +++ b/apps/frontend-v3/tsconfig.json @@ -22,5 +22,5 @@ ".next/types/**/*.ts", "../../packages/lib/global.d.ts" ], - "exclude": ["node_modules", ".next"] + "exclude": ["node_modules", ".next", "**/generated/**"] } diff --git a/package.json b/package.json index fe48a5aa..d149c6af 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,8 @@ "lint:all:fix": "turbo run lint:fix format:fix --continue --force", "lint": "turbo lint", "lint:fix": "turbo lint:fix", - "format": "prettier '*.*(md|json|yaml|ts|js|tsx)' --check --cache --cache-location='node_modules/.cache/.prettiercache'", - "format:fix": "prettier '*.*(md|json|yaml|ts|js|tsx)' --write --cache --cache-location='node_modules/.cache/.prettiercache' --log-level=warn", + "format": "prettier '*.*(md|json|yaml|ts|js|tsx)' --check --cache", + "format:fix": "prettier '*.*(md|json|yaml|ts|js|tsx)' --write --cache --log-level=warn", "stylelint": "stylelint '**/*.css'", "stylelint:fix": "pnpm run stylelint -- --fix", "test:integration": "turbo test:integration --ui=stream --log-order=stream --", diff --git a/packages/eslint-config/next.js b/packages/eslint-config/next.js index 3210d983..56d5ccfd 100644 --- a/packages/eslint-config/next.js +++ b/packages/eslint-config/next.js @@ -33,12 +33,22 @@ module.exports = { // Ignore dotfiles '.*.js', 'node_modules/', + 'next.config.js', ], overrides: [{ files: ['*.js?(x)', '*.ts?(x)'] }], rules: { curly: ['error', 'multi-line'], 'no-console': ['off'], - 'max-len': ['warn', { code: 120, ignoreComments: true, ignoreUrls: true, ignoreTemplateLiterals: true, ignoreStrings: true }], + 'max-len': [ + 'warn', + { + code: 120, + ignoreComments: true, + ignoreUrls: true, + ignoreTemplateLiterals: true, + ignoreStrings: true, + }, + ], '@typescript-eslint/no-explicit-any': ['off'], 'no-html-link-for-pages': ['off'], 'no-restricted-imports': [ diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index 9c39e0d6..8b3de81b 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -21,7 +21,7 @@ "scripts": { "lint": "eslint .", "lint:fix": "eslint . --fix", - "format": "prettier '**/*.*(md|json|yaml|ts|js|tsx)' --check --cache --cache-location='node_modules/.cache/.prettiercache' --log-level=warn", - "format:fix": "prettier '**/*.*(md|json|yaml|ts|js|tsx)' --write --cache --cache-location='node_modules/.cache/.prettiercache' --log-level=warn" + "format": "prettier '**/*.*(md|json|yaml|ts|js|tsx)' --check --cache --log-level=warn", + "format:fix": "prettier '**/*.*(md|json|yaml|ts|js|tsx)' --write --cache --log-level=warn" } } diff --git a/packages/lib/.lintstagedrc.mjs b/packages/lib/.lintstagedrc.mjs new file mode 100644 index 00000000..5e15c4bb --- /dev/null +++ b/packages/lib/.lintstagedrc.mjs @@ -0,0 +1,7 @@ +export default { + '*.{js,jsx,ts,tsx}': "eslint --fix --cache --max-warnings 0", + '**/*.ts?(x)': 'bash -c "pnpm typecheck"', + '*.{md,json,yaml,ts,tsx}': 'prettier --write', + '*.css': 'stylelint --fix', +} + diff --git a/packages/lib/package.json b/packages/lib/package.json index a90b53c7..ba1a6aca 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -4,16 +4,16 @@ "private": true, "scripts": { "graphql:gen": "DOTENV_CONFIG_PATH=./.env.local graphql-codegen -r dotenv/config -c ./shared/services/api/codegen.ts", - "lint": "eslint . --cache --cache-location 'node_modules/.cache/.eslintcache'", - "lint:fix": "eslint . --fix --cache --cache-location 'node_modules/.cache/.eslintcache'", - "format": "prettier '**/*.*(md|json|yaml|ts|js|tsx)' --check --cache --cache-location='node_modules/.cache/.prettiercache' --log-level=warn", - "format:fix": "prettier '**/*.*(md|json|yaml|ts|js|tsx)' --write --cache --cache-location='node_modules/.cache/.prettiercache' --log-level=warn", + "lint": "eslint . --cache", + "lint:fix": "eslint . --fix --max-warnings 0 --cache", + "format": "prettier '**/*.*(md|json|yaml|ts|js|tsx)' --check --cache --log-level=warn", + "format:fix": "prettier '**/*.*(md|json|yaml|ts|js|tsx)' --write --cache --log-level=warn", "test": "pnpm test:unit & pnpm run test:integration", "test:integration": "vitest -c ./vitest.config.integration.ts", "test:unit": "vitest", "test:unit:coverage": "vitest --coverage", "test:unit:silent:coverage": "SILENT_TESTS=true vitest --coverage", - "typecheck": "tsc --project tsconfig.json --noEmit" + "typecheck": "tsc --project tsconfig.json --noEmit --incremental" }, "dependencies": { "@apollo/client": "^3.11.8", diff --git a/packages/lib/tsconfig.json b/packages/lib/tsconfig.json index d3ed0aa0..4ecaae0b 100644 --- a/packages/lib/tsconfig.json +++ b/packages/lib/tsconfig.json @@ -10,5 +10,5 @@ "tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json" }, "include": ["**/*.ts", "**/*.tsx", "global.d.ts"], - "exclude": ["node_modules"] + "exclude": ["node_modules", "**/generated/**"] } diff --git a/packages/prettier-config/package.json b/packages/prettier-config/package.json index 7df3e2f3..d93fb130 100644 --- a/packages/prettier-config/package.json +++ b/packages/prettier-config/package.json @@ -10,7 +10,7 @@ "scripts": { "lint": "eslint .", "lint:fix": "eslint . --fix", - "format": "prettier '**/*.*(md|json|yaml|ts|js|tsx)' --check --cache --cache-location='node_modules/.cache/.prettiercache' --log-level=warn", - "format:fix": "prettier '**/*.*(md|json|yaml|ts|js|tsx)' --write --cache --cache-location='node_modules/.cache/.prettiercache' --log-level=warn" + "format": "prettier '**/*.*(md|json|yaml|ts|js|tsx)' --check --cache --log-level=warn", + "format:fix": "prettier '**/*.*(md|json|yaml|ts|js|tsx)' --write --cache --log-level=warn" } } diff --git a/packages/typescript-config/package.json b/packages/typescript-config/package.json index dbfcada9..ca4b2e6b 100644 --- a/packages/typescript-config/package.json +++ b/packages/typescript-config/package.json @@ -7,7 +7,7 @@ "access": "public" }, "scripts": { - "format": "prettier '**/*.*(md|json|yaml|ts|js|tsx)' --check --cache --cache-location='node_modules/.cache/.prettiercache' --log-level=warn", - "format:fix": "prettier '**/*.*(md|json|yaml|ts|js|tsx)' --write --cache --cache-location='node_modules/.cache/.prettiercache' --log-level=warn" + "format": "prettier '**/*.*(md|json|yaml|ts|js|tsx)' --check --cache --log-level=warn", + "format:fix": "prettier '**/*.*(md|json|yaml|ts|js|tsx)' --write --cache --log-level=warn" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5799f092..29ba10aa 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14992,7 +14992,7 @@ snapshots: pump: 3.0.2 readable-stream: 3.6.2 socket.io-client: 4.7.5(bufferutil@4.0.8)(utf-8-validate@5.0.10) - tslib: 2.8.0 + tslib: 2.8.1 util: 0.12.5 uuid: 8.3.2 transitivePeerDependencies: @@ -19288,7 +19288,7 @@ snapshots: debug: 4.3.7 enhanced-resolve: 5.17.1 eslint: 8.43.0 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.17.0(eslint@8.43.0)(typescript@5.3.3))(eslint-import-resolver-typescript@3.6.1)(eslint@8.43.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.17.0(eslint@8.43.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.43.0) eslint-plugin-import: 2.29.0(@typescript-eslint/parser@7.1.0(eslint@8.43.0)(typescript@5.3.3))(eslint@8.43.0) fast-glob: 3.3.2 get-tsconfig: 4.7.2 @@ -19300,12 +19300,13 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-module-utils@2.8.0(@typescript-eslint/parser@6.17.0(eslint@8.43.0)(typescript@5.3.3))(eslint-import-resolver-typescript@3.6.1)(eslint@8.43.0): + eslint-module-utils@2.8.0(@typescript-eslint/parser@6.17.0(eslint@8.43.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.43.0): dependencies: debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 6.17.0(eslint@8.43.0)(typescript@5.3.3) eslint: 8.43.0 + eslint-import-resolver-node: 0.3.9 eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.17.0(eslint@8.43.0)(typescript@5.3.3))(eslint-plugin-import@2.29.0)(eslint@8.43.0) transitivePeerDependencies: - supports-color diff --git a/turbo.json b/turbo.json index 9d26ff04..bf6971da 100644 --- a/turbo.json +++ b/turbo.json @@ -12,7 +12,8 @@ "PRIVATE_CURRENCYAPI_KEY", "VITEST_POOL_ID", "NODE_ENV", - "SILENT_TESTS" + "SILENT_TESTS", + "NEXT_RUNTIME" ], "tasks": { "dev": {