diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 30e1b8975..1548c7c1a 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -5,5 +5,43 @@ module.exports = { "plugin:react/jsx-runtime", "@electron-toolkit/eslint-config-ts/recommended", "@electron-toolkit/eslint-config-prettier", + "plugin:tailwindcss/recommended", + "plugin:react-hooks/recommended", ], + settings: { + "import/resolver": { + node: { extensions: [".js", ".mjs", ".ts", ".d.ts"] }, + }, + tailwindcss: { + callees: ["clsx", "cn"], + whitelist: [], + }, + react: { + version: "detect", + }, + }, + plugins: ["unused-imports"], + rules: { + "import/named": "off", + "import/no-anonymous-default-export": "off", + "import/no-named-as-default": "off", + "react/react-in-jsx-scope": "off", + "react-hooks/exhaustive-deps": + process.env.NODE_ENV === "production" ? "off" : "warn", + "import/no-named-as-default-member": "off", + "@typescript-eslint/explicit-function-return-type": "off", + "react/prop-types": "off", + + "@typescript-eslint/no-unused-vars": "off", + "unused-imports/no-unused-imports": "error", + "unused-imports/no-unused-vars": [ + "warn", + { + vars: "all", + varsIgnorePattern: "^_", + args: "after-used", + argsIgnorePattern: "^_", + }, + ], + }, } diff --git a/.vscode/settings.json b/.vscode/settings.json index 4c05394ec..c3f81d8e5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,5 +7,11 @@ }, "[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" - } + }, + "eslint.codeActionsOnSave.rules": [ + "!prefer-const", + "!unused-imports/no-unused-imports", + "!tailwindcss/classnames-order", + "*" + ] } diff --git a/package.json b/package.json index ed1552720..83a71dbe3 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,10 @@ "author": "example.com", "homepage": "https://electron-vite.org", "lint-staged": { - "**/*": "prettier --write --ignore-unknown" + "**/*": "prettier --write --ignore-unknown", + "*.{js,jsx,ts,tsx}": [ + "eslint --cache --fix" + ] }, "scripts": { "format": "prettier --write .", @@ -23,7 +26,10 @@ "build:win": "npm run build && electron-builder --win", "build:mac": "electron-vite build && electron-builder --mac", "build:linux": "electron-vite build && electron-builder --linux", - "prepare": "husky" + "prepare": "pnpm exec simple-git-hooks && test -f .env || cp .env.example .env" + }, + "simple-git-hooks": { + "pre-commit": "pnpm exec lint-staged" }, "dependencies": { "@egoist/tipc": "0.3.1", @@ -88,13 +94,17 @@ "electron": "^30.0.6", "electron-builder": "^24.9.1", "electron-vite": "^2.2.0", - "eslint": "^9.3.0", + "eslint": "^8", "eslint-plugin-react": "^7.33.2", + "eslint-plugin-react-hooks": "4.6.2", + "eslint-plugin-tailwindcss": "3.15.1", + "eslint-plugin-unused-imports": "4.0.0", "husky": "9.0.11", "lint-staged": "15.2.2", "prettier": "^3.2.4", "react": "^18.3.1", "react-dom": "^18.3.1", + "simple-git-hooks": "2.11.1", "tailwindcss": "3.4.3", "typescript": "^5.4.5", "vite": "^5.2.11" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 587d026a9..4908f3b42 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -155,10 +155,10 @@ importers: version: 1.8.0(tailwindcss@3.4.3) '@electron-toolkit/eslint-config-prettier': specifier: ^2.0.0 - version: 2.0.0(eslint@9.3.0)(prettier@3.2.5) + version: 2.0.0(eslint@8.57.0)(prettier@3.2.5) '@electron-toolkit/eslint-config-ts': specifier: ^2.0.0 - version: 2.0.0(eslint@9.3.0)(typescript@5.4.5) + version: 2.0.0(eslint@8.57.0)(typescript@5.4.5) '@electron-toolkit/tsconfig': specifier: ^1.0.1 version: 1.0.1(@types/node@20.12.12) @@ -190,11 +190,20 @@ importers: specifier: ^2.2.0 version: 2.2.0(vite@5.2.11(@types/node@20.12.12)) eslint: - specifier: ^9.3.0 - version: 9.3.0 + specifier: ^8 + version: 8.57.0 eslint-plugin-react: specifier: ^7.33.2 - version: 7.34.1(eslint@9.3.0) + version: 7.34.1(eslint@8.57.0) + eslint-plugin-react-hooks: + specifier: 4.6.2 + version: 4.6.2(eslint@8.57.0) + eslint-plugin-tailwindcss: + specifier: 3.15.1 + version: 3.15.1(tailwindcss@3.4.3) + eslint-plugin-unused-imports: + specifier: 4.0.0 + version: 4.0.0(eslint@8.57.0) husky: specifier: 9.0.11 version: 9.0.11 @@ -210,6 +219,9 @@ importers: react-dom: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) + simple-git-hooks: + specifier: 2.11.1 + version: 2.11.1 tailwindcss: specifier: 3.4.3 version: 3.4.3 @@ -736,13 +748,13 @@ packages: resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - '@eslint/eslintrc@3.1.0': - resolution: {integrity: sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/eslintrc@2.1.4': + resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@eslint/js@9.3.0': - resolution: {integrity: sha512-niBqk8iwv96+yuTwjM6bWg8ovzAPF9qkICsGtcoa5/dmqcEMfdwNAX7+/OHcJHc7wj7XqPxH98oAHytFYlw6Sw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/js@8.57.0': + resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} '@floating-ui/core@1.6.0': resolution: {integrity: sha512-PcF++MykgmTj3CIyOQbKA/hDzOAiqI3mhuoN44WRCopIs1sgoDoU4oty4Jtqaj/y3oDU6fnVSm4QG0a3t5i0+g==} @@ -778,8 +790,8 @@ packages: peerDependencies: react-hook-form: ^7.0.0 - '@humanwhocodes/config-array@0.13.0': - resolution: {integrity: sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==} + '@humanwhocodes/config-array@0.11.14': + resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} '@humanwhocodes/module-importer@1.0.1': @@ -789,10 +801,6 @@ packages: '@humanwhocodes/object-schema@2.0.3': resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} - '@humanwhocodes/retry@0.3.0': - resolution: {integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==} - engines: {node: '>=18.18'} - '@iconify-json/mingcute@1.1.17': resolution: {integrity: sha512-WTKnn5OicUo18dE3rkJs00sUjOIAui8Ut9yZSXamRfjzmLxuX9FKqYQAbFXaV6lw0T4QwBQ8/y4ftaWl/1Entg==} @@ -1660,6 +1668,7 @@ packages: are-we-there-yet@3.0.1: resolution: {integrity: sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + deprecated: This package is no longer supported. arg@5.0.2: resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==} @@ -2141,6 +2150,10 @@ packages: resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} engines: {node: '>=0.10.0'} + doctrine@3.0.0: + resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} + engines: {node: '>=6.0.0'} + dotenv-expand@5.1.0: resolution: {integrity: sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==} @@ -2303,32 +2316,54 @@ packages: eslint-config-prettier: optional: true + eslint-plugin-react-hooks@4.6.2: + resolution: {integrity: sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ==} + engines: {node: '>=10'} + peerDependencies: + eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 + eslint-plugin-react@7.34.1: resolution: {integrity: sha512-N97CxlouPT1AHt8Jn0mhhN2RrADlUAsk1/atcT2KyA/l9Q/E6ll7OIGwNumFmWfZ9skV3XXccYS19h80rHtgkw==} engines: {node: '>=4'} peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 - eslint-scope@8.0.1: - resolution: {integrity: sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og==} + eslint-plugin-tailwindcss@3.15.1: + resolution: {integrity: sha512-4RXRMIaMG07C2TBEW1k0VM4+dDazz1kxcZhkK4zirvmHGZTA4jnlSO2kq5mamuSPi+Wo17dh2SlC8IyFBuCd7Q==} + engines: {node: '>=12.13.0'} + peerDependencies: + tailwindcss: ^3.4.0 + + eslint-plugin-unused-imports@4.0.0: + resolution: {integrity: sha512-mzM+y2B7XYpQryVa1usT+Y/BdNAtAZiXzwpSyDCboFoJN/LZRN67TNvQxKtuTK/Aplya3sLNQforiubzPPaIcQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + '@typescript-eslint/eslint-plugin': '8' + eslint: '9' + peerDependenciesMeta: + '@typescript-eslint/eslint-plugin': + optional: true + + eslint-rule-composer@0.3.0: + resolution: {integrity: sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==} + engines: {node: '>=4.0.0'} + + eslint-scope@7.2.2: + resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} eslint-visitor-keys@3.4.3: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - eslint-visitor-keys@4.0.0: - resolution: {integrity: sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - eslint@9.3.0: - resolution: {integrity: sha512-5Iv4CsZW030lpUqHBapdPo3MJetAPtejVW8B84GIcIIv8+ohFaddXsrn1Gn8uD9ijDb+kcYKFUVmC8qG8B2ORQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + eslint@8.57.0: + resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true - espree@10.0.1: - resolution: {integrity: sha512-MWkrWZbJsL2UwnjxTX3gG8FneachS/Mwg7tdGXce011sJd5b0JG54vat5KHnfSBODZ3Wvzd2WnjxyzsRoVv+ww==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + espree@9.6.1: + resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} esquery@1.5.0: resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} @@ -2397,9 +2432,9 @@ packages: fd-slicer@1.1.0: resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==} - file-entry-cache@8.0.0: - resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} - engines: {node: '>=16.0.0'} + file-entry-cache@6.0.1: + resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} + engines: {node: ^10.12.0 || >=12.0.0} filelist@1.0.4: resolution: {integrity: sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==} @@ -2412,9 +2447,9 @@ packages: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} - flat-cache@4.0.1: - resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} - engines: {node: '>=16'} + flat-cache@3.2.0: + resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} + engines: {node: ^10.12.0 || >=12.0.0} flatted@3.3.1: resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} @@ -2488,6 +2523,7 @@ packages: gauge@4.0.4: resolution: {integrity: sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + deprecated: This package is no longer supported. gensync@1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} @@ -2553,9 +2589,9 @@ packages: 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'} + globals@13.24.0: + resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} + engines: {node: '>=8'} globalthis@1.0.3: resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} @@ -3383,6 +3419,7 @@ packages: npmlog@6.0.2: resolution: {integrity: sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + deprecated: This package is no longer supported. nth-check@2.1.1: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} @@ -3892,6 +3929,10 @@ packages: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} + simple-git-hooks@2.11.1: + resolution: {integrity: sha512-tgqwPUMDcNDhuf1Xf6KTUsyeqGdgKMhzaH4PAZZuzguOgTl5uuyeYe/8mWgAr6IBxB5V06uqEf6Dy37gIWDtDg==} + hasBin: true + simple-update-notifier@2.0.0: resolution: {integrity: sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==} engines: {node: '>=10'} @@ -4125,6 +4166,10 @@ packages: resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} engines: {node: '>=10'} + type-fest@0.20.2: + resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} + engines: {node: '>=10'} + typed-array-buffer@1.0.2: resolution: {integrity: sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==} engines: {node: '>= 0.4'} @@ -4562,20 +4607,20 @@ snapshots: transitivePeerDependencies: - react - '@electron-toolkit/eslint-config-prettier@2.0.0(eslint@9.3.0)(prettier@3.2.5)': + '@electron-toolkit/eslint-config-prettier@2.0.0(eslint@8.57.0)(prettier@3.2.5)': dependencies: - eslint: 9.3.0 - eslint-config-prettier: 9.1.0(eslint@9.3.0) - eslint-plugin-prettier: 5.1.3(eslint-config-prettier@9.1.0(eslint@9.3.0))(eslint@9.3.0)(prettier@3.2.5) + eslint: 8.57.0 + eslint-config-prettier: 9.1.0(eslint@8.57.0) + eslint-plugin-prettier: 5.1.3(eslint-config-prettier@9.1.0(eslint@8.57.0))(eslint@8.57.0)(prettier@3.2.5) prettier: 3.2.5 transitivePeerDependencies: - '@types/eslint' - '@electron-toolkit/eslint-config-ts@2.0.0(eslint@9.3.0)(typescript@5.4.5)': + '@electron-toolkit/eslint-config-ts@2.0.0(eslint@8.57.0)(typescript@5.4.5)': dependencies: - '@typescript-eslint/eslint-plugin': 7.6.0(@typescript-eslint/parser@7.6.0(eslint@9.3.0)(typescript@5.4.5))(eslint@9.3.0)(typescript@5.4.5) - '@typescript-eslint/parser': 7.6.0(eslint@9.3.0)(typescript@5.4.5) - eslint: 9.3.0 + '@typescript-eslint/eslint-plugin': 7.6.0(@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/parser': 7.6.0(eslint@8.57.0)(typescript@5.4.5) + eslint: 8.57.0 optionalDependencies: typescript: 5.4.5 transitivePeerDependencies: @@ -4828,19 +4873,19 @@ snapshots: '@esbuild/win32-x64@0.20.2': optional: true - '@eslint-community/eslint-utils@4.4.0(eslint@9.3.0)': + '@eslint-community/eslint-utils@4.4.0(eslint@8.57.0)': dependencies: - eslint: 9.3.0 + eslint: 8.57.0 eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.10.0': {} - '@eslint/eslintrc@3.1.0': + '@eslint/eslintrc@2.1.4': dependencies: ajv: 6.12.6 debug: 4.3.4 - espree: 10.0.1 - globals: 14.0.0 + espree: 9.6.1 + globals: 13.24.0 ignore: 5.3.1 import-fresh: 3.3.0 js-yaml: 4.1.0 @@ -4849,7 +4894,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@9.3.0': {} + '@eslint/js@8.57.0': {} '@floating-ui/core@1.6.0': dependencies: @@ -4882,7 +4927,7 @@ snapshots: dependencies: react-hook-form: 7.51.4(react@18.3.1) - '@humanwhocodes/config-array@0.13.0': + '@humanwhocodes/config-array@0.11.14': dependencies: '@humanwhocodes/object-schema': 2.0.3 debug: 4.3.4 @@ -4894,8 +4939,6 @@ snapshots: '@humanwhocodes/object-schema@2.0.3': {} - '@humanwhocodes/retry@0.3.0': {} - '@iconify-json/mingcute@1.1.17': dependencies: '@iconify/types': 2.0.0 @@ -5635,16 +5678,16 @@ snapshots: '@types/node': 20.12.12 optional: true - '@typescript-eslint/eslint-plugin@7.6.0(@typescript-eslint/parser@7.6.0(eslint@9.3.0)(typescript@5.4.5))(eslint@9.3.0)(typescript@5.4.5)': + '@typescript-eslint/eslint-plugin@7.6.0(@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)': dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 7.6.0(eslint@9.3.0)(typescript@5.4.5) + '@typescript-eslint/parser': 7.6.0(eslint@8.57.0)(typescript@5.4.5) '@typescript-eslint/scope-manager': 7.6.0 - '@typescript-eslint/type-utils': 7.6.0(eslint@9.3.0)(typescript@5.4.5) - '@typescript-eslint/utils': 7.6.0(eslint@9.3.0)(typescript@5.4.5) + '@typescript-eslint/type-utils': 7.6.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/utils': 7.6.0(eslint@8.57.0)(typescript@5.4.5) '@typescript-eslint/visitor-keys': 7.6.0 debug: 4.3.4 - eslint: 9.3.0 + eslint: 8.57.0 graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 @@ -5655,14 +5698,14 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@7.6.0(eslint@9.3.0)(typescript@5.4.5)': + '@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.5)': dependencies: '@typescript-eslint/scope-manager': 7.6.0 '@typescript-eslint/types': 7.6.0 '@typescript-eslint/typescript-estree': 7.6.0(typescript@5.4.5) '@typescript-eslint/visitor-keys': 7.6.0 debug: 4.3.4 - eslint: 9.3.0 + eslint: 8.57.0 optionalDependencies: typescript: 5.4.5 transitivePeerDependencies: @@ -5673,12 +5716,12 @@ snapshots: '@typescript-eslint/types': 7.6.0 '@typescript-eslint/visitor-keys': 7.6.0 - '@typescript-eslint/type-utils@7.6.0(eslint@9.3.0)(typescript@5.4.5)': + '@typescript-eslint/type-utils@7.6.0(eslint@8.57.0)(typescript@5.4.5)': dependencies: '@typescript-eslint/typescript-estree': 7.6.0(typescript@5.4.5) - '@typescript-eslint/utils': 7.6.0(eslint@9.3.0)(typescript@5.4.5) + '@typescript-eslint/utils': 7.6.0(eslint@8.57.0)(typescript@5.4.5) debug: 4.3.4 - eslint: 9.3.0 + eslint: 8.57.0 ts-api-utils: 1.3.0(typescript@5.4.5) optionalDependencies: typescript: 5.4.5 @@ -5702,15 +5745,15 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@7.6.0(eslint@9.3.0)(typescript@5.4.5)': + '@typescript-eslint/utils@7.6.0(eslint@8.57.0)(typescript@5.4.5)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.3.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) '@types/json-schema': 7.0.15 '@types/semver': 7.5.8 '@typescript-eslint/scope-manager': 7.6.0 '@typescript-eslint/types': 7.6.0 '@typescript-eslint/typescript-estree': 7.6.0(typescript@5.4.5) - eslint: 9.3.0 + eslint: 8.57.0 semver: 7.6.0 transitivePeerDependencies: - supports-color @@ -6474,6 +6517,10 @@ snapshots: dependencies: esutils: 2.0.3 + doctrine@3.0.0: + dependencies: + esutils: 2.0.3 + dotenv-expand@5.1.0: {} dotenv@16.4.5: {} @@ -6751,20 +6798,24 @@ snapshots: escape-string-regexp@4.0.0: {} - eslint-config-prettier@9.1.0(eslint@9.3.0): + eslint-config-prettier@9.1.0(eslint@8.57.0): dependencies: - eslint: 9.3.0 + eslint: 8.57.0 - eslint-plugin-prettier@5.1.3(eslint-config-prettier@9.1.0(eslint@9.3.0))(eslint@9.3.0)(prettier@3.2.5): + eslint-plugin-prettier@5.1.3(eslint-config-prettier@9.1.0(eslint@8.57.0))(eslint@8.57.0)(prettier@3.2.5): dependencies: - eslint: 9.3.0 + eslint: 8.57.0 prettier: 3.2.5 prettier-linter-helpers: 1.0.0 synckit: 0.8.8 optionalDependencies: - eslint-config-prettier: 9.1.0(eslint@9.3.0) + eslint-config-prettier: 9.1.0(eslint@8.57.0) - eslint-plugin-react@7.34.1(eslint@9.3.0): + eslint-plugin-react-hooks@4.6.2(eslint@8.57.0): + dependencies: + eslint: 8.57.0 + + eslint-plugin-react@7.34.1(eslint@8.57.0): dependencies: array-includes: 3.1.8 array.prototype.findlast: 1.2.5 @@ -6773,7 +6824,7 @@ snapshots: array.prototype.tosorted: 1.1.3 doctrine: 2.1.0 es-iterator-helpers: 1.0.18 - eslint: 9.3.0 + eslint: 8.57.0 estraverse: 5.3.0 jsx-ast-utils: 3.3.5 minimatch: 3.1.2 @@ -6786,43 +6837,58 @@ snapshots: semver: 6.3.1 string.prototype.matchall: 4.0.11 - eslint-scope@8.0.1: + eslint-plugin-tailwindcss@3.15.1(tailwindcss@3.4.3): + dependencies: + fast-glob: 3.3.2 + postcss: 8.4.38 + tailwindcss: 3.4.3 + + eslint-plugin-unused-imports@4.0.0(eslint@8.57.0): + dependencies: + eslint: 8.57.0 + eslint-rule-composer: 0.3.0 + + eslint-rule-composer@0.3.0: {} + + eslint-scope@7.2.2: dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 eslint-visitor-keys@3.4.3: {} - eslint-visitor-keys@4.0.0: {} - - eslint@9.3.0: + eslint@8.57.0: dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.3.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) '@eslint-community/regexpp': 4.10.0 - '@eslint/eslintrc': 3.1.0 - '@eslint/js': 9.3.0 - '@humanwhocodes/config-array': 0.13.0 + '@eslint/eslintrc': 2.1.4 + '@eslint/js': 8.57.0 + '@humanwhocodes/config-array': 0.11.14 '@humanwhocodes/module-importer': 1.0.1 - '@humanwhocodes/retry': 0.3.0 '@nodelib/fs.walk': 1.2.8 + '@ungap/structured-clone': 1.2.0 ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 debug: 4.3.4 + doctrine: 3.0.0 escape-string-regexp: 4.0.0 - eslint-scope: 8.0.1 - eslint-visitor-keys: 4.0.0 - espree: 10.0.1 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 esquery: 1.5.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 - file-entry-cache: 8.0.0 + file-entry-cache: 6.0.1 find-up: 5.0.0 glob-parent: 6.0.2 + globals: 13.24.0 + graphemer: 1.4.0 ignore: 5.3.1 imurmurhash: 0.1.4 is-glob: 4.0.3 is-path-inside: 3.0.3 + js-yaml: 4.1.0 json-stable-stringify-without-jsonify: 1.0.1 levn: 0.4.1 lodash.merge: 4.6.2 @@ -6834,11 +6900,11 @@ snapshots: transitivePeerDependencies: - supports-color - espree@10.0.1: + espree@9.6.1: dependencies: acorn: 8.11.3 acorn-jsx: 5.3.2(acorn@8.11.3) - eslint-visitor-keys: 4.0.0 + eslint-visitor-keys: 3.4.3 esquery@1.5.0: dependencies: @@ -6921,9 +6987,9 @@ snapshots: dependencies: pend: 1.2.0 - file-entry-cache@8.0.0: + file-entry-cache@6.0.1: dependencies: - flat-cache: 4.0.1 + flat-cache: 3.2.0 filelist@1.0.4: dependencies: @@ -6938,10 +7004,11 @@ snapshots: locate-path: 6.0.0 path-exists: 4.0.0 - flat-cache@4.0.1: + flat-cache@3.2.0: dependencies: flatted: 3.3.1 keyv: 4.5.4 + rimraf: 3.0.2 flatted@3.3.1: {} @@ -7100,7 +7167,9 @@ snapshots: globals@11.12.0: {} - globals@14.0.0: {} + globals@13.24.0: + dependencies: + type-fest: 0.20.2 globalthis@1.0.3: dependencies: @@ -8705,6 +8774,8 @@ snapshots: signal-exit@4.1.0: {} + simple-git-hooks@2.11.1: {} + simple-update-notifier@2.0.0: dependencies: semver: 7.6.0 @@ -8988,6 +9059,8 @@ snapshots: type-fest@0.13.1: optional: true + type-fest@0.20.2: {} + typed-array-buffer@1.0.2: dependencies: call-bind: 1.0.7 diff --git a/src/main/window.ts b/src/main/window.ts index 7c5debb0f..0c6613bb7 100644 --- a/src/main/window.ts +++ b/src/main/window.ts @@ -1,4 +1,4 @@ -import { app, shell, BrowserWindow } from "electron" +import { shell, BrowserWindow } from "electron" import path from "path" import { is } from "@electron-toolkit/utils" import icon from "../../resources/icon.png?asset" @@ -61,7 +61,7 @@ export function createWindow(options?: { trueUrl = decodeURIComponent( details.url.replace( new RegExp( - `^${process.env["VITE_IMGPROXY_URL"]}/unsafe/\\d+x\\d+\/`, + `^${process.env["VITE_IMGPROXY_URL"]}/unsafe/\\d+x\\d+/`, ), "", ), diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index 29b9c0da6..487508224 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -4,7 +4,7 @@ function App() { return ( <>
diff --git a/src/renderer/src/components/entry-column/article-item.tsx b/src/renderer/src/components/entry-column/article-item.tsx index d4ada04eb..f6919b76a 100644 --- a/src/renderer/src/components/entry-column/article-item.tsx +++ b/src/renderer/src/components/entry-column/article-item.tsx @@ -5,10 +5,10 @@ import { FeedIcon } from "@renderer/components/feed-icon" export function ArticleItem({ entry }: { entry: EntriesResponse[number] }) { return ( -
+
-
-
+
+
{entry.feeds.title} · @@ -20,13 +20,13 @@ export function ArticleItem({ entry }: { entry: EntriesResponse[number] }) { .humanize()}
-
{entry.title}
-
{entry.description}
+
{entry.title}
+
{entry.description}
{entry.images?.[0] && ( setActiveEntry(null)}> -
-
{activeList?.name}
+
+
{activeList?.name}
{entries.data?.pages?.[0].total} Items
@@ -59,7 +59,7 @@ export function EntryColumn() { className={cn( activeList?.view && gridMode.includes(activeList.view) && - "grid gap-2 grid-cols-2 md:grid-cols-3 lg:grid-cols-4 px-2", + "grid grid-cols-2 gap-2 px-2 md:grid-cols-3 lg:grid-cols-4", )} > {page.data?.map((entry) => ( diff --git a/src/renderer/src/components/entry-column/item-wrapper.tsx b/src/renderer/src/components/entry-column/item-wrapper.tsx index c44931328..b98d17ccc 100644 --- a/src/renderer/src/components/entry-column/item-wrapper.tsx +++ b/src/renderer/src/components/entry-column/item-wrapper.tsx @@ -13,14 +13,13 @@ export function EntryItemWrapper({ children: React.ReactNode view?: number }) { - if (!entry?.url || view === undefined) return children - const { items } = useEntryActions({ view, entry, }) const { activeEntry, setActiveEntry } = useMainLayoutContext() + if (!entry?.url || view === undefined) return children return (
+
-
-
+
+
{entry.feeds.title} · diff --git a/src/renderer/src/components/entry-column/picture-item.tsx b/src/renderer/src/components/entry-column/picture-item.tsx index 802038e28..cf262e49e 100644 --- a/src/renderer/src/components/entry-column/picture-item.tsx +++ b/src/renderer/src/components/entry-column/picture-item.tsx @@ -12,7 +12,7 @@ export function PictureItem({ entry }: { entry: EntriesResponse[number] }) { ))}
-
-
{entry.title}
+
+
{entry.title}
{entry.feeds.title} diff --git a/src/renderer/src/components/entry-column/social-media-item.tsx b/src/renderer/src/components/entry-column/social-media-item.tsx index d2e6ebbf3..18e38be9f 100644 --- a/src/renderer/src/components/entry-column/social-media-item.tsx +++ b/src/renderer/src/components/entry-column/social-media-item.tsx @@ -5,10 +5,10 @@ import { FeedIcon } from "@renderer/components/feed-icon" export function SocialMediaItem({ entry }: { entry: EntriesResponse[number] }) { return ( -
+
-
+
{entry.author} · @@ -23,12 +23,12 @@ export function SocialMediaItem({ entry }: { entry: EntriesResponse[number] }) {
{entry.description}
-
+
{entry.images?.map((image) => (
-
-
{entry.title}
+
+
{entry.title}
{entry.author} diff --git a/src/renderer/src/components/entry-content/index.tsx b/src/renderer/src/components/entry-content/index.tsx index 5b35bb4c0..eb2725105 100644 --- a/src/renderer/src/components/entry-content/index.tsx +++ b/src/renderer/src/components/entry-content/index.tsx @@ -26,7 +26,7 @@ export function EntryContent({ entryId }: { entryId: ActiveEntry }) { <> -
+
{entry.data?.title}
-
+
{entry.data?.feeds?.title}
@@ -49,7 +50,7 @@ export function EntryContent({ entryId }: { entryId: ActiveEntry }) { new Date(entry.data?.publishedAt).toUTCString()}
-
+
{content}
diff --git a/src/renderer/src/components/entry-content/share.tsx b/src/renderer/src/components/entry-content/share.tsx index d6c80aa06..bfd800d4f 100644 --- a/src/renderer/src/components/entry-content/share.tsx +++ b/src/renderer/src/components/entry-content/share.tsx @@ -15,15 +15,14 @@ export function EntryShare({ view: number entry?: EntriesResponse[number] }) { - if (!entry?.url) return null - const { items } = useEntryActions({ view, entry, }) + if (!entry?.url) return null return ( -
+
{items .filter((item) => !item.disabled) @@ -31,13 +30,13 @@ export function EntryShare({
-
+
{views.map((item, index) => ( @@ -128,14 +128,14 @@ export function FeedColumn() { ))}
-
- +
+ {views.map((item, index) => (
- +
))}
diff --git a/src/renderer/src/components/feed-column/item.tsx b/src/renderer/src/components/feed-column/item.tsx index adc81dfba..cf8c16ec3 100644 --- a/src/renderer/src/components/feed-column/item.tsx +++ b/src/renderer/src/components/feed-column/item.tsx @@ -60,7 +60,7 @@ export function FeedItem({ duration: 3000, description: ( <> - Feed {variables.feeds.title}{" "} + Feed {variables.feeds.title}{" "} has been unfollowed. ), @@ -93,7 +93,7 @@ export function FeedItem({
- +
{feed.feeds.title}
{feed.feeds.errorAt && ( - + @@ -176,7 +176,7 @@ export function FeedItem({ - + @@ -188,7 +188,7 @@ export function FeedItem({ )}
{!!feed.unread && ( -
{feed.unread}
+
{feed.unread}
)} {!hideTitle && (
{view !== undefined && views[view].name}
-
+
{expansion ? ( - +
+ -
+
{feed.title} -
+
{feed.description}
-
+
{feed.url || docs}
diff --git a/src/renderer/src/components/follow/form.tsx b/src/renderer/src/components/follow/form.tsx index 7eb8f3519..ecb6137b0 100644 --- a/src/renderer/src/components/follow/form.tsx +++ b/src/renderer/src/components/follow/form.tsx @@ -100,7 +100,7 @@ export function FollowForm({ type }: { type: string }) {
{mutation.isSuccess && ( -
-
+
+
Found {mutation.data?.length || 0} feed {mutation.data?.length > 1 && "s"}
@@ -134,7 +134,7 @@ export function FollowForm({ type }: { type: string }) { {item.docs ? ( - + @@ -150,7 +150,8 @@ export function FollowForm({ type }: { type: string }) { key={entry.id} href={entry.url} target="_blank" - className="flex items-center gap-1 flex-col min-w-0 flex-1" + className="flex min-w-0 flex-1 flex-col items-center gap-1" + rel="noreferrer" > {entry.images?.[0] ? ( ) : ( -
+
{entry.title}
)} @@ -179,7 +180,7 @@ export function FollowForm({ type }: { type: string }) { )}
- + {item.subscriptionCount} {" "} Followers diff --git a/src/renderer/src/components/follow/import.tsx b/src/renderer/src/components/follow/import.tsx index d8d8d5105..79a3c2141 100644 --- a/src/renderer/src/components/follow/import.tsx +++ b/src/renderer/src/components/follow/import.tsx @@ -16,6 +16,7 @@ import { Card, CardContent, CardHeader } from "@renderer/components/ui/card" import { FollowSummary } from "../feed-summary" import { apiFetch } from "@renderer/lib/queries/api-fetch" import { cn } from "@renderer/lib/utils" +import type { FeedResponse } from "@renderer/lib/types" type FeedResponseList = { id: string @@ -85,7 +86,7 @@ export function FollowImport() {
{mutation.isSuccess && ( -
+
- + {mutation.data?.successfulItems.length || 0} {" "} @@ -134,7 +135,7 @@ export function FollowImport() { {list.map((item) => (
{item.title}
@@ -142,8 +143,8 @@ export function FollowImport() { {!mutation.data?.[item.key].length && (
No items
)} - {mutation.data?.[item.key].map((feed) => ( - + {mutation.data?.[item.key].map((feed: FeedResponse) => ( + ))}
diff --git a/src/renderer/src/components/follow/recommendations.tsx b/src/renderer/src/components/follow/recommendations.tsx index 812610115..0d6810af9 100644 --- a/src/renderer/src/components/follow/recommendations.tsx +++ b/src/renderer/src/components/follow/recommendations.tsx @@ -1,7 +1,7 @@ export function Recommendations({ type }: { type: string }) { return (
-
Suggested
+
Suggested
  • Suggestions1
  • Suggestions2
  • diff --git a/src/renderer/src/components/site-icon.tsx b/src/renderer/src/components/site-icon.tsx index 395a3477e..7f495ff2b 100644 --- a/src/renderer/src/components/site-icon.tsx +++ b/src/renderer/src/components/site-icon.tsx @@ -27,7 +27,7 @@ export function SiteIcon({ return ( { if (fallback) { diff --git a/src/renderer/src/components/ui/autocomplete.tsx b/src/renderer/src/components/ui/autocomplete.tsx index 1ad05c6df..0cc0b64cb 100644 --- a/src/renderer/src/components/ui/autocomplete.tsx +++ b/src/renderer/src/components/ui/autocomplete.tsx @@ -41,7 +41,7 @@ export const AutoComplete = React.forwardRef( ) return ( - + { @@ -62,7 +62,7 @@ export const AutoComplete = React.forwardRef(