From f5e35ca5d61c5d66626b733b3d734e6d5ae088ac Mon Sep 17 00:00:00 2001 From: kunish Date: Sun, 3 Sep 2023 15:30:56 +0800 Subject: [PATCH] chore: add eslint to enforce code quality --- .eslintrc.yml | 50 ++ .lintstagedrc.yml | 1 + package.json | 5 + pnpm-lock.yaml | 876 ++++++++++++++++++++++++++++ src/components/Collapse.tsx | 4 +- src/components/SubscriptionInfo.tsx | 1 + src/i18n/index.tsx | 2 +- src/index.css | 2 +- src/pages/Config.tsx | 12 +- src/pages/Setup.tsx | 2 + src/types.d.ts | 2 +- tailwind.config.ts | 7 +- 12 files changed, 951 insertions(+), 13 deletions(-) create mode 100644 .eslintrc.yml diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 0000000..0e932b1 --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,50 @@ +parser: '@typescript-eslint/parser' + +parserOptions: + ecmaFeatures: + jsx: true + ecmaVersion: latest + sourceType: module + +env: + node: true + +plugins: + - '@typescript-eslint' + - 'prettier' + +extends: + - eslint:recommended + - plugin:@typescript-eslint/eslint-recommended + - plugin:@typescript-eslint/recommended + - plugin:prettier/recommended + +settings: + import/resolver: + typescript: + node: true + +rules: + '@typescript-eslint/no-unused-vars': + - error + - argsIgnorePattern: '^_' + + no-empty: off + + padding-line-between-statements: + - error + - blankLine: always + prev: '*' + next: return + - blankLine: always + prev: '*' + next: if + - blankLine: always + prev: 'if' + next: '*' + - blankLine: always + prev: '*' + next: switch + - blankLine: always + prev: switch + next: '*' diff --git a/.lintstagedrc.yml b/.lintstagedrc.yml index 3706938..cf11e40 100644 --- a/.lintstagedrc.yml +++ b/.lintstagedrc.yml @@ -1,2 +1,3 @@ 'package.json': 'sort-package-json' +'*.{js,jsx,ts,tsx}': 'eslint --fix' '*.{js,jsx,ts,tsx,md,html,css,json,yml,yaml}': 'prettier --write' diff --git a/package.json b/package.json index e9f9cc0..7c21a7f 100644 --- a/package.json +++ b/package.json @@ -30,12 +30,17 @@ "@types/byte-size": "^8.1.0", "@types/node": "^20.5.8", "@types/uuid": "^9.0.3", + "@typescript-eslint/eslint-plugin": "^6.5.0", + "@typescript-eslint/parser": "^6.5.0", "apexcharts": "^3.42.0", "autoprefixer": "^10.4.15", "byte-size": "^8.1.1", "commitlint": "^17.7.1", "daisyui": "^3.6.4", "dayjs": "^1.11.9", + "eslint": "^8.48.0", + "eslint-config-prettier": "^9.0.0", + "eslint-plugin-prettier": "^5.0.0", "husky": "^8.0.3", "is-ip": "^5.0.1", "ky": "^1.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 74217db..4e40290 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -62,6 +62,12 @@ dependencies: '@types/uuid': specifier: ^9.0.3 version: 9.0.3 + '@typescript-eslint/eslint-plugin': + specifier: ^6.5.0 + version: 6.5.0(@typescript-eslint/parser@6.5.0)(eslint@8.48.0)(typescript@5.2.2) + '@typescript-eslint/parser': + specifier: ^6.5.0 + version: 6.5.0(eslint@8.48.0)(typescript@5.2.2) apexcharts: specifier: ^3.42.0 version: 3.42.0 @@ -80,6 +86,15 @@ dependencies: dayjs: specifier: ^1.11.9 version: 1.11.9 + eslint: + specifier: ^8.48.0 + version: 8.48.0 + eslint-config-prettier: + specifier: ^9.0.0 + version: 9.0.0(eslint@8.48.0) + eslint-plugin-prettier: + specifier: ^5.0.0 + version: 5.0.0(eslint-config-prettier@9.0.0)(eslint@8.48.0)(prettier@3.0.3) husky: specifier: ^8.0.3 version: 8.0.3 @@ -139,6 +154,14 @@ dependencies: version: 3.22.2 packages: + /@aashutoshrathi/word-wrap@1.2.6: + resolution: + { + integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==, + } + engines: { node: '>=0.10.0' } + dev: false + /@alloc/quick-lru@5.2.0: resolution: { @@ -2207,6 +2230,55 @@ packages: dev: false optional: true + /@eslint-community/eslint-utils@4.4.0(eslint@8.48.0): + resolution: + { + integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==, + } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + dependencies: + eslint: 8.48.0 + eslint-visitor-keys: 3.4.3 + dev: false + + /@eslint-community/regexpp@4.8.0: + resolution: + { + integrity: sha512-JylOEEzDiOryeUnFbQz+oViCXS0KsvR1mvHkoMiu5+UiBvy+RYX7tzlIIIEstF/gVa2tj9AQXk3dgnxv6KxhFg==, + } + engines: { node: ^12.0.0 || ^14.0.0 || >=16.0.0 } + dev: false + + /@eslint/eslintrc@2.1.2: + resolution: + { + integrity: sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==, + } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + dependencies: + ajv: 6.12.6 + debug: 4.3.4 + espree: 9.6.1 + globals: 13.21.0 + ignore: 5.2.4 + import-fresh: 3.3.0 + js-yaml: 4.1.0 + minimatch: 3.1.2 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + dev: false + + /@eslint/js@8.48.0: + resolution: + { + integrity: sha512-ZSjtmelB7IJfWD2Fvb7+Z+ChTIKWq6kjda95fLcQKNS5aheVHn4IkfgRQE3sIIzTcSLwLcLZUD9UBt+V7+h+Pw==, + } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + dev: false + /@felte/common@1.1.8: resolution: { @@ -2258,6 +2330,35 @@ packages: } dev: false + /@humanwhocodes/config-array@0.11.11: + resolution: + { + integrity: sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==, + } + engines: { node: '>=10.10.0' } + dependencies: + '@humanwhocodes/object-schema': 1.2.1 + debug: 4.3.4 + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + dev: false + + /@humanwhocodes/module-importer@1.0.1: + resolution: + { + integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==, + } + engines: { node: '>=12.22' } + dev: false + + /@humanwhocodes/object-schema@1.2.1: + resolution: + { + integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==, + } + dev: false + /@jridgewell/gen-mapping@0.3.3: resolution: { @@ -2353,6 +2454,21 @@ packages: fastq: 1.15.0 dev: false + /@pkgr/utils@2.4.2: + resolution: + { + integrity: sha512-POgTXhjrTfbTV63DiFXav4lBHiICLKKwDeaKn9Nphwj7WH6m0hMMCaJkMyRWjgtPFyRKRVoMXXjczsTQRDEhYw==, + } + engines: { node: ^12.20.0 || ^14.18.0 || >=16.0.0 } + dependencies: + cross-spawn: 7.0.3 + fast-glob: 3.3.1 + is-glob: 4.0.3 + open: 9.1.0 + picocolors: 1.0.0 + tslib: 2.6.2 + dev: false + /@reach/observe-rect@1.2.0: resolution: { @@ -2728,6 +2844,13 @@ packages: } dev: false + /@types/json-schema@7.0.12: + resolution: + { + integrity: sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==, + } + dev: false + /@types/minimist@1.2.2: resolution: { @@ -2765,6 +2888,13 @@ packages: '@types/node': 20.5.8 dev: false + /@types/semver@7.5.1: + resolution: + { + integrity: sha512-cJRQXpObxfNKkFAZbJl2yjWtJCqELQIdShsogr1d2MilP8dKD9TE/nEKHkJgUNHdGKCQaf9HbIynuV2csLGVLg==, + } + dev: false + /@types/trusted-types@2.0.3: resolution: { @@ -2779,6 +2909,161 @@ packages: } dev: false + /@typescript-eslint/eslint-plugin@6.5.0(@typescript-eslint/parser@6.5.0)(eslint@8.48.0)(typescript@5.2.2): + resolution: + { + integrity: sha512-2pktILyjvMaScU6iK3925uvGU87E+N9rh372uGZgiMYwafaw9SXq86U04XPq3UH6tzRvNgBsub6x2DacHc33lw==, + } + engines: { node: ^16.0.0 || >=18.0.0 } + peerDependencies: + '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha + eslint: ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@eslint-community/regexpp': 4.8.0 + '@typescript-eslint/parser': 6.5.0(eslint@8.48.0)(typescript@5.2.2) + '@typescript-eslint/scope-manager': 6.5.0 + '@typescript-eslint/type-utils': 6.5.0(eslint@8.48.0)(typescript@5.2.2) + '@typescript-eslint/utils': 6.5.0(eslint@8.48.0)(typescript@5.2.2) + '@typescript-eslint/visitor-keys': 6.5.0 + debug: 4.3.4 + eslint: 8.48.0 + graphemer: 1.4.0 + ignore: 5.2.4 + natural-compare: 1.4.0 + semver: 7.5.4 + ts-api-utils: 1.0.2(typescript@5.2.2) + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: false + + /@typescript-eslint/parser@6.5.0(eslint@8.48.0)(typescript@5.2.2): + resolution: + { + integrity: sha512-LMAVtR5GN8nY0G0BadkG0XIe4AcNMeyEy3DyhKGAh9k4pLSMBO7rF29JvDBpZGCmp5Pgz5RLHP6eCpSYZJQDuQ==, + } + engines: { node: ^16.0.0 || >=18.0.0 } + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/scope-manager': 6.5.0 + '@typescript-eslint/types': 6.5.0 + '@typescript-eslint/typescript-estree': 6.5.0(typescript@5.2.2) + '@typescript-eslint/visitor-keys': 6.5.0 + debug: 4.3.4 + eslint: 8.48.0 + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: false + + /@typescript-eslint/scope-manager@6.5.0: + resolution: + { + integrity: sha512-A8hZ7OlxURricpycp5kdPTH3XnjG85UpJS6Fn4VzeoH4T388gQJ/PGP4ole5NfKt4WDVhmLaQ/dBLNDC4Xl/Kw==, + } + engines: { node: ^16.0.0 || >=18.0.0 } + dependencies: + '@typescript-eslint/types': 6.5.0 + '@typescript-eslint/visitor-keys': 6.5.0 + dev: false + + /@typescript-eslint/type-utils@6.5.0(eslint@8.48.0)(typescript@5.2.2): + resolution: + { + integrity: sha512-f7OcZOkRivtujIBQ4yrJNIuwyCQO1OjocVqntl9dgSIZAdKqicj3xFDqDOzHDlGCZX990LqhLQXWRnQvsapq8A==, + } + engines: { node: ^16.0.0 || >=18.0.0 } + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/typescript-estree': 6.5.0(typescript@5.2.2) + '@typescript-eslint/utils': 6.5.0(eslint@8.48.0)(typescript@5.2.2) + debug: 4.3.4 + eslint: 8.48.0 + ts-api-utils: 1.0.2(typescript@5.2.2) + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: false + + /@typescript-eslint/types@6.5.0: + resolution: + { + integrity: sha512-eqLLOEF5/lU8jW3Bw+8auf4lZSbbljHR2saKnYqON12G/WsJrGeeDHWuQePoEf9ro22+JkbPfWQwKEC5WwLQ3w==, + } + engines: { node: ^16.0.0 || >=18.0.0 } + dev: false + + /@typescript-eslint/typescript-estree@6.5.0(typescript@5.2.2): + resolution: + { + integrity: sha512-q0rGwSe9e5Kk/XzliB9h2LBc9tmXX25G0833r7kffbl5437FPWb2tbpIV9wAATebC/018pGa9fwPDuvGN+LxWQ==, + } + engines: { node: ^16.0.0 || >=18.0.0 } + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 6.5.0 + '@typescript-eslint/visitor-keys': 6.5.0 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + semver: 7.5.4 + ts-api-utils: 1.0.2(typescript@5.2.2) + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: false + + /@typescript-eslint/utils@6.5.0(eslint@8.48.0)(typescript@5.2.2): + resolution: + { + integrity: sha512-9nqtjkNykFzeVtt9Pj6lyR9WEdd8npPhhIPM992FWVkZuS6tmxHfGVnlUcjpUP2hv8r4w35nT33mlxd+Be1ACQ==, + } + engines: { node: ^16.0.0 || >=18.0.0 } + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.48.0) + '@types/json-schema': 7.0.12 + '@types/semver': 7.5.1 + '@typescript-eslint/scope-manager': 6.5.0 + '@typescript-eslint/types': 6.5.0 + '@typescript-eslint/typescript-estree': 6.5.0(typescript@5.2.2) + eslint: 8.48.0 + semver: 7.5.4 + transitivePeerDependencies: + - supports-color + - typescript + dev: false + + /@typescript-eslint/visitor-keys@6.5.0: + resolution: + { + integrity: sha512-yCB/2wkbv3hPsh02ZS8dFQnij9VVQXJMN/gbQsaaY+zxALkZnxa/wagvLEFsAWMPv7d7lxQmNsIzGU1w/T/WyA==, + } + engines: { node: ^16.0.0 || >=18.0.0 } + dependencies: + '@typescript-eslint/types': 6.5.0 + eslint-visitor-keys: 3.4.3 + dev: false + /@yr/monotone-cubic-spline@1.0.3: resolution: { @@ -2797,6 +3082,17 @@ packages: through: 2.3.8 dev: false + /acorn-jsx@5.3.2(acorn@8.10.0): + resolution: + { + integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==, + } + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + acorn: 8.10.0 + dev: false + /acorn-walk@8.2.0: resolution: { @@ -2814,6 +3110,18 @@ packages: hasBin: true dev: false + /ajv@6.12.6: + resolution: + { + integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==, + } + dependencies: + fast-deep-equal: 3.1.3 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.4.1 + uri-js: 4.4.1 + dev: false + /ajv@8.12.0: resolution: { @@ -2951,6 +3259,14 @@ packages: } dev: false + /array-union@2.1.0: + resolution: + { + integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==, + } + engines: { node: '>=8' } + dev: false + /arraybuffer.prototype.slice@1.0.1: resolution: { @@ -3096,6 +3412,14 @@ packages: } dev: false + /big-integer@1.6.51: + resolution: + { + integrity: sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==, + } + engines: { node: '>=0.6' } + dev: false + /binary-extensions@2.2.0: resolution: { @@ -3104,6 +3428,16 @@ packages: engines: { node: '>=8' } dev: false + /bplist-parser@0.2.0: + resolution: + { + integrity: sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==, + } + engines: { node: '>= 5.10.0' } + dependencies: + big-integer: 1.6.51 + dev: false + /brace-expansion@1.1.11: resolution: { @@ -3162,6 +3496,16 @@ packages: engines: { node: '>=6' } dev: false + /bundle-name@3.0.0: + resolution: + { + integrity: sha512-PKA4BeSvBpQKQ8iPOGCSiell+N8P+Tf1DlwqmYhpe2gAhKPHn8EYOxVT+ShuGmhg8lN8XiSlS80yiExKXrURlw==, + } + engines: { node: '>=12' } + dependencies: + run-applescript: 5.0.0 + dev: false + /byte-size@8.1.1: resolution: { @@ -3632,6 +3976,13 @@ packages: engines: { node: '>=0.10.0' } dev: false + /deep-is@0.1.4: + resolution: + { + integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==, + } + dev: false + /deepmerge@4.3.1: resolution: { @@ -3640,6 +3991,38 @@ packages: engines: { node: '>=0.10.0' } dev: false + /default-browser-id@3.0.0: + resolution: + { + integrity: sha512-OZ1y3y0SqSICtE8DE4S8YOE9UZOJ8wO16fKWVP5J1Qz42kV9jcnMVFrEE/noXb/ss3Q4pZIH79kxofzyNNtUNA==, + } + engines: { node: '>=12' } + dependencies: + bplist-parser: 0.2.0 + untildify: 4.0.0 + dev: false + + /default-browser@4.0.0: + resolution: + { + integrity: sha512-wX5pXO1+BrhMkSbROFsyxUm0i/cJEScyNhA4PPxc41ICuv05ZZB/MX28s8aZx6xjmatvebIapF6hLEKEcpneUA==, + } + engines: { node: '>=14.16' } + dependencies: + bundle-name: 3.0.0 + default-browser-id: 3.0.0 + execa: 7.2.0 + titleize: 3.0.0 + dev: false + + /define-lazy-prop@3.0.0: + resolution: + { + integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==, + } + engines: { node: '>=12' } + dev: false + /define-properties@1.2.0: resolution: { @@ -3706,6 +4089,16 @@ packages: } dev: false + /doctrine@3.0.0: + resolution: + { + integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==, + } + engines: { node: '>=6.0.0' } + dependencies: + esutils: 2.0.3 + dev: false + /dot-prop@5.3.0: resolution: { @@ -3885,6 +4278,158 @@ packages: engines: { node: '>=0.8.0' } dev: false + /escape-string-regexp@4.0.0: + resolution: + { + integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==, + } + engines: { node: '>=10' } + dev: false + + /eslint-config-prettier@9.0.0(eslint@8.48.0): + resolution: + { + integrity: sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==, + } + hasBin: true + peerDependencies: + eslint: '>=7.0.0' + dependencies: + eslint: 8.48.0 + dev: false + + /eslint-plugin-prettier@5.0.0(eslint-config-prettier@9.0.0)(eslint@8.48.0)(prettier@3.0.3): + resolution: + { + integrity: sha512-AgaZCVuYDXHUGxj/ZGu1u8H8CYgDY3iG6w5kUFw4AzMVXzB7VvbKgYR4nATIN+OvUrghMbiDLeimVjVY5ilq3w==, + } + engines: { node: ^14.18.0 || >=16.0.0 } + peerDependencies: + '@types/eslint': '>=8.0.0' + eslint: '>=8.0.0' + eslint-config-prettier: '*' + prettier: '>=3.0.0' + peerDependenciesMeta: + '@types/eslint': + optional: true + eslint-config-prettier: + optional: true + dependencies: + eslint: 8.48.0 + eslint-config-prettier: 9.0.0(eslint@8.48.0) + prettier: 3.0.3 + prettier-linter-helpers: 1.0.0 + synckit: 0.8.5 + dev: false + + /eslint-scope@7.2.2: + resolution: + { + integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==, + } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + dependencies: + esrecurse: 4.3.0 + estraverse: 5.3.0 + dev: false + + /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 } + dev: false + + /eslint@8.48.0: + resolution: + { + integrity: sha512-sb6DLeIuRXxeM1YljSe1KEx9/YYeZFQWcV8Rq9HfigmdDEugjLEVEa1ozDjL6YDjBpQHPJxJzze+alxi4T3OLg==, + } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + hasBin: true + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.48.0) + '@eslint-community/regexpp': 4.8.0 + '@eslint/eslintrc': 2.1.2 + '@eslint/js': 8.48.0 + '@humanwhocodes/config-array': 0.11.11 + '@humanwhocodes/module-importer': 1.0.1 + '@nodelib/fs.walk': 1.2.8 + 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 + esquery: 1.5.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 6.0.1 + find-up: 5.0.0 + glob-parent: 6.0.2 + globals: 13.21.0 + graphemer: 1.4.0 + ignore: 5.2.4 + 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 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.3 + strip-ansi: 6.0.1 + text-table: 0.2.0 + transitivePeerDependencies: + - supports-color + dev: false + + /espree@9.6.1: + resolution: + { + integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==, + } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + dependencies: + acorn: 8.10.0 + acorn-jsx: 5.3.2(acorn@8.10.0) + eslint-visitor-keys: 3.4.3 + dev: false + + /esquery@1.5.0: + resolution: + { + integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==, + } + engines: { node: '>=0.10' } + dependencies: + estraverse: 5.3.0 + dev: false + + /esrecurse@4.3.0: + resolution: + { + integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==, + } + engines: { node: '>=4.0' } + dependencies: + estraverse: 5.3.0 + dev: false + + /estraverse@5.3.0: + resolution: + { + integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==, + } + engines: { node: '>=4.0' } + dev: false + /estree-walker@1.0.1: resolution: { @@ -3950,6 +4495,13 @@ packages: } dev: false + /fast-diff@1.3.0: + resolution: + { + integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==, + } + dev: false + /fast-glob@3.3.1: resolution: { @@ -3971,6 +4523,13 @@ packages: } dev: false + /fast-levenshtein@2.0.6: + resolution: + { + integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==, + } + dev: false + /fastparse@1.1.2: resolution: { @@ -3987,6 +4546,16 @@ packages: reusify: 1.0.4 dev: false + /file-entry-cache@6.0.1: + resolution: + { + integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==, + } + engines: { node: ^10.12.0 || >=12.0.0 } + dependencies: + flat-cache: 3.1.0 + dev: false + /filelist@1.0.4: resolution: { @@ -4028,6 +4597,25 @@ packages: path-exists: 4.0.0 dev: false + /flat-cache@3.1.0: + resolution: + { + integrity: sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew==, + } + engines: { node: '>=12.0.0' } + dependencies: + flatted: 3.2.7 + keyv: 4.5.3 + rimraf: 3.0.2 + dev: false + + /flatted@3.2.7: + resolution: + { + integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==, + } + dev: false + /for-each@0.3.3: resolution: { @@ -4258,6 +4846,16 @@ packages: engines: { node: '>=4' } dev: false + /globals@13.21.0: + resolution: + { + integrity: sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==, + } + engines: { node: '>=8' } + dependencies: + type-fest: 0.20.2 + dev: false + /globalthis@1.0.3: resolution: { @@ -4268,6 +4866,21 @@ packages: define-properties: 1.2.0 dev: false + /globby@11.1.0: + resolution: + { + integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==, + } + engines: { node: '>=10' } + dependencies: + array-union: 2.1.0 + dir-glob: 3.0.1 + fast-glob: 3.3.1 + ignore: 5.2.4 + merge2: 1.4.1 + slash: 3.0.0 + dev: false + /globby@13.2.2: resolution: { @@ -4298,6 +4911,13 @@ packages: } dev: false + /graphemer@1.4.0: + resolution: + { + integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==, + } + dev: false + /hard-rejection@2.1.0: resolution: { @@ -4449,6 +5069,14 @@ packages: resolve-from: 4.0.0 dev: false + /imurmurhash@0.1.4: + resolution: + { + integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==, + } + engines: { node: '>=0.8.19' } + dev: false + /indent-string@4.0.0: resolution: { @@ -4576,6 +5204,24 @@ packages: has-tostringtag: 1.0.0 dev: false + /is-docker@2.2.1: + resolution: + { + integrity: sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==, + } + engines: { node: '>=8' } + hasBin: true + dev: false + + /is-docker@3.0.0: + resolution: + { + integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==, + } + engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 } + hasBin: true + dev: false + /is-extglob@2.1.1: resolution: { @@ -4610,6 +5256,17 @@ packages: is-extglob: 2.1.1 dev: false + /is-inside-container@1.0.0: + resolution: + { + integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==, + } + engines: { node: '>=14.16' } + hasBin: true + dependencies: + is-docker: 3.0.0 + dev: false + /is-ip@5.0.1: resolution: { @@ -4670,6 +5327,14 @@ packages: engines: { node: '>=8' } dev: false + /is-path-inside@3.0.3: + resolution: + { + integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==, + } + engines: { node: '>=8' } + dev: false + /is-plain-obj@1.1.0: resolution: { @@ -4795,6 +5460,16 @@ packages: engines: { node: '>=12.13' } dev: false + /is-wsl@2.2.0: + resolution: + { + integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==, + } + engines: { node: '>=8' } + dependencies: + is-docker: 2.2.1 + dev: false + /isarray@2.0.5: resolution: { @@ -4877,6 +5552,13 @@ packages: hasBin: true dev: false + /json-buffer@3.0.1: + resolution: + { + integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==, + } + dev: false + /json-parse-even-better-errors@2.3.1: resolution: { @@ -4884,6 +5566,13 @@ packages: } dev: false + /json-schema-traverse@0.4.1: + resolution: + { + integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==, + } + dev: false + /json-schema-traverse@1.0.0: resolution: { @@ -4898,6 +5587,13 @@ packages: } dev: false + /json-stable-stringify-without-jsonify@1.0.1: + resolution: + { + integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==, + } + dev: false + /json5@2.2.3: resolution: { @@ -4934,6 +5630,15 @@ packages: engines: { node: '>=0.10.0' } dev: false + /keyv@4.5.3: + resolution: + { + integrity: sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==, + } + dependencies: + json-buffer: 3.0.1 + dev: false + /kind-of@6.0.3: resolution: { @@ -4958,6 +5663,17 @@ packages: engines: { node: '>=6' } dev: false + /levn@0.4.1: + resolution: + { + integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==, + } + engines: { node: '>= 0.8.0' } + dependencies: + prelude-ls: 1.2.1 + type-check: 0.4.0 + dev: false + /lilconfig@2.1.0: resolution: { @@ -5337,6 +6053,13 @@ packages: hasBin: true dev: false + /natural-compare@1.4.0: + resolution: + { + integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==, + } + dev: false + /node-releases@2.0.13: resolution: { @@ -5478,6 +6201,34 @@ packages: mimic-fn: 4.0.0 dev: false + /open@9.1.0: + resolution: + { + integrity: sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg==, + } + engines: { node: '>=14.16' } + dependencies: + default-browser: 4.0.0 + define-lazy-prop: 3.0.0 + is-inside-container: 1.0.0 + is-wsl: 2.2.0 + dev: false + + /optionator@0.9.3: + resolution: + { + integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==, + } + engines: { node: '>= 0.8.0' } + dependencies: + '@aashutoshrathi/word-wrap': 1.2.6 + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.4.1 + prelude-ls: 1.2.1 + type-check: 0.4.0 + dev: false + /p-limit@2.3.0: resolution: { @@ -5728,6 +6479,24 @@ packages: source-map-js: 1.0.2 dev: false + /prelude-ls@1.2.1: + resolution: + { + integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==, + } + engines: { node: '>= 0.8.0' } + dev: false + + /prettier-linter-helpers@1.0.0: + resolution: + { + integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==, + } + engines: { node: '>=6.0.0' } + dependencies: + fast-diff: 1.3.0 + dev: false + /prettier-plugin-organize-imports@3.2.3(prettier@3.0.3)(typescript@5.2.2): resolution: { @@ -6081,6 +6850,16 @@ packages: } dev: false + /rimraf@3.0.2: + resolution: + { + integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==, + } + hasBin: true + dependencies: + glob: 7.1.6 + dev: false + /rollup-plugin-terser@7.0.2(rollup@2.79.1): resolution: { @@ -6119,6 +6898,16 @@ packages: fsevents: 2.3.3 dev: false + /run-applescript@5.0.0: + resolution: + { + integrity: sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg==, + } + engines: { node: '>=12' } + dependencies: + execa: 5.1.1 + dev: false + /run-parallel@1.2.0: resolution: { @@ -6239,6 +7028,14 @@ packages: } dev: false + /slash@3.0.0: + resolution: + { + integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==, + } + engines: { node: '>=8' } + dev: false + /slash@4.0.0: resolution: { @@ -6572,6 +7369,14 @@ packages: min-indent: 1.0.1 dev: false + /strip-json-comments@3.1.1: + resolution: + { + integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==, + } + engines: { node: '>=8' } + dev: false + /sucrase@3.34.0: resolution: { @@ -6707,6 +7512,17 @@ packages: svg.js: 2.7.1 dev: false + /synckit@0.8.5: + resolution: + { + integrity: sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q==, + } + engines: { node: ^14.18.0 || >=16.0.0 } + dependencies: + '@pkgr/utils': 2.4.2 + tslib: 2.6.2 + dev: false + /tailwind-merge@1.14.0: resolution: { @@ -6791,6 +7607,13 @@ packages: engines: { node: '>=0.10' } dev: false + /text-table@0.2.0: + resolution: + { + integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==, + } + dev: false + /thenify-all@1.6.0: resolution: { @@ -6836,6 +7659,14 @@ packages: convert-hrtime: 5.0.0 dev: false + /titleize@3.0.0: + resolution: + { + integrity: sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ==, + } + engines: { node: '>=12' } + dev: false + /to-fast-properties@2.0.0: resolution: { @@ -6871,6 +7702,18 @@ packages: engines: { node: '>=8' } dev: false + /ts-api-utils@1.0.2(typescript@5.2.2): + resolution: + { + integrity: sha512-Cbu4nIqnEdd+THNEsBdkolnOXhg0I8XteoHaEKgvsxpsbWda4IsUut2c187HxywQCvveojow0Dgw/amxtSKVkQ==, + } + engines: { node: '>=16.13.0' } + peerDependencies: + typescript: '>=4.2.0' + dependencies: + typescript: 5.2.2 + dev: false + /ts-interface-checker@0.1.13: resolution: { @@ -6912,6 +7755,23 @@ packages: yn: 3.1.1 dev: false + /tslib@2.6.2: + resolution: + { + integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==, + } + dev: false + + /type-check@0.4.0: + resolution: + { + integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==, + } + engines: { node: '>= 0.8.0' } + dependencies: + prelude-ls: 1.2.1 + dev: false + /type-fest@0.16.0: resolution: { @@ -6928,6 +7788,14 @@ packages: engines: { node: '>=10' } dev: false + /type-fest@0.20.2: + resolution: + { + integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==, + } + engines: { node: '>=10' } + dev: false + /type-fest@0.6.0: resolution: { @@ -7076,6 +7944,14 @@ packages: engines: { node: '>= 10.0.0' } dev: false + /untildify@4.0.0: + resolution: + { + integrity: sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==, + } + engines: { node: '>=8' } + dev: false + /upath@1.2.0: resolution: { diff --git a/src/components/Collapse.tsx b/src/components/Collapse.tsx index 2a4636f..b2f5e85 100644 --- a/src/components/Collapse.tsx +++ b/src/components/Collapse.tsx @@ -15,12 +15,14 @@ export const Collapse: ParentComponent = (props) => { const getCollapseClassName = () => { const openedClassName = 'collapse-open' const closedClassName = 'collapse-close' + return props.isOpen ? openedClassName : closedClassName } const getCollapseContentClassName = () => { const openedClassName = 'opacity-100' const closedClassName = 'opacity-0' + return props.isOpen ? openedClassName : closedClassName } @@ -36,7 +38,7 @@ export const Collapse: ParentComponent = (props) => {
{ const I18nUpdator: ParentComponent = (props) => { const { setLang } = useLanguage() - const [_, { locale }] = useI18n() + const [, { locale }] = useI18n() createEffect(() => { setLang(locale()) diff --git a/src/index.css b/src/index.css index d7f6852..cdea20e 100644 --- a/src/index.css +++ b/src/index.css @@ -13,7 +13,7 @@ :root, [data-theme='wireframe'], [data-theme='cyberpunk'] { - font-family: 'Fira Sans', 'Twemoji Mozilla'; + font-family: 'Fira Sans', 'Twemoji Mozilla', system-ui, monospace; } ::-webkit-scrollbar { diff --git a/src/pages/Config.tsx b/src/pages/Config.tsx index 48129b4..83b21de 100644 --- a/src/pages/Config.tsx +++ b/src/pages/Config.tsx @@ -61,10 +61,7 @@ const DNSQueryForm = () => { return (
- +
{ -
+
@@ -329,7 +327,7 @@ const ConfigForXd = () => { setUrlForLatencyTest(e.target?.value!)} + onChange={(e) => setUrlForLatencyTest(e.target.value)} />
diff --git a/src/pages/Setup.tsx b/src/pages/Setup.tsx index 0aa0c02..3dff91d 100644 --- a/src/pages/Setup.tsx +++ b/src/pages/Setup.tsx @@ -63,6 +63,7 @@ export default () => { } onSetupSuccess(id) + return } @@ -100,6 +101,7 @@ export default () => { }) } }) + return (
diff --git a/src/types.d.ts b/src/types.d.ts index 2e8d58a..338ebf0 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -1,7 +1,7 @@ declare module 'solid-js' { namespace JSX { interface Directives { - [name: string]: {} + [name: string]: unknown } } } diff --git a/tailwind.config.ts b/tailwind.config.ts index f98f450..29b9d50 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -1,5 +1,8 @@ +import daisyui from 'daisyui' +import { Config } from 'tailwindcss' + export default { content: ['./src/**/*.{css,tsx}'], - plugins: [require('daisyui')], + plugins: [daisyui], daisyui: { themes: true }, -} +} as Config