From 821702b33a3830cb07d33296a95b9fe51f7f403c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 19 Apr 2024 07:23:09 +0000 Subject: [PATCH 1/4] Update dependency eslint to v9 --- package.json | 2 +- pnpm-lock.yaml | 238 ++++++++++++++++++++++++------------------------- 2 files changed, 117 insertions(+), 123 deletions(-) diff --git a/package.json b/package.json index 2d4af8aa..6f7b7d59 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "@typescript-eslint/eslint-plugin": "7.7.0", "@typescript-eslint/parser": "7.7.0", "autoprefixer": "10.4.19", - "eslint": "8.57.0", + "eslint": "9.0.0", "eslint-plugin": "^1.0.1", "eslint-plugin-astro": "0.34.0", "postcss": "8.4.38", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ec9e5b56..d15a9730 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -38,7 +38,7 @@ importers: devDependencies: '@igorkowalczyk/eslint-config': specifier: 2.2.0 - version: 2.2.0(@typescript-eslint/parser@7.7.0(eslint@8.57.0)(typescript@5.3.3))(eslint@8.57.0)(prettier@3.2.5) + version: 2.2.0(@typescript-eslint/parser@7.7.0(eslint@9.0.0)(typescript@5.3.3))(eslint@9.0.0)(prettier@3.2.5) '@igorkowalczyk/prettier-config': specifier: 2.2.0 version: 2.2.0(prettier@3.2.5) @@ -47,22 +47,22 @@ importers: version: 0.5.7(tailwindcss@3.4.3) '@typescript-eslint/eslint-plugin': specifier: 7.7.0 - version: 7.7.0(@typescript-eslint/parser@7.7.0(eslint@8.57.0)(typescript@5.3.3))(eslint@8.57.0)(typescript@5.3.3) + version: 7.7.0(@typescript-eslint/parser@7.7.0(eslint@9.0.0)(typescript@5.3.3))(eslint@9.0.0)(typescript@5.3.3) '@typescript-eslint/parser': specifier: 7.7.0 - version: 7.7.0(eslint@8.57.0)(typescript@5.3.3) + version: 7.7.0(eslint@9.0.0)(typescript@5.3.3) autoprefixer: specifier: 10.4.19 version: 10.4.19(postcss@8.4.38) eslint: - specifier: 8.57.0 - version: 8.57.0 + specifier: 9.0.0 + version: 9.0.0 eslint-plugin: specifier: ^1.0.1 version: 1.0.1 eslint-plugin-astro: specifier: 0.34.0 - version: 0.34.0(eslint@8.57.0)(typescript@5.3.3) + version: 0.34.0(eslint@9.0.0)(typescript@5.3.3) postcss: specifier: 8.4.38 version: 8.4.38 @@ -370,28 +370,28 @@ packages: resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - '@eslint/eslintrc@2.1.4': - resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + '@eslint/eslintrc@3.0.2': + resolution: {integrity: sha512-wV19ZEGEMAC1eHgrS7UQPqsdEiCIbTKTasEfcXAigzoXICcqZSjBZEHlZwNVvKg6UBCjSlos84XiLqsRJnIcIg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/js@8.55.0': resolution: {integrity: sha512-qQfo2mxH5yVom1kacMtZZJFVdW+E70mqHMJvVg6WTLo+VBuQJ4TojZlfWBjK0ve5BdEeNAVxOsl/nvNMpJOaJA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.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} + '@eslint/js@9.0.0': + resolution: {integrity: sha512-RThY/MnKrhubF6+s1JflwUjPEsnCEmYCWwqa/aRISKWNXGZ9epUwft4bUMM35SdKF9xvBrLydAM1RDHd1Z//ZQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@humanwhocodes/config-array@0.11.14': - resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} + '@humanwhocodes/config-array@0.12.3': + resolution: {integrity: sha512-jsNnTBlMWuTpDkeE3on7+dWJi0D6fdDfeANj/w7MpS8ztROCoLvIO2nG0CcFj+E4k8j4QrSTh4Oryi3i2G669g==} engines: {node: '>=10.10.0'} '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} - '@humanwhocodes/object-schema@2.0.2': - resolution: {integrity: sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==} + '@humanwhocodes/object-schema@2.0.3': + resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} '@igorkowalczyk/eslint-config@2.2.0': resolution: {integrity: sha512-s4y/t4qLMQMQAo2GuBDRzmGXLNNTHInIAFWtB66wBFKXBMsxT0ntqbIyxfWbvOGNOrODZCO+jAbWX1rPCAYmww==} @@ -651,6 +651,11 @@ packages: engines: {node: '>=0.4.0'} hasBin: true + acorn@8.11.3: + resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} + engines: {node: '>=0.4.0'} + hasBin: true + ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} @@ -1028,10 +1033,6 @@ 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'} - dset@3.1.3: resolution: {integrity: sha512-20TuZZHCEZ2O71q9/+8BwKwZ0QtD9D8ObhrihJPr+vLLYlSuAU3/zL4cSlgbfeoGHTjCSJBa7NGcrF9/Bx/WJQ==} engines: {node: '>=4'} @@ -1161,19 +1162,27 @@ packages: resolution: {integrity: sha512-ervp8C09On0fLA258TvE08AqAr/bhRYgHVZd3BrJjD4JfOA2JGANDLGs06j51oWqfPd7Feoo3OoqHD+fuI2sFQ==} engines: {node: '>=0.10.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-scope@8.0.1: + resolution: {integrity: sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.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@8.57.0: - resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} - 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.0.0: + resolution: {integrity: sha512-IMryZ5SudxzQvuod6rUdIUz29qFItWx281VhtFVc2Psy/ZhlCeD/5DT6lBIJ4H3G+iamGJoTln1v+QSuPw0p7Q==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.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} @@ -1250,9 +1259,9 @@ packages: fastq@1.15.0: resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==} - file-entry-cache@6.0.1: - resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} - engines: {node: ^10.12.0 || >=12.0.0} + file-entry-cache@8.0.0: + resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} + engines: {node: '>=16.0.0'} fill-range@7.0.1: resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} @@ -1269,9 +1278,9 @@ packages: find-yarn-workspace-root2@1.2.16: resolution: {integrity: sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA==} - flat-cache@3.2.0: - resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} - engines: {node: ^10.12.0 || >=12.0.0} + flat-cache@4.0.1: + resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} + engines: {node: '>=16'} flatted@3.2.9: resolution: {integrity: sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==} @@ -1350,9 +1359,6 @@ packages: glob@7.1.6: resolution: {integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==} - glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - globals@11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} @@ -1361,6 +1367,10 @@ packages: resolution: {integrity: sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==} engines: {node: '>=8'} + globals@14.0.0: + resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} + engines: {node: '>=18'} + globalthis@1.0.3: resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} engines: {node: '>= 0.4'} @@ -1466,10 +1476,6 @@ packages: ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - ignore@5.3.0: - resolution: {integrity: sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==} - engines: {node: '>= 4'} - ignore@5.3.1: resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} engines: {node: '>= 4'} @@ -2320,10 +2326,6 @@ packages: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - hasBin: true - rollup@4.6.1: resolution: {integrity: sha512-jZHaZotEHQaHLgKr8JnQiDT1rmatjgKlMekyksz+yk9jt/8z9quNjnKNRoaM0wd9DC2QKXjmWWuDYtM3jfF8pQ==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -3111,19 +3113,19 @@ snapshots: '@esbuild/win32-x64@0.19.8': optional: true - '@eslint-community/eslint-utils@4.4.0(eslint@8.57.0)': + '@eslint-community/eslint-utils@4.4.0(eslint@9.0.0)': dependencies: - eslint: 8.57.0 + eslint: 9.0.0 eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.10.0': {} - '@eslint/eslintrc@2.1.4': + '@eslint/eslintrc@3.0.2': dependencies: ajv: 6.12.6 debug: 4.3.4 - espree: 9.6.1 - globals: 13.23.0 + espree: 10.0.1 + globals: 14.0.0 ignore: 5.3.1 import-fresh: 3.3.0 js-yaml: 4.1.0 @@ -3134,11 +3136,11 @@ snapshots: '@eslint/js@8.55.0': {} - '@eslint/js@8.57.0': {} + '@eslint/js@9.0.0': {} - '@humanwhocodes/config-array@0.11.14': + '@humanwhocodes/config-array@0.12.3': dependencies: - '@humanwhocodes/object-schema': 2.0.2 + '@humanwhocodes/object-schema': 2.0.3 debug: 4.3.4 minimatch: 3.1.2 transitivePeerDependencies: @@ -3146,14 +3148,14 @@ snapshots: '@humanwhocodes/module-importer@1.0.1': {} - '@humanwhocodes/object-schema@2.0.2': {} + '@humanwhocodes/object-schema@2.0.3': {} - '@igorkowalczyk/eslint-config@2.2.0(@typescript-eslint/parser@7.7.0(eslint@8.57.0)(typescript@5.3.3))(eslint@8.57.0)(prettier@3.2.5)': + '@igorkowalczyk/eslint-config@2.2.0(@typescript-eslint/parser@7.7.0(eslint@9.0.0)(typescript@5.3.3))(eslint@9.0.0)(prettier@3.2.5)': dependencies: '@eslint/js': 8.55.0 - eslint: 8.57.0 - eslint-plugin-import: 2.29.0(@typescript-eslint/parser@7.7.0(eslint@8.57.0)(typescript@5.3.3))(eslint@8.57.0) - eslint-plugin-prettier: 5.0.1(eslint@8.57.0)(prettier@3.2.5) + eslint: 9.0.0 + eslint-plugin-import: 2.29.0(@typescript-eslint/parser@7.7.0(eslint@9.0.0)(typescript@5.3.3))(eslint@9.0.0) + eslint-plugin-prettier: 5.0.1(eslint@9.0.0)(prettier@3.2.5) globals: 13.23.0 transitivePeerDependencies: - '@types/eslint' @@ -3306,16 +3308,16 @@ snapshots: '@types/unist@3.0.2': {} - '@typescript-eslint/eslint-plugin@7.7.0(@typescript-eslint/parser@7.7.0(eslint@8.57.0)(typescript@5.3.3))(eslint@8.57.0)(typescript@5.3.3)': + '@typescript-eslint/eslint-plugin@7.7.0(@typescript-eslint/parser@7.7.0(eslint@9.0.0)(typescript@5.3.3))(eslint@9.0.0)(typescript@5.3.3)': dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 7.7.0(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/parser': 7.7.0(eslint@9.0.0)(typescript@5.3.3) '@typescript-eslint/scope-manager': 7.7.0 - '@typescript-eslint/type-utils': 7.7.0(eslint@8.57.0)(typescript@5.3.3) - '@typescript-eslint/utils': 7.7.0(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/type-utils': 7.7.0(eslint@9.0.0)(typescript@5.3.3) + '@typescript-eslint/utils': 7.7.0(eslint@9.0.0)(typescript@5.3.3) '@typescript-eslint/visitor-keys': 7.7.0 debug: 4.3.4 - eslint: 8.57.0 + eslint: 9.0.0 graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 @@ -3326,14 +3328,14 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@7.7.0(eslint@8.57.0)(typescript@5.3.3)': + '@typescript-eslint/parser@7.7.0(eslint@9.0.0)(typescript@5.3.3)': dependencies: '@typescript-eslint/scope-manager': 7.7.0 '@typescript-eslint/types': 7.7.0 '@typescript-eslint/typescript-estree': 7.7.0(typescript@5.3.3) '@typescript-eslint/visitor-keys': 7.7.0 debug: 4.3.4 - eslint: 8.57.0 + eslint: 9.0.0 optionalDependencies: typescript: 5.3.3 transitivePeerDependencies: @@ -3349,12 +3351,12 @@ snapshots: '@typescript-eslint/types': 7.7.0 '@typescript-eslint/visitor-keys': 7.7.0 - '@typescript-eslint/type-utils@7.7.0(eslint@8.57.0)(typescript@5.3.3)': + '@typescript-eslint/type-utils@7.7.0(eslint@9.0.0)(typescript@5.3.3)': dependencies: '@typescript-eslint/typescript-estree': 7.7.0(typescript@5.3.3) - '@typescript-eslint/utils': 7.7.0(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/utils': 7.7.0(eslint@9.0.0)(typescript@5.3.3) debug: 4.3.4 - eslint: 8.57.0 + eslint: 9.0.0 ts-api-utils: 1.3.0(typescript@5.3.3) optionalDependencies: typescript: 5.3.3 @@ -3394,15 +3396,15 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@7.7.0(eslint@8.57.0)(typescript@5.3.3)': + '@typescript-eslint/utils@7.7.0(eslint@9.0.0)(typescript@5.3.3)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.0.0) '@types/json-schema': 7.0.15 '@types/semver': 7.5.8 '@typescript-eslint/scope-manager': 7.7.0 '@typescript-eslint/types': 7.7.0 '@typescript-eslint/typescript-estree': 7.7.0(typescript@5.3.3) - eslint: 8.57.0 + eslint: 9.0.0 semver: 7.6.0 transitivePeerDependencies: - supports-color @@ -3424,8 +3426,14 @@ snapshots: dependencies: acorn: 8.11.2 + acorn-jsx@5.3.2(acorn@8.11.3): + dependencies: + acorn: 8.11.3 + acorn@8.11.2: {} + acorn@8.11.3: {} + ajv@6.12.6: dependencies: fast-deep-equal: 3.1.3 @@ -3901,10 +3909,6 @@ snapshots: dependencies: esutils: 2.0.3 - doctrine@3.0.0: - dependencies: - esutils: 2.0.3 - dset@3.1.3: {} eastasianwidth@0.2.0: {} @@ -4017,9 +4021,9 @@ snapshots: escape-string-regexp@5.0.0: {} - eslint-compat-utils@0.5.0(eslint@8.57.0): + eslint-compat-utils@0.5.0(eslint@9.0.0): dependencies: - eslint: 8.57.0 + eslint: 9.0.0 semver: 7.6.0 eslint-import-resolver-node@0.3.9: @@ -4030,24 +4034,24 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.8.0(@typescript-eslint/parser@7.7.0(eslint@8.57.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint@8.57.0): + eslint-module-utils@2.8.0(@typescript-eslint/parser@7.7.0(eslint@9.0.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint@9.0.0): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 7.7.0(eslint@8.57.0)(typescript@5.3.3) - eslint: 8.57.0 + '@typescript-eslint/parser': 7.7.0(eslint@9.0.0)(typescript@5.3.3) + eslint: 9.0.0 eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: - supports-color - eslint-plugin-astro@0.34.0(eslint@8.57.0)(typescript@5.3.3): + eslint-plugin-astro@0.34.0(eslint@9.0.0)(typescript@5.3.3): dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.0.0) '@jridgewell/sourcemap-codec': 1.4.15 '@typescript-eslint/types': 5.62.0 astro-eslint-parser: 0.17.0(typescript@5.3.3) - eslint: 8.57.0 - eslint-compat-utils: 0.5.0(eslint@8.57.0) + eslint: 9.0.0 + eslint-compat-utils: 0.5.0(eslint@9.0.0) globals: 13.23.0 postcss: 8.4.38 postcss-selector-parser: 6.0.13 @@ -4055,7 +4059,7 @@ snapshots: - supports-color - typescript - eslint-plugin-import@2.29.0(@typescript-eslint/parser@7.7.0(eslint@8.57.0)(typescript@5.3.3))(eslint@8.57.0): + eslint-plugin-import@2.29.0(@typescript-eslint/parser@7.7.0(eslint@9.0.0)(typescript@5.3.3))(eslint@9.0.0): dependencies: array-includes: 3.1.7 array.prototype.findlastindex: 1.2.3 @@ -4063,9 +4067,9 @@ snapshots: array.prototype.flatmap: 1.3.2 debug: 3.2.7 doctrine: 2.1.0 - eslint: 8.57.0 + eslint: 9.0.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@7.7.0(eslint@8.57.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint@8.57.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@7.7.0(eslint@9.0.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint@9.0.0) hasown: 2.0.0 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -4076,15 +4080,15 @@ snapshots: semver: 6.3.1 tsconfig-paths: 3.14.2 optionalDependencies: - '@typescript-eslint/parser': 7.7.0(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/parser': 7.7.0(eslint@9.0.0)(typescript@5.3.3) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack - supports-color - eslint-plugin-prettier@5.0.1(eslint@8.57.0)(prettier@3.2.5): + eslint-plugin-prettier@5.0.1(eslint@9.0.0)(prettier@3.2.5): dependencies: - eslint: 8.57.0 + eslint: 9.0.0 prettier: 3.2.5 prettier-linter-helpers: 1.0.0 synckit: 0.8.6 @@ -4093,45 +4097,43 @@ snapshots: dependencies: requireindex: 1.1.0 - eslint-scope@7.2.2: + eslint-scope@8.0.1: dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 eslint-visitor-keys@3.4.3: {} - eslint@8.57.0: + eslint-visitor-keys@4.0.0: {} + + eslint@9.0.0: dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.0.0) '@eslint-community/regexpp': 4.10.0 - '@eslint/eslintrc': 2.1.4 - '@eslint/js': 8.57.0 - '@humanwhocodes/config-array': 0.11.14 + '@eslint/eslintrc': 3.0.2 + '@eslint/js': 9.0.0 + '@humanwhocodes/config-array': 0.12.3 '@humanwhocodes/module-importer': 1.0.1 '@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: 7.2.2 - eslint-visitor-keys: 3.4.3 - espree: 9.6.1 + eslint-scope: 8.0.1 + eslint-visitor-keys: 4.0.0 + espree: 10.0.1 esquery: 1.5.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 - file-entry-cache: 6.0.1 + file-entry-cache: 8.0.0 find-up: 5.0.0 glob-parent: 6.0.2 - globals: 13.23.0 graphemer: 1.4.0 - ignore: 5.3.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 @@ -4143,6 +4145,12 @@ snapshots: transitivePeerDependencies: - supports-color + espree@10.0.1: + dependencies: + acorn: 8.11.3 + acorn-jsx: 5.3.2(acorn@8.11.3) + eslint-visitor-keys: 4.0.0 + espree@9.6.1: dependencies: acorn: 8.11.2 @@ -4237,9 +4245,9 @@ snapshots: dependencies: reusify: 1.0.4 - file-entry-cache@6.0.1: + file-entry-cache@8.0.0: dependencies: - flat-cache: 3.2.0 + flat-cache: 4.0.1 fill-range@7.0.1: dependencies: @@ -4260,11 +4268,10 @@ snapshots: micromatch: 4.0.5 pkg-dir: 4.2.0 - flat-cache@3.2.0: + flat-cache@4.0.1: dependencies: flatted: 3.2.9 keyv: 4.5.4 - rimraf: 3.0.2 flatted@3.2.9: {} @@ -4339,21 +4346,14 @@ snapshots: once: 1.4.0 path-is-absolute: 1.0.1 - glob@7.2.3: - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - globals@11.12.0: {} globals@13.23.0: dependencies: type-fest: 0.20.2 + globals@14.0.0: {} + globalthis@1.0.3: dependencies: define-properties: 1.2.1 @@ -4506,8 +4506,6 @@ snapshots: ieee754@1.2.1: {} - ignore@5.3.0: {} - ignore@5.3.1: {} import-fresh@3.3.0: @@ -5499,10 +5497,6 @@ snapshots: reusify@1.0.4: {} - rimraf@3.0.2: - dependencies: - glob: 7.2.3 - rollup@4.6.1: optionalDependencies: '@rollup/rollup-android-arm-eabi': 4.6.1 From 2b0c641c1e1d583e789fcf11f94e843619c273da Mon Sep 17 00:00:00 2001 From: Igor Kowalczyk Date: Fri, 19 Apr 2024 17:17:22 +0200 Subject: [PATCH 2/4] Update dependencies and apply code formatting changes --- .eslintrc.js | 31 ------- .vscode/settings.json | 2 +- eslint.config.mjs | 10 +++ package.json | 1 - prettier.config.mjs | 1 - src/components/Input.astro | 2 +- src/database/index.ts | 8 +- src/env.d.ts | 2 + src/layouts/Layout.astro | 3 +- src/pages/api/badge/[username].ts | 8 +- src/pages/api/json/[username].ts | 5 +- src/pages/index.astro | 132 +++++++++++++++--------------- src/styles/styles.css | 2 +- 13 files changed, 94 insertions(+), 113 deletions(-) delete mode 100644 .eslintrc.js create mode 100644 eslint.config.mjs diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index ad32efb4..00000000 --- a/.eslintrc.js +++ /dev/null @@ -1,31 +0,0 @@ -module.exports = { - extends: ["@igorkowalczyk/eslint-config/legacy", "plugin:astro/recommended"], - env: { - node: true, - es2022: true, - browser: true, - }, - parserOptions: { - ecmaVersion: "latest", - sourceType: "module", - }, - overrides: [ - { - files: ["*.astro"], - parser: "astro-eslint-parser", - parserOptions: { - parser: "@typescript-eslint/parser", - extraFileExtensions: [".astro"], - }, - }, - { - files: ["*.ts"], - parser: "@typescript-eslint/parser", - extends: ["plugin:@typescript-eslint/recommended"], - }, - { - files: ["**/*.astro/*.js", "*.astro/*.js"], - parser: "@typescript-eslint/parser", - }, - ], -}; diff --git a/.vscode/settings.json b/.vscode/settings.json index 53eca5e2..e5f2aea9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,7 +2,7 @@ "markdown.validate.referenceLinks.enabled": "ignore", "eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"], "editor.codeActionsOnSave": { - "source.fixAll.eslint": true + "source.fixAll.eslint": "explicit" }, "deno.enable": true } diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 00000000..a233f372 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,10 @@ +import eslintConfig from "@igorkowalczyk/eslint-config/flat"; +import eslintPluginAstro from "eslint-plugin-astro"; + +export default [ + { + ignores: ["dist/"], + }, + ...eslintConfig, + ...eslintPluginAstro.configs["flat/recommended"], +]; diff --git a/package.json b/package.json index 6f7b7d59..a41956d3 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,6 @@ "@typescript-eslint/parser": "7.7.0", "autoprefixer": "10.4.19", "eslint": "9.0.0", - "eslint-plugin": "^1.0.1", "eslint-plugin-astro": "0.34.0", "postcss": "8.4.38", "prettier": "3.2.5", diff --git a/prettier.config.mjs b/prettier.config.mjs index 1a756225..b75572d5 100644 --- a/prettier.config.mjs +++ b/prettier.config.mjs @@ -1,4 +1,3 @@ -/* eslint-disable global-require */ import config from "@igorkowalczyk/prettier-config"; export default { diff --git a/src/components/Input.astro b/src/components/Input.astro index 1d3e381c..7c067ad1 100644 --- a/src/components/Input.astro +++ b/src/components/Input.astro @@ -1,5 +1,5 @@ --- -const props = Astro.props; +const { props } = Astro; --- diff --git a/src/database/index.ts b/src/database/index.ts index a68669f2..ee26f41f 100644 --- a/src/database/index.ts +++ b/src/database/index.ts @@ -1,6 +1,6 @@ -import "./patch"; +import "./patch.ts"; -export async function IncreaseViews(username: string) { +export async function IncreaseViews(username: string): Promise { if (username === "example") return 0; const kv = await Deno.openKv(); await kv.atomic().sum([username], 1n).commit(); @@ -8,9 +8,9 @@ export async function IncreaseViews(username: string) { return Number(view.value || 0); } -export async function GetViews(username: string) { +export async function GetViews(username: string): Promise { if (username === "example") return 0; const kv = await Deno.openKv(); const view = await kv.get([username]); - return view.value || 0; + return (view.value as number) || 0; } diff --git a/src/env.d.ts b/src/env.d.ts index f964fe0c..3a96c993 100644 --- a/src/env.d.ts +++ b/src/env.d.ts @@ -1 +1,3 @@ /// +/// +/// diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 26252315..695eab6f 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -4,6 +4,7 @@ export interface Props { } const { title } = Astro.props; +import { Image } from "astro:assets"; import "../styles/main.css"; --- @@ -44,7 +45,7 @@ import "../styles/main.css";
- Profile Views + Profile Views
diff --git a/src/pages/api/badge/[username].ts b/src/pages/api/badge/[username].ts index 152956c7..3e77f986 100644 --- a/src/pages/api/badge/[username].ts +++ b/src/pages/api/badge/[username].ts @@ -1,7 +1,7 @@ import { badgen } from "badgen"; import type { StyleOption } from "badgen"; -import { FormatNumber } from "../../../utils/FormatNumber"; -import { IncreaseViews, GetViews } from "@/database/index"; +import { FormatNumber } from "../../../utils/FormatNumber.ts"; +import { IncreaseViews, GetViews } from "../../../database/index.ts"; interface QueryParams { label?: string; @@ -17,7 +17,7 @@ export const GET = async function GET({ params, request }: { params: { username: const query = new URL(request.url).searchParams; const { label, labelColor, color, style, format, display }: QueryParams = Object.fromEntries(query); const { username } = params; - const number: number = display ? await GetViews(username) : await IncreaseViews(username); + const views: number = display ? await GetViews(username) : await IncreaseViews(username); // Validate the format to ensure it's "short" or "long" const isValidFormat = format === "short" || format === "long"; @@ -25,7 +25,7 @@ export const GET = async function GET({ params, request }: { params: { username: const badge = badgen({ label: label || "Views", labelColor: labelColor, - status: FormatNumber(number, isValidFormat ? format! : "short"), + status: FormatNumber(views, isValidFormat ? format! : "short"), color: color, style: style || "flat", }); diff --git a/src/pages/api/json/[username].ts b/src/pages/api/json/[username].ts index 5ca2ac68..3cc02c0e 100644 --- a/src/pages/api/json/[username].ts +++ b/src/pages/api/json/[username].ts @@ -1,7 +1,6 @@ -import type { APIRoute } from "astro"; -import { GetViews } from "@/database/index"; +import { GetViews } from "../../../database/index.ts"; -export const GET: APIRoute = async function GET({ params }: { params: { username: string } }): Promise { +export const GET = async function GET({ params }: { params: { username: string } }): Promise { try { const { username } = params; diff --git a/src/pages/index.astro b/src/pages/index.astro index 52a87f0a..a28b3838 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -4,7 +4,7 @@ import Header from "../components/Header.astro"; import Image from "../components/Image.astro"; import Input from "../components/Input.astro"; import Layout from "../layouts/Layout.astro"; -let url = "/api/badge/example"; +const url = "/api/badge/example"; --- @@ -22,71 +22,73 @@ let url = "/api/badge/example";
- - - - - - - - - - - - - - - - +
+
StyleDefault badgeColorCustom text & color
-
flat
-
- - - - - -
+ + + + + + + + + + + + + + + - - - - - - - -
StyleDefault badgeColorCustom text & color
+
flat
+
+ + + + + +
-
classic
-
- - - - - -
+ + +
classic
+ + + + + + + + + + + + + - - - - - - - - - - - - -

Looking for more customizations? @@ -118,7 +120,7 @@ let url = "/api/badge/example"; }); -