From f4aaf78661792cbd5aae185e7eaebce0af13cc44 Mon Sep 17 00:00:00 2001 From: caushcani Date: Sat, 14 Dec 2024 16:52:23 +0100 Subject: [PATCH 01/18] test lint-staged --- .eslintrc.json | 1 + .husky/pre-commit | 1 + apps/frontend/.eslintrc.json | 6 +- .../analytics/analytics.component.tsx | 1 + lint-staged.config.js | 10 + package-lock.json | 727 +++++++++++++++++- package.json | 5 +- 7 files changed, 743 insertions(+), 8 deletions(-) create mode 100644 .husky/pre-commit create mode 100644 lint-staged.config.js diff --git a/.eslintrc.json b/.eslintrc.json index 974b88a75..42b2ece93 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -6,6 +6,7 @@ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], "rules": { + "no-unused-vars": ["warn", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }] } }, { diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 000000000..efd7a14d4 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npx lint-staged --concurrent false --relative \ No newline at end of file diff --git a/apps/frontend/.eslintrc.json b/apps/frontend/.eslintrc.json index 6cfcf667c..7e8bfc15b 100644 --- a/apps/frontend/.eslintrc.json +++ b/apps/frontend/.eslintrc.json @@ -11,7 +11,11 @@ "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], "rules": { "@next/next/no-html-link-for-pages": ["error", "apps/frontend/pages"], - "no-extra-boolean-cast": "off" + "no-extra-boolean-cast": "off", + "no-unused-vars": [ + "warn", + { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" } + ] } }, { diff --git a/apps/frontend/src/components/analytics/analytics.component.tsx b/apps/frontend/src/components/analytics/analytics.component.tsx index 932bd4aca..d2a00afb9 100644 --- a/apps/frontend/src/components/analytics/analytics.component.tsx +++ b/apps/frontend/src/components/analytics/analytics.component.tsx @@ -9,6 +9,7 @@ import { LoadingComponent } from '@gitroom/frontend/components/layout/loading'; export const AnalyticsComponent: FC = () => { const fetch = useFetch(); + const unusedVar = ''; const load = useCallback(async (path: string) => { return await (await fetch(path)).json(); diff --git a/lint-staged.config.js b/lint-staged.config.js new file mode 100644 index 000000000..87be6736e --- /dev/null +++ b/lint-staged.config.js @@ -0,0 +1,10 @@ +module.exports = { + '{apps,libraries}/**/*.{ts,tsx}': (files) => { + return `nx affected --target=typecheck --files=${files.join(',')}`; + }, + '{apps,libraries}/**/*.{js,ts,jsx,tsx,json}': [ + (files) => `nx affected:lint --files=${files.join(',')}`, + (files) => `nx format:write --files=${files.join(',')}`, + ], + }; + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 4dbabad0c..aaf61b249 100644 --- a/package-lock.json +++ b/package-lock.json @@ -164,10 +164,12 @@ "eslint-plugin-jsx-a11y": "6.7.1", "eslint-plugin-react": "7.32.2", "eslint-plugin-react-hooks": "4.6.0", + "husky": "^9.1.7", "jest": "29.7.0", "jest-environment-jsdom": "29.7.0", "jest-environment-node": "^29.4.1", "jsdom": "~22.1.0", + "lint-staged": "^15.2.11", "postcss": "8.4.38", "prettier": "^2.6.2", "prisma": "^5.8.1", @@ -16515,6 +16517,77 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/cli-truncate": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-4.0.0.tgz", + "integrity": "sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==", + "dev": true, + "license": "MIT", + "dependencies": { + "slice-ansi": "^5.0.0", + "string-width": "^7.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/cli-truncate/node_modules/emoji-regex": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", + "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", + "dev": true, + "license": "MIT" + }, + "node_modules/cli-truncate/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/client-only": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", @@ -17911,9 +17984,9 @@ "license": "MIT" }, "node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "license": "MIT", "dependencies": { "ms": "^2.1.3" @@ -18663,6 +18736,19 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, + "node_modules/environment": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", + "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/errno": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", @@ -21340,6 +21426,19 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/get-east-asian-width": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.3.0.tgz", + "integrity": "sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-func-name": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", @@ -22970,6 +23069,22 @@ "ms": "^2.0.0" } }, + "node_modules/husky": { + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", + "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", + "dev": true, + "license": "MIT", + "bin": { + "husky": "bin.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, "node_modules/hyperdyperid": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/hyperdyperid/-/hyperdyperid-1.2.0.tgz", @@ -25999,9 +26114,9 @@ } }, "node_modules/lilconfig": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.2.tgz", - "integrity": "sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", + "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", "license": "MIT", "engines": { "node": ">=14" @@ -26019,6 +26134,311 @@ "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, + "node_modules/lint-staged": { + "version": "15.2.11", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.11.tgz", + "integrity": "sha512-Ev6ivCTYRTGs9ychvpVw35m/bcNDuBN+mnTeObCL5h+boS5WzBEC6LHI4I9F/++sZm1m+J2LEiy0gxL/R9TBqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "~5.3.0", + "commander": "~12.1.0", + "debug": "~4.4.0", + "execa": "~8.0.1", + "lilconfig": "~3.1.3", + "listr2": "~8.2.5", + "micromatch": "~4.0.8", + "pidtree": "~0.6.0", + "string-argv": "~0.3.2", + "yaml": "~2.6.1" + }, + "bin": { + "lint-staged": "bin/lint-staged.js" + }, + "engines": { + "node": ">=18.12.0" + }, + "funding": { + "url": "https://opencollective.com/lint-staged" + } + }, + "node_modules/lint-staged/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/lint-staged/node_modules/commander": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/lint-staged/node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/lint-staged/node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lint-staged/node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=16.17.0" + } + }, + "node_modules/lint-staged/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lint-staged/node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lint-staged/node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lint-staged/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lint-staged/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lint-staged/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/lint-staged/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/listr2": { + "version": "8.2.5", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.2.5.tgz", + "integrity": "sha512-iyAZCeyD+c1gPyE9qpFu8af0Y+MRtmKOncdGoA2S5EY8iFq99dmmvkNnHiWo+pj0s7yH7l3KPIgee77tKpXPWQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "cli-truncate": "^4.0.0", + "colorette": "^2.0.20", + "eventemitter3": "^5.0.1", + "log-update": "^6.1.0", + "rfdc": "^1.4.1", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/listr2/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/listr2/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/listr2/node_modules/emoji-regex": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", + "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", + "dev": true, + "license": "MIT" + }, + "node_modules/listr2/node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "dev": true, + "license": "MIT" + }, + "node_modules/listr2/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/listr2/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/listr2/node_modules/wrap-ansi": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz", + "integrity": "sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/loader-runner": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", @@ -26200,6 +26620,222 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/log-update": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz", + "integrity": "sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escapes": "^7.0.0", + "cli-cursor": "^5.0.0", + "slice-ansi": "^7.1.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/ansi-escapes": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.0.0.tgz", + "integrity": "sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "environment": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/log-update/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/log-update/node_modules/cli-cursor": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", + "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/emoji-regex": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", + "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", + "dev": true, + "license": "MIT" + }, + "node_modules/log-update/node_modules/is-fullwidth-code-point": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.0.0.tgz", + "integrity": "sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-east-asian-width": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/onetime": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", + "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-function": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/restore-cursor": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", + "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^7.0.0", + "signal-exit": "^4.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/log-update/node_modules/slice-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.0.tgz", + "integrity": "sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "is-fullwidth-code-point": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/log-update/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/log-update/node_modules/wrap-ansi": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz", + "integrity": "sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/log4js": { "version": "6.9.1", "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.9.1.tgz", @@ -30217,6 +30853,19 @@ "node": ">=6" } }, + "node_modules/mimic-function": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", + "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/mimic-response": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", @@ -31933,6 +32582,19 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pidtree": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.6.0.tgz", + "integrity": "sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==", + "dev": true, + "license": "MIT", + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", @@ -36421,6 +37083,49 @@ "integrity": "sha512-FOyLWWVjG+aC0UqG76V53yAWdXfH8bO6FNmyZOuUrzDzK8DI3/JRY25UD7+g49JWM1LXwymsKERB+DzI0dTEQA==", "license": "MIT" }, + "node_modules/slice-ansi": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", + "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.0.0", + "is-fullwidth-code-point": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", + "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/snake-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", @@ -36740,6 +37445,16 @@ "safe-buffer": "~5.2.0" } }, + "node_modules/string-argv": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", + "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.6.19" + } + }, "node_modules/string-length": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", diff --git a/package.json b/package.json index 853bf6186..eec6af746 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ "prisma-reset": "cd ./libraries/nestjs-libraries/src/database/prisma && npx prisma db push --force-reset && npx prisma db push", "docker-build": "./var/docker/docker-build.sh", "docker-create": "./var/docker/docker-create.sh", - "postinstall": "npm run update-plugins && npm run prisma-generate" + "postinstall": "npm run update-plugins && npm run prisma-generate", + "prepare": "husky" }, "private": true, "dependencies": { @@ -186,10 +187,12 @@ "eslint-plugin-jsx-a11y": "6.7.1", "eslint-plugin-react": "7.32.2", "eslint-plugin-react-hooks": "4.6.0", + "husky": "^9.1.7", "jest": "29.7.0", "jest-environment-jsdom": "29.7.0", "jest-environment-node": "^29.4.1", "jsdom": "~22.1.0", + "lint-staged": "^15.2.11", "postcss": "8.4.38", "prettier": "^2.6.2", "prisma": "^5.8.1", From 633033790176b5412839e965b19ddffbb0c45e5c Mon Sep 17 00:00:00 2001 From: caushcani Date: Sat, 14 Dec 2024 16:53:27 +0100 Subject: [PATCH 02/18] test --- tsconfig.base.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tsconfig.base.json b/tsconfig.base.json index caf8b5df4..024427463 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -25,9 +25,9 @@ "@gitroom/frontend/*": ["apps/frontend/src/*"], "@gitroom/helpers/*": ["libraries/helpers/src/*"], "@gitroom/nestjs-libraries/*": ["libraries/nestjs-libraries/src/*"], - "@gitroom/react/*": ["libraries/react-shared-libraries/src/*"], "@gitroom/plugins/*": ["libraries/plugins/src/*"], - "@gitroom/workers/*": ["apps/workers/src/*"], + "@gitroom/react/*": ["libraries/react-shared-libraries/src/*"], + "@gitroom/workers/*": ["apps/workers/src/*"] } }, "exclude": ["node_modules", "tmp"] From aea2ada8cd3b00fcb2486aefd86263538febfdd8 Mon Sep 17 00:00:00 2001 From: caushcani Date: Sat, 14 Dec 2024 17:04:25 +0100 Subject: [PATCH 03/18] add unused var 2 --- apps/frontend/src/components/analytics/analytics.component.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/frontend/src/components/analytics/analytics.component.tsx b/apps/frontend/src/components/analytics/analytics.component.tsx index d2a00afb9..5d46aa0b2 100644 --- a/apps/frontend/src/components/analytics/analytics.component.tsx +++ b/apps/frontend/src/components/analytics/analytics.component.tsx @@ -10,6 +10,7 @@ import { LoadingComponent } from '@gitroom/frontend/components/layout/loading'; export const AnalyticsComponent: FC = () => { const fetch = useFetch(); const unusedVar = ''; + const unusedVar2 = ''; const load = useCallback(async (path: string) => { return await (await fetch(path)).json(); From e5add1b64c1c09013de53e2d0862c72224826931 Mon Sep 17 00:00:00 2001 From: caushcani Date: Sat, 14 Dec 2024 17:13:26 +0100 Subject: [PATCH 04/18] test list-staged again --- .lintstagedrc.json | 1 + apps/frontend/.lintstagedrc.json | 3 +++ lint-staged.config.js | 10 ---------- 3 files changed, 4 insertions(+), 10 deletions(-) create mode 100644 .lintstagedrc.json create mode 100644 apps/frontend/.lintstagedrc.json delete mode 100644 lint-staged.config.js diff --git a/.lintstagedrc.json b/.lintstagedrc.json new file mode 100644 index 000000000..0967ef424 --- /dev/null +++ b/.lintstagedrc.json @@ -0,0 +1 @@ +{} diff --git a/apps/frontend/.lintstagedrc.json b/apps/frontend/.lintstagedrc.json new file mode 100644 index 000000000..a4f7da45e --- /dev/null +++ b/apps/frontend/.lintstagedrc.json @@ -0,0 +1,3 @@ +{ + ".tsx":["eslint --fix"] +} diff --git a/lint-staged.config.js b/lint-staged.config.js deleted file mode 100644 index 87be6736e..000000000 --- a/lint-staged.config.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - '{apps,libraries}/**/*.{ts,tsx}': (files) => { - return `nx affected --target=typecheck --files=${files.join(',')}`; - }, - '{apps,libraries}/**/*.{js,ts,jsx,tsx,json}': [ - (files) => `nx affected:lint --files=${files.join(',')}`, - (files) => `nx format:write --files=${files.join(',')}`, - ], - }; - \ No newline at end of file From dea7a23f3658c0ff09f9dceedec712f325973544 Mon Sep 17 00:00:00 2001 From: caushcani Date: Sat, 14 Dec 2024 17:13:58 +0100 Subject: [PATCH 05/18] add lintstagedrc --- .lintstagedrc.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.lintstagedrc.json b/.lintstagedrc.json index 0967ef424..a4f7da45e 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1 +1,3 @@ -{} +{ + ".tsx":["eslint --fix"] +} From 9f44b2d474f97cebd7b5ad7ad58ce7926c456587 Mon Sep 17 00:00:00 2001 From: caushcani Date: Sat, 14 Dec 2024 17:47:59 +0100 Subject: [PATCH 06/18] test again husky --- .eslintrc.json | 4 ++-- .husky/pre-commit | 3 +++ apps/frontend/.eslintrc.json | 4 ++-- .../src/components/analytics/analytics.component.tsx | 4 ++-- .../src/components/settings/github.component.tsx | 5 ++--- package.json | 9 ++++++++- 6 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 42b2ece93..a74ad7d0e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -6,7 +6,7 @@ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], "rules": { - "no-unused-vars": ["warn", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }] + "@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }] } }, { @@ -14,7 +14,7 @@ "extends": ["plugin:@nx/typescript"], "rules": { "@typescript-eslint/no-non-null-asserted-optional-chain": "off", - "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-explicit-any": 1, "@typescript-eslint/ban-ts-comment": "off", "react/display-name": "off" } diff --git a/.husky/pre-commit b/.husky/pre-commit index efd7a14d4..0fd4fc139 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + npx lint-staged --concurrent false --relative \ No newline at end of file diff --git a/apps/frontend/.eslintrc.json b/apps/frontend/.eslintrc.json index 7e8bfc15b..0f0a7b2e9 100644 --- a/apps/frontend/.eslintrc.json +++ b/apps/frontend/.eslintrc.json @@ -12,8 +12,8 @@ "rules": { "@next/next/no-html-link-for-pages": ["error", "apps/frontend/pages"], "no-extra-boolean-cast": "off", - "no-unused-vars": [ - "warn", + "@typescript-eslint/no-unused-vars": [ + "error", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" } ] } diff --git a/apps/frontend/src/components/analytics/analytics.component.tsx b/apps/frontend/src/components/analytics/analytics.component.tsx index 5d46aa0b2..182a46608 100644 --- a/apps/frontend/src/components/analytics/analytics.component.tsx +++ b/apps/frontend/src/components/analytics/analytics.component.tsx @@ -9,8 +9,8 @@ import { LoadingComponent } from '@gitroom/frontend/components/layout/loading'; export const AnalyticsComponent: FC = () => { const fetch = useFetch(); - const unusedVar = ''; - const unusedVar2 = ''; + let unusedVar = ''; + let unusedVar2 = ''; const load = useCallback(async (path: string) => { return await (await fetch(path)).json(); diff --git a/apps/frontend/src/components/settings/github.component.tsx b/apps/frontend/src/components/settings/github.component.tsx index 7cfff859c..4c07dc61a 100644 --- a/apps/frontend/src/components/settings/github.component.tsx +++ b/apps/frontend/src/components/settings/github.component.tsx @@ -77,10 +77,9 @@ const ConnectComponent: FC<{ if (response.status === 404) { toast.show('Repository not found', 'warning'); - return ; + return; } - setConnected(`${select}/${repo}`); }, [url]); @@ -138,7 +137,7 @@ export const GithubComponent: FC<{ const connect = useCallback(async () => { const { url } = await (await fetch('/settings/github/url')).json(); - window.open(url, "Github Connect", "width=700,height=700"); + window.open(url, 'Github Connect', 'width=700,height=700'); }, []); const setConnected = useCallback( diff --git a/package.json b/package.json index eec6af746..873d75c4b 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,8 @@ "docker-build": "./var/docker/docker-build.sh", "docker-create": "./var/docker/docker-create.sh", "postinstall": "npm run update-plugins && npm run prisma-generate", - "prepare": "husky" + "prepare": "husky", + "lint":"nx lint --project=frontend" }, "private": true, "dependencies": { @@ -206,5 +207,11 @@ }, "volta": { "node": "20.17.0" + }, + "lint-staged": { + "(apps)/**/*.{js,ts,jsx,tsx}": [ + "prettier --write", + "eslint --fix" + ] } } From 5d926b09ef64cba9e0a426dce2a093de50f20b6b Mon Sep 17 00:00:00 2001 From: caushcani Date: Sat, 14 Dec 2024 17:49:10 +0100 Subject: [PATCH 07/18] husky test --- .../frontend/src/components/analytics/analytics.component.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/frontend/src/components/analytics/analytics.component.tsx b/apps/frontend/src/components/analytics/analytics.component.tsx index 182a46608..5da2e1496 100644 --- a/apps/frontend/src/components/analytics/analytics.component.tsx +++ b/apps/frontend/src/components/analytics/analytics.component.tsx @@ -9,8 +9,8 @@ import { LoadingComponent } from '@gitroom/frontend/components/layout/loading'; export const AnalyticsComponent: FC = () => { const fetch = useFetch(); - let unusedVar = ''; - let unusedVar2 = ''; + const unusedVar = 'dsfwe'; + const unusedVar2 = ''; const load = useCallback(async (path: string) => { return await (await fetch(path)).json(); From 2d910309be401d4eb9e94753ce784d44978f4b51 Mon Sep 17 00:00:00 2001 From: caushcani Date: Sat, 14 Dec 2024 17:50:49 +0100 Subject: [PATCH 08/18] test --- .husky/pre-commit | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 0fd4fc139..d0a778429 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -npx lint-staged --concurrent false --relative \ No newline at end of file +npx lint-staged \ No newline at end of file From ca9c45f2b06506fe7cfbf9334b817d2c0329934e Mon Sep 17 00:00:00 2001 From: caushcani Date: Sat, 14 Dec 2024 17:53:44 +0100 Subject: [PATCH 09/18] test again staged files --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 873d75c4b..fac63ca49 100644 --- a/package.json +++ b/package.json @@ -209,7 +209,7 @@ "node": "20.17.0" }, "lint-staged": { - "(apps)/**/*.{js,ts,jsx,tsx}": [ + "apps/**/*.{js,ts,jsx,tsx}": [ "prettier --write", "eslint --fix" ] From 989feda5b95c409fca361dda7e3d7ba64c513378 Mon Sep 17 00:00:00 2001 From: caushcani Date: Sat, 14 Dec 2024 17:54:09 +0100 Subject: [PATCH 10/18] test again staged files 2 --- apps/frontend/src/components/analytics/analytics.component.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/frontend/src/components/analytics/analytics.component.tsx b/apps/frontend/src/components/analytics/analytics.component.tsx index 5da2e1496..f54b1d77f 100644 --- a/apps/frontend/src/components/analytics/analytics.component.tsx +++ b/apps/frontend/src/components/analytics/analytics.component.tsx @@ -10,7 +10,7 @@ import { LoadingComponent } from '@gitroom/frontend/components/layout/loading'; export const AnalyticsComponent: FC = () => { const fetch = useFetch(); const unusedVar = 'dsfwe'; - const unusedVar2 = ''; + const unusedVar2 = 'dewd'; const load = useCallback(async (path: string) => { return await (await fetch(path)).json(); From fa047e59d8232dc765e3ed8eabb63d4a256123ff Mon Sep 17 00:00:00 2001 From: caushcani Date: Sat, 14 Dec 2024 17:56:44 +0100 Subject: [PATCH 11/18] test again staged files 3 --- apps/frontend/src/components/analytics/analytics.component.tsx | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/frontend/src/components/analytics/analytics.component.tsx b/apps/frontend/src/components/analytics/analytics.component.tsx index f54b1d77f..85f9e038e 100644 --- a/apps/frontend/src/components/analytics/analytics.component.tsx +++ b/apps/frontend/src/components/analytics/analytics.component.tsx @@ -10,7 +10,7 @@ import { LoadingComponent } from '@gitroom/frontend/components/layout/loading'; export const AnalyticsComponent: FC = () => { const fetch = useFetch(); const unusedVar = 'dsfwe'; - const unusedVar2 = 'dewd'; + const unusedVar2 = 'dewfefed'; const load = useCallback(async (path: string) => { return await (await fetch(path)).json(); diff --git a/package.json b/package.json index fac63ca49..d97448ee1 100644 --- a/package.json +++ b/package.json @@ -209,7 +209,7 @@ "node": "20.17.0" }, "lint-staged": { - "apps/**/*.{js,ts,jsx,tsx}": [ + "./apps/**/*.{js,ts,jsx,tsx}": [ "prettier --write", "eslint --fix" ] From adaa3e2b89d1934f590dd5e0d6a3e17880b40f56 Mon Sep 17 00:00:00 2001 From: caushcani Date: Sat, 14 Dec 2024 18:04:45 +0100 Subject: [PATCH 12/18] test again staged files 4 --- apps/frontend/src/components/analytics/analytics.component.tsx | 1 - package.json | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/frontend/src/components/analytics/analytics.component.tsx b/apps/frontend/src/components/analytics/analytics.component.tsx index 85f9e038e..1aff6d7f0 100644 --- a/apps/frontend/src/components/analytics/analytics.component.tsx +++ b/apps/frontend/src/components/analytics/analytics.component.tsx @@ -10,7 +10,6 @@ import { LoadingComponent } from '@gitroom/frontend/components/layout/loading'; export const AnalyticsComponent: FC = () => { const fetch = useFetch(); const unusedVar = 'dsfwe'; - const unusedVar2 = 'dewfefed'; const load = useCallback(async (path: string) => { return await (await fetch(path)).json(); diff --git a/package.json b/package.json index d97448ee1..534ebaa48 100644 --- a/package.json +++ b/package.json @@ -209,7 +209,7 @@ "node": "20.17.0" }, "lint-staged": { - "./apps/**/*.{js,ts,jsx,tsx}": [ + "**/*.{js,ts,jsx,tsx}": [ "prettier --write", "eslint --fix" ] From 976ba34393c55314c8ac765bee01c01d5c436835 Mon Sep 17 00:00:00 2001 From: caushcani Date: Sat, 14 Dec 2024 19:58:32 +0100 Subject: [PATCH 13/18] now should work --- apps/frontend/.eslintrc.json | 2 +- apps/frontend/.lintstagedrc | 3 +++ apps/frontend/.lintstagedrc.json | 3 --- apps/frontend/src/components/analytics/analytics.component.tsx | 1 - 4 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 apps/frontend/.lintstagedrc delete mode 100644 apps/frontend/.lintstagedrc.json diff --git a/apps/frontend/.eslintrc.json b/apps/frontend/.eslintrc.json index 0f0a7b2e9..d2b7aa470 100644 --- a/apps/frontend/.eslintrc.json +++ b/apps/frontend/.eslintrc.json @@ -14,7 +14,7 @@ "no-extra-boolean-cast": "off", "@typescript-eslint/no-unused-vars": [ "error", - { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" } + { "caughtErrors": "all" } ] } }, diff --git a/apps/frontend/.lintstagedrc b/apps/frontend/.lintstagedrc new file mode 100644 index 000000000..03f98ae7c --- /dev/null +++ b/apps/frontend/.lintstagedrc @@ -0,0 +1,3 @@ +{ + "*.tsx":["eslint", "prettier --write"] +} diff --git a/apps/frontend/.lintstagedrc.json b/apps/frontend/.lintstagedrc.json deleted file mode 100644 index a4f7da45e..000000000 --- a/apps/frontend/.lintstagedrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - ".tsx":["eslint --fix"] -} diff --git a/apps/frontend/src/components/analytics/analytics.component.tsx b/apps/frontend/src/components/analytics/analytics.component.tsx index 1aff6d7f0..932bd4aca 100644 --- a/apps/frontend/src/components/analytics/analytics.component.tsx +++ b/apps/frontend/src/components/analytics/analytics.component.tsx @@ -9,7 +9,6 @@ import { LoadingComponent } from '@gitroom/frontend/components/layout/loading'; export const AnalyticsComponent: FC = () => { const fetch = useFetch(); - const unusedVar = 'dsfwe'; const load = useCallback(async (path: string) => { return await (await fetch(path)).json(); From 87e8a92cbad7b225f023fb332f0ccfe4aa5dd021 Mon Sep 17 00:00:00 2001 From: caushcani Date: Sat, 14 Dec 2024 20:23:47 +0100 Subject: [PATCH 14/18] add lintstaged to all packages --- apps/backend/.lintstagedrc | 3 +++ apps/commands/.lintstagedrc | 3 +++ apps/cron/.lintstagedrc | 3 +++ apps/frontend/.lintstagedrc | 2 +- apps/workers/.lintstagedrc | 3 +++ 5 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 apps/backend/.lintstagedrc create mode 100644 apps/commands/.lintstagedrc create mode 100644 apps/cron/.lintstagedrc create mode 100644 apps/workers/.lintstagedrc diff --git a/apps/backend/.lintstagedrc b/apps/backend/.lintstagedrc new file mode 100644 index 000000000..5004938f4 --- /dev/null +++ b/apps/backend/.lintstagedrc @@ -0,0 +1,3 @@ +{ + "*.tsx,*.jsx":["eslint", "prettier --write"] +} diff --git a/apps/commands/.lintstagedrc b/apps/commands/.lintstagedrc new file mode 100644 index 000000000..5004938f4 --- /dev/null +++ b/apps/commands/.lintstagedrc @@ -0,0 +1,3 @@ +{ + "*.tsx,*.jsx":["eslint", "prettier --write"] +} diff --git a/apps/cron/.lintstagedrc b/apps/cron/.lintstagedrc new file mode 100644 index 000000000..5004938f4 --- /dev/null +++ b/apps/cron/.lintstagedrc @@ -0,0 +1,3 @@ +{ + "*.tsx,*.jsx":["eslint", "prettier --write"] +} diff --git a/apps/frontend/.lintstagedrc b/apps/frontend/.lintstagedrc index 03f98ae7c..5004938f4 100644 --- a/apps/frontend/.lintstagedrc +++ b/apps/frontend/.lintstagedrc @@ -1,3 +1,3 @@ { - "*.tsx":["eslint", "prettier --write"] + "*.tsx,*.jsx":["eslint", "prettier --write"] } diff --git a/apps/workers/.lintstagedrc b/apps/workers/.lintstagedrc new file mode 100644 index 000000000..5004938f4 --- /dev/null +++ b/apps/workers/.lintstagedrc @@ -0,0 +1,3 @@ +{ + "*.tsx,*.jsx":["eslint", "prettier --write"] +} From 3210e3d3d00475025b17620cf82847f602e40679 Mon Sep 17 00:00:00 2001 From: caushcani Date: Sat, 14 Dec 2024 20:24:49 +0100 Subject: [PATCH 15/18] test --- apps/frontend/src/app/(site)/analytics/page.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/frontend/src/app/(site)/analytics/page.tsx b/apps/frontend/src/app/(site)/analytics/page.tsx index 951f8bdb5..0aaf06d77 100644 --- a/apps/frontend/src/app/(site)/analytics/page.tsx +++ b/apps/frontend/src/app/(site)/analytics/page.tsx @@ -10,6 +10,8 @@ export const metadata: Metadata = { description: '', }; +const a = ''; + export default async function Index() { return ( <> From 5f37153931f6efca4adc75155f392e2cfe40db5e Mon Sep 17 00:00:00 2001 From: caushcani Date: Sat, 14 Dec 2024 20:31:21 +0100 Subject: [PATCH 16/18] should commit now --- .lintstagedrc.json | 8 ++++++-- apps/backend/.eslintrc.json | 7 ++++++- apps/backend/.lintstagedrc | 5 ++++- apps/cron/.lintstagedrc | 8 ++++++-- apps/frontend/.lintstagedrc | 5 ++++- apps/frontend/src/app/(site)/analytics/page.tsx | 2 -- apps/workers/.lintstagedrc | 8 ++++++-- 7 files changed, 32 insertions(+), 11 deletions(-) diff --git a/.lintstagedrc.json b/.lintstagedrc.json index a4f7da45e..41aef3b06 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,3 +1,7 @@ { - ".tsx":["eslint --fix"] -} + "*.tsx": ["eslint", "prettier --write"], + "*.ts": ["eslint", "prettier --write"], + "*.js": ["eslint", "prettier --write"], + "*.jsx": ["eslint", "prettier --write"] + } + \ No newline at end of file diff --git a/apps/backend/.eslintrc.json b/apps/backend/.eslintrc.json index 9d9c0db55..bfee90e81 100644 --- a/apps/backend/.eslintrc.json +++ b/apps/backend/.eslintrc.json @@ -4,7 +4,12 @@ "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": {} + "rules": { + "@typescript-eslint/no-unused-vars": [ + "error", + { "caughtErrors": "all" } + ] + } }, { "files": ["*.ts", "*.tsx"], diff --git a/apps/backend/.lintstagedrc b/apps/backend/.lintstagedrc index 5004938f4..9f8760e7f 100644 --- a/apps/backend/.lintstagedrc +++ b/apps/backend/.lintstagedrc @@ -1,3 +1,6 @@ { - "*.tsx,*.jsx":["eslint", "prettier --write"] + "*.tsx": ["eslint", "prettier --write"], + "*.ts": ["eslint", "prettier --write"], + "*.js": ["eslint", "prettier --write"], + "*.jsx": ["eslint", "prettier --write"] } diff --git a/apps/cron/.lintstagedrc b/apps/cron/.lintstagedrc index 5004938f4..41aef3b06 100644 --- a/apps/cron/.lintstagedrc +++ b/apps/cron/.lintstagedrc @@ -1,3 +1,7 @@ { - "*.tsx,*.jsx":["eslint", "prettier --write"] -} + "*.tsx": ["eslint", "prettier --write"], + "*.ts": ["eslint", "prettier --write"], + "*.js": ["eslint", "prettier --write"], + "*.jsx": ["eslint", "prettier --write"] + } + \ No newline at end of file diff --git a/apps/frontend/.lintstagedrc b/apps/frontend/.lintstagedrc index 5004938f4..9f8760e7f 100644 --- a/apps/frontend/.lintstagedrc +++ b/apps/frontend/.lintstagedrc @@ -1,3 +1,6 @@ { - "*.tsx,*.jsx":["eslint", "prettier --write"] + "*.tsx": ["eslint", "prettier --write"], + "*.ts": ["eslint", "prettier --write"], + "*.js": ["eslint", "prettier --write"], + "*.jsx": ["eslint", "prettier --write"] } diff --git a/apps/frontend/src/app/(site)/analytics/page.tsx b/apps/frontend/src/app/(site)/analytics/page.tsx index 0aaf06d77..951f8bdb5 100644 --- a/apps/frontend/src/app/(site)/analytics/page.tsx +++ b/apps/frontend/src/app/(site)/analytics/page.tsx @@ -10,8 +10,6 @@ export const metadata: Metadata = { description: '', }; -const a = ''; - export default async function Index() { return ( <> diff --git a/apps/workers/.lintstagedrc b/apps/workers/.lintstagedrc index 5004938f4..41aef3b06 100644 --- a/apps/workers/.lintstagedrc +++ b/apps/workers/.lintstagedrc @@ -1,3 +1,7 @@ { - "*.tsx,*.jsx":["eslint", "prettier --write"] -} + "*.tsx": ["eslint", "prettier --write"], + "*.ts": ["eslint", "prettier --write"], + "*.js": ["eslint", "prettier --write"], + "*.jsx": ["eslint", "prettier --write"] + } + \ No newline at end of file From 9f3ddf20a551c138fae71b1d7e7df9ab4470ec86 Mon Sep 17 00:00:00 2001 From: caushcani Date: Sun, 15 Dec 2024 17:15:55 +0100 Subject: [PATCH 17/18] remove lint command from scripts --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 534ebaa48..a118f08a4 100644 --- a/package.json +++ b/package.json @@ -29,8 +29,7 @@ "docker-build": "./var/docker/docker-build.sh", "docker-create": "./var/docker/docker-create.sh", "postinstall": "npm run update-plugins && npm run prisma-generate", - "prepare": "husky", - "lint":"nx lint --project=frontend" + "prepare": "husky" }, "private": true, "dependencies": { From 43b1f24e5d62f7cb0c52516ff4ac6f5a29b4ed41 Mon Sep 17 00:00:00 2001 From: caushcani Date: Sat, 14 Dec 2024 16:53:27 +0100 Subject: [PATCH 18/18] remove lint command from scripts --- .eslintrc.json | 4 ++-- .husky/pre-commit | 2 +- .lintstagedrc.json | 7 +++++++ apps/backend/.eslintrc.json | 7 ++++++- apps/backend/.lintstagedrc | 6 ++++++ apps/commands/.lintstagedrc | 3 +++ apps/cron/.lintstagedrc | 7 +++++++ apps/frontend/.eslintrc.json | 6 +++--- apps/frontend/.lintstagedrc | 6 ++++++ .../src/components/analytics/analytics.component.tsx | 1 - .../src/components/settings/github.component.tsx | 5 ++--- apps/workers/.lintstagedrc | 7 +++++++ lint-staged.config.js | 10 ---------- package.json | 6 ++++++ tsconfig.base.json | 4 ++-- 15 files changed, 58 insertions(+), 23 deletions(-) create mode 100644 .lintstagedrc.json create mode 100644 apps/backend/.lintstagedrc create mode 100644 apps/commands/.lintstagedrc create mode 100644 apps/cron/.lintstagedrc create mode 100644 apps/frontend/.lintstagedrc create mode 100644 apps/workers/.lintstagedrc delete mode 100644 lint-staged.config.js diff --git a/.eslintrc.json b/.eslintrc.json index 42b2ece93..a74ad7d0e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -6,7 +6,7 @@ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], "rules": { - "no-unused-vars": ["warn", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }] + "@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }] } }, { @@ -14,7 +14,7 @@ "extends": ["plugin:@nx/typescript"], "rules": { "@typescript-eslint/no-non-null-asserted-optional-chain": "off", - "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-explicit-any": 1, "@typescript-eslint/ban-ts-comment": "off", "react/display-name": "off" } diff --git a/.husky/pre-commit b/.husky/pre-commit index efd7a14d4..d0a778429 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1 @@ -npx lint-staged --concurrent false --relative \ No newline at end of file +npx lint-staged \ No newline at end of file diff --git a/.lintstagedrc.json b/.lintstagedrc.json new file mode 100644 index 000000000..41aef3b06 --- /dev/null +++ b/.lintstagedrc.json @@ -0,0 +1,7 @@ +{ + "*.tsx": ["eslint", "prettier --write"], + "*.ts": ["eslint", "prettier --write"], + "*.js": ["eslint", "prettier --write"], + "*.jsx": ["eslint", "prettier --write"] + } + \ No newline at end of file diff --git a/apps/backend/.eslintrc.json b/apps/backend/.eslintrc.json index 9d9c0db55..bfee90e81 100644 --- a/apps/backend/.eslintrc.json +++ b/apps/backend/.eslintrc.json @@ -4,7 +4,12 @@ "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": {} + "rules": { + "@typescript-eslint/no-unused-vars": [ + "error", + { "caughtErrors": "all" } + ] + } }, { "files": ["*.ts", "*.tsx"], diff --git a/apps/backend/.lintstagedrc b/apps/backend/.lintstagedrc new file mode 100644 index 000000000..9f8760e7f --- /dev/null +++ b/apps/backend/.lintstagedrc @@ -0,0 +1,6 @@ +{ + "*.tsx": ["eslint", "prettier --write"], + "*.ts": ["eslint", "prettier --write"], + "*.js": ["eslint", "prettier --write"], + "*.jsx": ["eslint", "prettier --write"] +} diff --git a/apps/commands/.lintstagedrc b/apps/commands/.lintstagedrc new file mode 100644 index 000000000..5004938f4 --- /dev/null +++ b/apps/commands/.lintstagedrc @@ -0,0 +1,3 @@ +{ + "*.tsx,*.jsx":["eslint", "prettier --write"] +} diff --git a/apps/cron/.lintstagedrc b/apps/cron/.lintstagedrc new file mode 100644 index 000000000..41aef3b06 --- /dev/null +++ b/apps/cron/.lintstagedrc @@ -0,0 +1,7 @@ +{ + "*.tsx": ["eslint", "prettier --write"], + "*.ts": ["eslint", "prettier --write"], + "*.js": ["eslint", "prettier --write"], + "*.jsx": ["eslint", "prettier --write"] + } + \ No newline at end of file diff --git a/apps/frontend/.eslintrc.json b/apps/frontend/.eslintrc.json index 7e8bfc15b..d2b7aa470 100644 --- a/apps/frontend/.eslintrc.json +++ b/apps/frontend/.eslintrc.json @@ -12,9 +12,9 @@ "rules": { "@next/next/no-html-link-for-pages": ["error", "apps/frontend/pages"], "no-extra-boolean-cast": "off", - "no-unused-vars": [ - "warn", - { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" } + "@typescript-eslint/no-unused-vars": [ + "error", + { "caughtErrors": "all" } ] } }, diff --git a/apps/frontend/.lintstagedrc b/apps/frontend/.lintstagedrc new file mode 100644 index 000000000..9f8760e7f --- /dev/null +++ b/apps/frontend/.lintstagedrc @@ -0,0 +1,6 @@ +{ + "*.tsx": ["eslint", "prettier --write"], + "*.ts": ["eslint", "prettier --write"], + "*.js": ["eslint", "prettier --write"], + "*.jsx": ["eslint", "prettier --write"] +} diff --git a/apps/frontend/src/components/analytics/analytics.component.tsx b/apps/frontend/src/components/analytics/analytics.component.tsx index d2a00afb9..932bd4aca 100644 --- a/apps/frontend/src/components/analytics/analytics.component.tsx +++ b/apps/frontend/src/components/analytics/analytics.component.tsx @@ -9,7 +9,6 @@ import { LoadingComponent } from '@gitroom/frontend/components/layout/loading'; export const AnalyticsComponent: FC = () => { const fetch = useFetch(); - const unusedVar = ''; const load = useCallback(async (path: string) => { return await (await fetch(path)).json(); diff --git a/apps/frontend/src/components/settings/github.component.tsx b/apps/frontend/src/components/settings/github.component.tsx index 7cfff859c..4c07dc61a 100644 --- a/apps/frontend/src/components/settings/github.component.tsx +++ b/apps/frontend/src/components/settings/github.component.tsx @@ -77,10 +77,9 @@ const ConnectComponent: FC<{ if (response.status === 404) { toast.show('Repository not found', 'warning'); - return ; + return; } - setConnected(`${select}/${repo}`); }, [url]); @@ -138,7 +137,7 @@ export const GithubComponent: FC<{ const connect = useCallback(async () => { const { url } = await (await fetch('/settings/github/url')).json(); - window.open(url, "Github Connect", "width=700,height=700"); + window.open(url, 'Github Connect', 'width=700,height=700'); }, []); const setConnected = useCallback( diff --git a/apps/workers/.lintstagedrc b/apps/workers/.lintstagedrc new file mode 100644 index 000000000..41aef3b06 --- /dev/null +++ b/apps/workers/.lintstagedrc @@ -0,0 +1,7 @@ +{ + "*.tsx": ["eslint", "prettier --write"], + "*.ts": ["eslint", "prettier --write"], + "*.js": ["eslint", "prettier --write"], + "*.jsx": ["eslint", "prettier --write"] + } + \ No newline at end of file diff --git a/lint-staged.config.js b/lint-staged.config.js deleted file mode 100644 index 87be6736e..000000000 --- a/lint-staged.config.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - '{apps,libraries}/**/*.{ts,tsx}': (files) => { - return `nx affected --target=typecheck --files=${files.join(',')}`; - }, - '{apps,libraries}/**/*.{js,ts,jsx,tsx,json}': [ - (files) => `nx affected:lint --files=${files.join(',')}`, - (files) => `nx format:write --files=${files.join(',')}`, - ], - }; - \ No newline at end of file diff --git a/package.json b/package.json index eec6af746..a118f08a4 100644 --- a/package.json +++ b/package.json @@ -206,5 +206,11 @@ }, "volta": { "node": "20.17.0" + }, + "lint-staged": { + "**/*.{js,ts,jsx,tsx}": [ + "prettier --write", + "eslint --fix" + ] } } diff --git a/tsconfig.base.json b/tsconfig.base.json index caf8b5df4..024427463 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -25,9 +25,9 @@ "@gitroom/frontend/*": ["apps/frontend/src/*"], "@gitroom/helpers/*": ["libraries/helpers/src/*"], "@gitroom/nestjs-libraries/*": ["libraries/nestjs-libraries/src/*"], - "@gitroom/react/*": ["libraries/react-shared-libraries/src/*"], "@gitroom/plugins/*": ["libraries/plugins/src/*"], - "@gitroom/workers/*": ["apps/workers/src/*"], + "@gitroom/react/*": ["libraries/react-shared-libraries/src/*"], + "@gitroom/workers/*": ["apps/workers/src/*"] } }, "exclude": ["node_modules", "tmp"]