diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 0000000..f2fc834 --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,35 @@ +extends: eslint-config-dmitmel/presets/node +env: + browser: true +plugins: ["prettier"] + +settings: + node: + tryExtensions: [".tsx", ".ts", ".jsx", ".js", ".json", ".node"] + +ignorePatterns: ["src/arrpc/**"] + +rules: + prettier/prettier: + - error + node/no-unsupported-features/es-syntax: + - error + - ignores: + - modules + +overrides: + - files: "**/*.ts*" + extends: + - eslint-config-dmitmel/presets/typescript-addon + parserOptions: + project: "tsconfig.json" + sourceType: module + rules: + eqeqeq: 0 + require-await: 0 + no-undefined: 0 + node/no-unsupported-features/es-syntax: 0 + "@typescript-eslint/no-dynamic-delete": 0 + "@typescript-eslint/no-explicit-any": 0 + "@typescript-eslint/no-non-null-asserted-optional-chain": 0 + "@typescript-eslint/naming-convention": 0 diff --git a/package.json b/package.json index 8f6f5ba..0042b74 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,9 @@ "version": "3.2.0", "description": "ArmCord is a custom client designed to enhance your Discord experience while keeping everything lightweight.", "main": "ts-out/main.js", + "engines": { + "node": ">=18.0.0" + }, "scripts": { "build": "tsc && copyfiles -u 1 src/**/*.html src/**/**/*.css src/**/**/*.js ts-out/ && copyfiles package.json ts-out/ && copyfiles assets/**/** ts-out/", "watch": "tsc -w", @@ -11,6 +14,7 @@ "package": "npm run build && electron-builder", "packageQuick": "npm run build && electron-builder --dir", "format": "prettier --write src *.json", + "lint": "eslint src --ext .js,.jsx,.ts,.tsx --ignore-path .gitignore", "CIbuild": "npm run build && electron-builder --linux zip && electron-builder --windows zip && electron-builder --macos zip", "prepare": "git config --local core.hooksPath .hooks/" }, @@ -27,10 +31,16 @@ "devDependencies": { "@types/node": "^18.11.9", "@types/ws": "^8.5.3", + "@typescript-eslint/eslint-plugin": "^5.59.2", + "@typescript-eslint/parser": "^5.59.2", "chalk-cli": "^5.0.0", "copyfiles": "^2.4.1", "electron": "^24.1.2", "electron-builder": "^23.6.0", + "eslint": "^8.40.0", + "eslint-config-dmitmel": "github:dmitmel/eslint-config-dmitmel", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-prettier": "^4.2.1", "prettier": "^2.7.1", "typescript": "^4.9.3" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1e608b7..d51b96f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30,6 +30,12 @@ devDependencies: '@types/ws': specifier: ^8.5.3 version: 8.5.3 + '@typescript-eslint/eslint-plugin': + specifier: ^5.59.2 + version: 5.59.2(@typescript-eslint/parser@5.59.2)(eslint@8.40.0)(typescript@4.9.3) + '@typescript-eslint/parser': + specifier: ^5.59.2 + version: 5.59.2(eslint@8.40.0)(typescript@4.9.3) chalk-cli: specifier: ^5.0.0 version: 5.0.0 @@ -42,6 +48,18 @@ devDependencies: electron-builder: specifier: ^23.6.0 version: 23.6.0 + eslint: + specifier: ^8.40.0 + version: 8.40.0 + eslint-config-dmitmel: + specifier: github:dmitmel/eslint-config-dmitmel + version: github.com/dmitmel/eslint-config-dmitmel/690f1b1121d342fcc8ee511ca9f2af7502f53db6(eslint@8.40.0) + eslint-plugin-node: + specifier: ^11.1.0 + version: 11.1.0(eslint@8.40.0) + eslint-plugin-prettier: + specifier: ^4.2.1 + version: 4.2.1(eslint@8.40.0)(prettier@2.7.1) prettier: specifier: ^2.7.1 version: 2.7.1 @@ -115,6 +133,63 @@ packages: - supports-color dev: true + /@eslint-community/eslint-utils@4.4.0(eslint@8.40.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.40.0 + eslint-visitor-keys: 3.4.1 + dev: true + + /@eslint-community/regexpp@4.5.1: + resolution: {integrity: sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + dev: true + + /@eslint/eslintrc@2.0.3: + resolution: {integrity: sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + ajv: 6.12.6 + debug: 4.3.4 + espree: 9.5.2 + globals: 13.20.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: true + + /@eslint/js@8.40.0: + resolution: {integrity: sha512-ElyB54bJIhXQYVKjDSvCkPO1iU1tSAeVQJbllWJq1XQSmmA4dgFk8CbiBGpiOPxleE48vDogxCtmMYku4HSVLA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + + /@humanwhocodes/config-array@0.11.8: + resolution: {integrity: sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==} + engines: {node: '>=10.10.0'} + dependencies: + '@humanwhocodes/object-schema': 1.2.1 + debug: 4.3.4 + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@humanwhocodes/module-importer@1.0.1: + resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} + engines: {node: '>=12.22'} + dev: true + + /@humanwhocodes/object-schema@1.2.1: + resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} + dev: true + /@malept/cross-spawn-promise@1.1.1: resolution: {integrity: sha512-RTBGWL5FWQcg9orDOCcp4LvItNzUPcyEU9bwaeJX0rJ1IQxzucC48Y0/sQLp/g6t99IQgAlGIaesJS+gTn7tVQ==} engines: {node: '>= 10'} @@ -134,6 +209,27 @@ packages: - supports-color dev: true + /@nodelib/fs.scandir@2.1.5: + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} + engines: {node: '>= 8'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + dev: true + + /@nodelib/fs.stat@2.0.5: + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} + engines: {node: '>= 8'} + dev: true + + /@nodelib/fs.walk@1.2.8: + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} + engines: {node: '>= 8'} + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.15.0 + dev: true + /@sindresorhus/is@4.6.0: resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} engines: {node: '>=10'} @@ -181,6 +277,10 @@ packages: /@types/http-cache-semantics@4.0.1: resolution: {integrity: sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==} + /@types/json-schema@7.0.11: + resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==} + dev: true + /@types/keyv@3.1.4: resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} dependencies: @@ -223,6 +323,10 @@ packages: dependencies: '@types/node': 18.15.11 + /@types/semver@7.3.13: + resolution: {integrity: sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==} + dev: true + /@types/verror@1.10.6: resolution: {integrity: sha512-NNm+gdePAX1VGvPcGZCDKQZKYSiAWigKhKaz5KF94hG6f2s8de9Ow5+7AbXoeKxL8gavZfk4UquSAygOF2duEQ==} requiresBuild: true @@ -252,6 +356,150 @@ packages: '@types/node': 18.11.9 optional: true + /@typescript-eslint/eslint-plugin@5.59.2(@typescript-eslint/parser@5.59.2)(eslint@8.40.0)(typescript@4.9.3): + resolution: {integrity: sha512-yVrXupeHjRxLDcPKL10sGQ/QlVrA8J5IYOEWVqk0lJaSZP7X5DfnP7Ns3cc74/blmbipQ1htFNVGsHX6wsYm0A==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + '@typescript-eslint/parser': ^5.0.0 + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@eslint-community/regexpp': 4.5.1 + '@typescript-eslint/parser': 5.59.2(eslint@8.40.0)(typescript@4.9.3) + '@typescript-eslint/scope-manager': 5.59.2 + '@typescript-eslint/type-utils': 5.59.2(eslint@8.40.0)(typescript@4.9.3) + '@typescript-eslint/utils': 5.59.2(eslint@8.40.0)(typescript@4.9.3) + debug: 4.3.4 + eslint: 8.40.0 + grapheme-splitter: 1.0.4 + ignore: 5.2.4 + natural-compare-lite: 1.4.0 + semver: 7.3.8 + tsutils: 3.21.0(typescript@4.9.3) + typescript: 4.9.3 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/parser@5.59.2(eslint@8.40.0)(typescript@4.9.3): + resolution: {integrity: sha512-uq0sKyw6ao1iFOZZGk9F8Nro/8+gfB5ezl1cA06SrqbgJAt0SRoFhb9pXaHvkrxUpZaoLxt8KlovHNk8Gp6/HQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/scope-manager': 5.59.2 + '@typescript-eslint/types': 5.59.2 + '@typescript-eslint/typescript-estree': 5.59.2(typescript@4.9.3) + debug: 4.3.4 + eslint: 8.40.0 + typescript: 4.9.3 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/scope-manager@5.59.2: + resolution: {integrity: sha512-dB1v7ROySwQWKqQ8rEWcdbTsFjh2G0vn8KUyvTXdPoyzSL6lLGkiXEV5CvpJsEe9xIdKV+8Zqb7wif2issoOFA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + '@typescript-eslint/types': 5.59.2 + '@typescript-eslint/visitor-keys': 5.59.2 + dev: true + + /@typescript-eslint/type-utils@5.59.2(eslint@8.40.0)(typescript@4.9.3): + resolution: {integrity: sha512-b1LS2phBOsEy/T381bxkkywfQXkV1dWda/z0PhnIy3bC5+rQWQDS7fk9CSpcXBccPY27Z6vBEuaPBCKCgYezyQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: '*' + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/typescript-estree': 5.59.2(typescript@4.9.3) + '@typescript-eslint/utils': 5.59.2(eslint@8.40.0)(typescript@4.9.3) + debug: 4.3.4 + eslint: 8.40.0 + tsutils: 3.21.0(typescript@4.9.3) + typescript: 4.9.3 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/types@5.59.2: + resolution: {integrity: sha512-LbJ/HqoVs2XTGq5shkiKaNTuVv5tTejdHgfdjqRUGdYhjW1crm/M7og2jhVskMt8/4wS3T1+PfFvL1K3wqYj4w==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + + /@typescript-eslint/typescript-estree@5.59.2(typescript@4.9.3): + resolution: {integrity: sha512-+j4SmbwVmZsQ9jEyBMgpuBD0rKwi9RxRpjX71Brr73RsYnEr3Lt5QZ624Bxphp8HUkSKfqGnPJp1kA5nl0Sh7Q==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 5.59.2 + '@typescript-eslint/visitor-keys': 5.59.2 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + semver: 7.3.8 + tsutils: 3.21.0(typescript@4.9.3) + typescript: 4.9.3 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/utils@5.59.2(eslint@8.40.0)(typescript@4.9.3): + resolution: {integrity: sha512-kSuF6/77TZzyGPhGO4uVp+f0SBoYxCDf+lW3GKhtKru/L8k/Hd7NFQxyWUeY7Z/KGB2C6Fe3yf2vVi4V9TsCSQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.40.0) + '@types/json-schema': 7.0.11 + '@types/semver': 7.3.13 + '@typescript-eslint/scope-manager': 5.59.2 + '@typescript-eslint/types': 5.59.2 + '@typescript-eslint/typescript-estree': 5.59.2(typescript@4.9.3) + eslint: 8.40.0 + eslint-scope: 5.1.1 + semver: 7.3.8 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + + /@typescript-eslint/visitor-keys@5.59.2: + resolution: {integrity: sha512-EEpsO8m3RASrKAHI9jpavNv9NlEUebV4qmF1OWxSTtKSFBpC1NCmWazDQHFivRf0O1DV11BA645yrLEVQ0/Lig==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + '@typescript-eslint/types': 5.59.2 + eslint-visitor-keys: 3.4.1 + dev: true + + /acorn-jsx@5.3.2(acorn@8.8.2): + resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + acorn: 8.8.2 + dev: true + + /acorn@8.8.2: + resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} + engines: {node: '>=0.4.0'} + hasBin: true + dev: true + /agent-base@6.0.2: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} @@ -342,6 +590,11 @@ packages: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} dev: true + /array-union@2.1.0: + resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} + engines: {node: '>=8'} + dev: true + /arrify@1.0.1: resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==} engines: {node: '>=0.10.0'} @@ -426,6 +679,13 @@ packages: balanced-match: 1.0.2 dev: true + /braces@3.0.2: + resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} + engines: {node: '>=8'} + dependencies: + fill-range: 7.0.1 + dev: true + /buffer-alloc-unsafe@1.1.0: resolution: {integrity: sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==} dev: true @@ -512,6 +772,11 @@ packages: normalize-url: 6.1.0 responselike: 2.0.1 + /callsites@3.1.0: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} + engines: {node: '>=6'} + dev: true + /camelcase-keys@7.0.2: resolution: {integrity: sha512-Rjs1H+A9R+Ig+4E/9oyB66UC5Mj9Xq3N//vcLf2WzgdTi/3gUu3Z9KoqmlrEG4VuuLK8wJHofxzdQXz/knhiYg==} engines: {node: '>=12'} @@ -750,6 +1015,10 @@ packages: dependencies: mimic-response: 3.1.0 + /deep-is@0.1.4: + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + dev: true + /defer-to-connect@2.0.1: resolution: {integrity: sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==} engines: {node: '>=10'} @@ -781,6 +1050,13 @@ packages: minimatch: 3.0.4 dev: true + /dir-glob@3.0.1: + resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} + engines: {node: '>=8'} + dependencies: + path-type: 4.0.0 + dev: true + /dmg-builder@23.6.0: resolution: {integrity: sha512-jFZvY1JohyHarIAlTbfQOk+HnceGjjAdFjVn3n8xlDWKsYNqbO4muca6qXEZTfGXeQMG7TYim6CeS5XKSfSsGA==} dependencies: @@ -814,6 +1090,13 @@ packages: dev: true optional: true + /doctrine@3.0.0: + resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} + engines: {node: '>=6.0.0'} + dependencies: + esutils: 2.0.3 + dev: true + /dot-prop@6.0.1: resolution: {integrity: sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==} engines: {node: '>=10'} @@ -953,7 +1236,168 @@ packages: /escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} - optional: true + + /eslint-plugin-es@3.0.1(eslint@8.40.0): + resolution: {integrity: sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==} + engines: {node: '>=8.10.0'} + peerDependencies: + eslint: '>=4.19.1' + dependencies: + eslint: 8.40.0 + eslint-utils: 2.1.0 + regexpp: 3.2.0 + dev: true + + /eslint-plugin-node@11.1.0(eslint@8.40.0): + resolution: {integrity: sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==} + engines: {node: '>=8.10.0'} + peerDependencies: + eslint: '>=5.16.0' + dependencies: + eslint: 8.40.0 + eslint-plugin-es: 3.0.1(eslint@8.40.0) + eslint-utils: 2.1.0 + ignore: 5.2.4 + minimatch: 3.1.2 + resolve: 1.22.2 + semver: 6.3.0 + dev: true + + /eslint-plugin-prettier@4.2.1(eslint@8.40.0)(prettier@2.7.1): + resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==} + engines: {node: '>=12.0.0'} + peerDependencies: + eslint: '>=7.28.0' + eslint-config-prettier: '*' + prettier: '>=2.0.0' + peerDependenciesMeta: + eslint-config-prettier: + optional: true + dependencies: + eslint: 8.40.0 + prettier: 2.7.1 + prettier-linter-helpers: 1.0.0 + dev: true + + /eslint-scope@5.1.1: + resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} + engines: {node: '>=8.0.0'} + dependencies: + esrecurse: 4.3.0 + estraverse: 4.3.0 + dev: true + + /eslint-scope@7.2.0: + resolution: {integrity: sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + esrecurse: 4.3.0 + estraverse: 5.3.0 + dev: true + + /eslint-utils@2.1.0: + resolution: {integrity: sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==} + engines: {node: '>=6'} + dependencies: + eslint-visitor-keys: 1.3.0 + dev: true + + /eslint-visitor-keys@1.3.0: + resolution: {integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==} + engines: {node: '>=4'} + dev: true + + /eslint-visitor-keys@3.4.1: + resolution: {integrity: sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + + /eslint@8.40.0: + resolution: {integrity: sha512-bvR+TsP9EHL3TqNtj9sCNJVAFK3fBN8Q7g5waghxyRsPLIMwL73XSKnZFK0hk/O2ANC+iAoq6PWMQ+IfBAJIiQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + hasBin: true + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.40.0) + '@eslint-community/regexpp': 4.5.1 + '@eslint/eslintrc': 2.0.3 + '@eslint/js': 8.40.0 + '@humanwhocodes/config-array': 0.11.8 + '@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.0 + eslint-visitor-keys: 3.4.1 + espree: 9.5.2 + 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.20.0 + grapheme-splitter: 1.0.4 + ignore: 5.2.4 + import-fresh: 3.3.0 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + is-path-inside: 3.0.3 + js-sdsl: 4.4.0 + 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.1 + strip-ansi: 6.0.1 + strip-json-comments: 3.1.1 + text-table: 0.2.0 + transitivePeerDependencies: + - supports-color + dev: true + + /espree@9.5.2: + resolution: {integrity: sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + acorn: 8.8.2 + acorn-jsx: 5.3.2(acorn@8.8.2) + eslint-visitor-keys: 3.4.1 + dev: true + + /esquery@1.5.0: + resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} + engines: {node: '>=0.10'} + dependencies: + estraverse: 5.3.0 + dev: true + + /esrecurse@4.3.0: + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} + engines: {node: '>=4.0'} + dependencies: + estraverse: 5.3.0 + dev: true + + /estraverse@4.3.0: + resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} + engines: {node: '>=4.0'} + dev: true + + /estraverse@5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + dev: true + + /esutils@2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + dev: true /ext-list@2.2.2: resolution: {integrity: sha512-u+SQgsubraE6zItfVA0tBuCBhfU9ogSRnsvygI7wht9TS510oLkBRXBsqopeUG/GBOIQyKZO9wjTqIu/sf5zFA==} @@ -995,22 +1439,61 @@ packages: requiresBuild: true dev: true + /fast-diff@1.2.0: + resolution: {integrity: sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==} + dev: true + + /fast-glob@3.2.12: + resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} + engines: {node: '>=8.6.0'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.5 + dev: true + /fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} requiresBuild: true dev: true + /fast-levenshtein@2.0.6: + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + dev: true + + /fastq@1.15.0: + resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==} + dependencies: + reusify: 1.0.4 + dev: true + /fd-slicer@1.1.0: resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==} dependencies: pend: 1.2.0 + /file-entry-cache@6.0.1: + resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} + engines: {node: ^10.12.0 || >=12.0.0} + dependencies: + flat-cache: 3.0.4 + dev: true + /filelist@1.0.4: resolution: {integrity: sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==} dependencies: minimatch: 5.1.0 dev: true + /fill-range@7.0.1: + resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} + engines: {node: '>=8'} + dependencies: + to-regex-range: 5.0.1 + dev: true + /find-up@5.0.0: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} @@ -1019,6 +1502,18 @@ packages: path-exists: 4.0.0 dev: true + /flat-cache@3.0.4: + resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==} + engines: {node: ^10.12.0 || >=12.0.0} + dependencies: + flatted: 3.2.7 + rimraf: 3.0.2 + dev: true + + /flatted@3.2.7: + resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==} + dev: true + /form-data@4.0.0: resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} engines: {node: '>= 6'} @@ -1093,6 +1588,20 @@ packages: dependencies: pump: 3.0.0 + /glob-parent@5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + dependencies: + is-glob: 4.0.3 + dev: true + + /glob-parent@6.0.2: + resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} + engines: {node: '>=10.13.0'} + dependencies: + is-glob: 4.0.3 + dev: true + /glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} dependencies: @@ -1117,6 +1626,13 @@ packages: serialize-error: 7.0.1 optional: true + /globals@13.20.0: + resolution: {integrity: sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==} + engines: {node: '>=8'} + dependencies: + type-fest: 0.20.2 + dev: true + /globalthis@1.0.3: resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} engines: {node: '>= 0.4'} @@ -1124,6 +1640,18 @@ packages: define-properties: 1.1.4 optional: true + /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.2.12 + ignore: 5.2.4 + merge2: 1.4.1 + slash: 3.0.0 + dev: true + /got@11.8.6: resolution: {integrity: sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==} engines: {node: '>=10.19.0'} @@ -1147,6 +1675,10 @@ packages: resolution: {integrity: sha512-8tLu60LgxF6XpdbK8OW3FA+IfTNBn1ZHGHKF4KQbEeSkajYw5PlYJcKluntgegDPTg8UkHjpet1T82vk6TQ68w==} dev: true + /grapheme-splitter@1.0.4: + resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} + dev: true + /hard-rejection@2.1.0: resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} engines: {node: '>=6'} @@ -1241,6 +1773,24 @@ packages: dev: true optional: true + /ignore@5.2.4: + resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} + engines: {node: '>= 4'} + dev: true + + /import-fresh@3.3.0: + resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} + engines: {node: '>=6'} + dependencies: + parent-module: 1.0.1 + resolve-from: 4.0.0 + dev: true + + /imurmurhash@0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + dev: true + /indent-string@5.0.0: resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} engines: {node: '>=12'} @@ -1274,15 +1824,37 @@ packages: has: 1.0.3 dev: true + /is-extglob@2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + dev: true + /is-fullwidth-code-point@3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} + /is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + dependencies: + is-extglob: 2.1.1 + dev: true + + /is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + dev: true + /is-obj@2.0.0: resolution: {integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==} engines: {node: '>=8'} dev: true + /is-path-inside@3.0.3: + resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} + engines: {node: '>=8'} + dev: true + /is-plain-obj@1.1.0: resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} engines: {node: '>=0.10.0'} @@ -1322,6 +1894,10 @@ packages: minimatch: 3.1.2 dev: true + /js-sdsl@4.4.0: + resolution: {integrity: sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==} + dev: true + /js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} dev: true @@ -1345,6 +1921,10 @@ packages: requiresBuild: true dev: true + /json-stable-stringify-without-jsonify@1.0.1: + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + dev: true + /json-stringify-safe@5.0.1: resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} optional: true @@ -1382,6 +1962,14 @@ packages: resolution: {integrity: sha512-0/BnGCCfyUMkBpeDgWihanIAF9JmZhHBgUhEqzvf+adhNGLoP6TaiI5oF8oyb3I45P+PcnrqihSf01M0l0G5+Q==} dev: true + /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: true + /lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} dev: true @@ -1393,6 +1981,10 @@ packages: p-locate: 5.0.0 dev: true + /lodash.merge@4.6.2: + resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + dev: true + /lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} dev: true @@ -1442,6 +2034,19 @@ packages: yargs-parser: 20.2.9 dev: true + /merge2@1.4.1: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} + dev: true + + /micromatch@4.0.5: + resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} + engines: {node: '>=8.6'} + dependencies: + braces: 3.0.2 + picomatch: 2.3.1 + dev: true + /mime-db@1.52.0: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} engines: {node: '>= 0.6'} @@ -1537,6 +2142,14 @@ packages: /ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + /natural-compare-lite@1.4.0: + resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} + dev: true + + /natural-compare@1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + dev: true + /node-addon-api@1.7.2: resolution: {integrity: sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==} requiresBuild: true @@ -1586,6 +2199,18 @@ packages: dependencies: wrappy: 1.0.2 + /optionator@0.9.1: + resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==} + engines: {node: '>= 0.8.0'} + dependencies: + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.4.1 + prelude-ls: 1.2.1 + type-check: 0.4.0 + word-wrap: 1.2.3 + dev: true + /p-cancelable@2.1.1: resolution: {integrity: sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==} engines: {node: '>=8'} @@ -1604,6 +2229,13 @@ packages: p-limit: 3.1.0 dev: true + /parent-module@1.0.1: + resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} + engines: {node: '>=6'} + dependencies: + callsites: 3.1.0 + dev: true + /parse-json@5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} @@ -1628,9 +2260,23 @@ packages: engines: {node: '>=8'} dev: true + /path-parse@1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + dev: true + + /path-type@4.0.0: + resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} + engines: {node: '>=8'} + dev: true + /pend@1.2.0: resolution: {integrity: sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==} + /picomatch@2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + dev: true + /plist@3.0.6: resolution: {integrity: sha512-WiIVYyrp8TD4w8yCvyeIr+lkmrGRd5u0VbRnU+tP/aRLxP/YadJUYOMZJ/6hIa3oUyVCsycXvtNRgd5XBJIbiA==} engines: {node: '>=6'} @@ -1639,6 +2285,18 @@ packages: xmlbuilder: 15.1.1 dev: true + /prelude-ls@1.2.1: + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} + engines: {node: '>= 0.8.0'} + dev: true + + /prettier-linter-helpers@1.0.0: + resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==} + engines: {node: '>=6.0.0'} + dependencies: + fast-diff: 1.2.0 + dev: true + /prettier@2.7.1: resolution: {integrity: sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==} engines: {node: '>=10.13.0'} @@ -1672,6 +2330,10 @@ packages: escape-goat: 2.1.1 dev: false + /queue-microtask@1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + dev: true + /quick-lru@5.1.1: resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==} engines: {node: '>=10'} @@ -1735,6 +2397,11 @@ packages: strip-indent: 4.0.0 dev: true + /regexpp@3.2.0: + resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==} + engines: {node: '>=8'} + dev: true + /require-directory@2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} @@ -1743,11 +2410,30 @@ packages: /resolve-alpn@1.2.1: resolution: {integrity: sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==} + /resolve-from@4.0.0: + resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} + engines: {node: '>=4'} + dev: true + + /resolve@1.22.2: + resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==} + hasBin: true + dependencies: + is-core-module: 2.11.0 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: true + /responselike@2.0.1: resolution: {integrity: sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==} dependencies: lowercase-keys: 2.0.0 + /reusify@1.0.4: + resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + dev: true + /rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} hasBin: true @@ -1767,6 +2453,12 @@ packages: sprintf-js: 1.1.2 optional: true + /run-parallel@1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + dependencies: + queue-microtask: 1.2.3 + dev: true + /safe-buffer@5.1.2: resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} dev: true @@ -1831,6 +2523,11 @@ packages: semver: 7.0.0 dev: true + /slash@3.0.0: + resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} + engines: {node: '>=8'} + dev: true + /slice-ansi@3.0.0: resolution: {integrity: sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==} engines: {node: '>=8'} @@ -1934,6 +2631,11 @@ packages: min-indent: 1.0.1 dev: true + /strip-json-comments@3.1.1: + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} + engines: {node: '>=8'} + dev: true + /sumchecker@3.0.1: resolution: {integrity: sha512-MvjXzkz/BOfyVDkG0oFOtBxHX2u3gKbMHIF/dXblZsgD3BWOFLmHovIpZY7BykJdAjcqRCBi1WYBNdEC9yI7vg==} engines: {node: '>= 8.0'} @@ -1956,6 +2658,11 @@ packages: has-flag: 4.0.0 dev: true + /supports-preserve-symlinks-flag@1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + dev: true + /tar@6.1.12: resolution: {integrity: sha512-jU4TdemS31uABHd+Lt5WEYJuzn+TJTCBLljvIAHZOz6M9Os5pJ4dD+vRFLxPa/n3T0iEFzpi+0x1UfuDZYbRMw==} engines: {node: '>=10'} @@ -1975,6 +2682,10 @@ packages: fs-extra: 10.1.0 dev: true + /text-table@0.2.0: + resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} + dev: true + /through2@2.0.5: resolution: {integrity: sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==} dependencies: @@ -1995,6 +2706,13 @@ packages: rimraf: 3.0.2 dev: true + /to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + dependencies: + is-number: 7.0.0 + dev: true + /tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} dev: false @@ -2010,11 +2728,37 @@ packages: utf8-byte-length: 1.0.4 dev: true + /tslib@1.14.1: + resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} + dev: true + + /tsutils@3.21.0(typescript@4.9.3): + resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} + engines: {node: '>= 6'} + peerDependencies: + typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' + dependencies: + tslib: 1.14.1 + typescript: 4.9.3 + dev: true + + /type-check@0.4.0: + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: 1.2.1 + dev: true + /type-fest@0.13.1: resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} engines: {node: '>=10'} optional: true + /type-fest@0.20.2: + resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} + engines: {node: '>=10'} + dev: true + /type-fest@1.4.0: resolution: {integrity: sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==} engines: {node: '>=10'} @@ -2104,6 +2848,11 @@ packages: isexe: 2.0.0 dev: true + /word-wrap@1.2.3: + resolution: {integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==} + engines: {node: '>=0.10.0'} + dev: true + /wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} @@ -2216,6 +2965,18 @@ packages: electron-is-dev: 2.0.0 dev: false + github.com/dmitmel/eslint-config-dmitmel/690f1b1121d342fcc8ee511ca9f2af7502f53db6(eslint@8.40.0): + resolution: {tarball: https://codeload.github.com/dmitmel/eslint-config-dmitmel/tar.gz/690f1b1121d342fcc8ee511ca9f2af7502f53db6} + id: github.com/dmitmel/eslint-config-dmitmel/690f1b1121d342fcc8ee511ca9f2af7502f53db6 + name: eslint-config-dmitmel + version: 8.2.2 + engines: {node: '>=8.10.0'} + peerDependencies: + eslint: '>=8.17.0' + dependencies: + eslint: 8.40.0 + dev: true + github.com/pykeio/vibe/3c61074414cbed96ad51870e4dde379b16d9da6d(electron@24.1.2): resolution: {tarball: https://codeload.github.com/pykeio/vibe/tar.gz/3c61074414cbed96ad51870e4dde379b16d9da6d} id: github.com/pykeio/vibe/3c61074414cbed96ad51870e4dde379b16d9da6d diff --git a/src/content/js/disableAutogain.js b/src/content/js/disableAutogain.js index 186d56b..e53e88a 100644 --- a/src/content/js/disableAutogain.js +++ b/src/content/js/disableAutogain.js @@ -65,7 +65,7 @@ function disableAutogain(constraints) { function patchFunction(object, name, createNewFunction) { if (name in object) { - var original = object[name]; + const original = object[name]; object[name] = createNewFunction(original); } } diff --git a/src/extensions/mods.ts b/src/extensions/mods.ts index 061e513..251e507 100644 --- a/src/extensions/mods.ts +++ b/src/extensions/mods.ts @@ -1,7 +1,7 @@ import electron from "electron"; import {getConfig} from "../utils"; -const unstrictCSP = () => { +const unstrictCSP = (): void => { console.log("Setting up CSP unstricter..."); electron.session.defaultSession.webRequest.onHeadersReceived(({responseHeaders, resourceType}, done) => { @@ -15,7 +15,7 @@ const unstrictCSP = () => { responseHeaders["content-type"] = ["text/css"]; } - done({responseHeaders}); + return done({responseHeaders}); }); }; diff --git a/src/extensions/plugin.ts b/src/extensions/plugin.ts index b68be0b..f33056a 100644 --- a/src/extensions/plugin.ts +++ b/src/extensions/plugin.ts @@ -1,7 +1,7 @@ import * as fs from "fs"; import {app, session} from "electron"; const userDataPath = app.getPath("userData"); -const pluginFolder = userDataPath + "/plugins/"; +const pluginFolder = `${userDataPath}/plugins`; if (!fs.existsSync(pluginFolder)) { fs.mkdirSync(pluginFolder); console.log("Created missing plugin folder"); @@ -9,9 +9,9 @@ if (!fs.existsSync(pluginFolder)) { app.whenReady().then(() => { fs.readdirSync(pluginFolder).forEach((file) => { try { - const manifest = fs.readFileSync(`${userDataPath}/plugins/${file}/manifest.json`, "utf8"); - var pluginFile = JSON.parse(manifest); - session.defaultSession.loadExtension(`${userDataPath}/plugins/${file}`); + const manifest = fs.readFileSync(`${pluginFolder}/${file}/manifest.json`, "utf8"); + const pluginFile = JSON.parse(manifest); + session.defaultSession.loadExtension(`${pluginFolder}/${file}`); console.log(`[Mod loader] Loaded ${pluginFile.name} made by ${pluginFile.author}`); } catch (err) { console.error(err); diff --git a/src/ipc.ts b/src/ipc.ts index 700d128..194c09b 100644 --- a/src/ipc.ts +++ b/src/ipc.ts @@ -1,44 +1,42 @@ //ipc stuff -import {app, ipcMain, shell, desktopCapturer, nativeImage, screen} from "electron"; +import {app, desktopCapturer, ipcMain, nativeImage, shell} from "electron"; import {mainWindow} from "./window"; import { - setConfigBulk, - getVersion, getConfig, - setLang, - getLang, - getWindowState, - packageVersion, getDisplayVersion, + getLang, + getVersion, + getWindowState, modInstallState, - installModLoader + packageVersion, + setConfigBulk, + setLang } from "./utils"; import {customTitlebar} from "./main"; import {createSettingsWindow} from "./settings/main"; import os from "os"; -import fs from "fs"; import path from "path"; -export function registerIpc() { - ipcMain.on("get-app-path", (event, arg) => { +export function registerIpc(): void { + ipcMain.on("get-app-path", (event) => { event.reply("app-path", app.getAppPath()); }); - ipcMain.on("setLang", (event, lang: string) => { + ipcMain.on("setLang", (_event, lang: string) => { setLang(lang); }); - ipcMain.handle("getLang", (event, toGet: string) => { + ipcMain.handle("getLang", (_event, toGet: string) => { return getLang(toGet); }); - ipcMain.on("open-external-link", (event, href: string) => { + ipcMain.on("open-external-link", (_event, href: string) => { shell.openExternal(href); }); - ipcMain.on("setPing", (event, pingCount: number) => { + ipcMain.on("setPing", (_event, pingCount: number) => { switch (os.platform()) { case "linux" ?? "macos": app.setBadgeCount(pingCount); break; case "win32": if (pingCount > 0) { - var image = nativeImage.createFromPath(path.join(__dirname, "../", `/assets/ping.png`)); + let image = nativeImage.createFromPath(path.join(__dirname, "../", `/assets/ping.png`)); mainWindow.setOverlayIcon(image, "badgeCount"); } else { mainWindow.setOverlayIcon(null, "badgeCount"); @@ -46,28 +44,28 @@ export function registerIpc() { break; } }); - ipcMain.on("win-maximize", (event, arg) => { + ipcMain.on("win-maximize", () => { mainWindow.maximize(); }); - ipcMain.on("win-isMaximized", (event, arg) => { + ipcMain.on("win-isMaximized", (event) => { event.returnValue = mainWindow.isMaximized(); }); - ipcMain.on("win-isNormal", (event, arg) => { + ipcMain.on("win-isNormal", (event) => { event.returnValue = mainWindow.isNormal(); }); - ipcMain.on("win-minimize", (event, arg) => { + ipcMain.on("win-minimize", () => { mainWindow.minimize(); }); - ipcMain.on("win-unmaximize", (event, arg) => { + ipcMain.on("win-unmaximize", () => { mainWindow.unmaximize(); }); - ipcMain.on("win-show", (event, arg) => { + ipcMain.on("win-show", () => { mainWindow.show(); }); - ipcMain.on("win-hide", (event, arg) => { + ipcMain.on("win-hide", () => { mainWindow.hide(); }); - ipcMain.on("win-quit", (event, arg) => { + ipcMain.on("win-quit", () => { app.exit(); }); ipcMain.on("get-app-version", (event) => { @@ -83,14 +81,19 @@ export function registerIpc() { event.returnValue = packageVersion; }); ipcMain.on("splashEnd", async () => { + let width = 800, + height = 600, + isMaximized = true, + xValue = 0, + yValue = 0; try { - var width = (await getWindowState("width")) ?? 800; - var height = (await getWindowState("height")) ?? 600; - var isMaximized = (await getWindowState("isMaximized")) ?? false; - var xValue = await getWindowState("x"); - var yValue = await getWindowState("y"); - } catch (e) { - console.log("[Window state manager] No window state file found. Fallbacking to default values."); + width = (await getWindowState("width")) ?? 800; + height = (await getWindowState("height")) ?? 600; + isMaximized = (await getWindowState("isMaximized")) ?? false; + xValue = await getWindowState("x"); + yValue = await getWindowState("y"); + } catch (_e) { + console.log("[Window state manager] No window state file found. Falling back to default values."); mainWindow.setSize(800, 600); } if (isMaximized) { @@ -102,11 +105,11 @@ export function registerIpc() { console.log("[Window state manager] Not maximized."); } }); - ipcMain.on("restart", (event, arg) => { + ipcMain.on("restart", () => { app.relaunch(); app.exit(); }); - ipcMain.on("saveSettings", (event, args) => { + ipcMain.on("saveSettings", (_event, args) => { setConfigBulk(args); }); ipcMain.on("minimizeToTray", async (event) => { @@ -115,28 +118,28 @@ export function registerIpc() { ipcMain.on("channel", async (event) => { event.returnValue = await getConfig("channel"); }); - ipcMain.on("clientmod", async (event, arg) => { + ipcMain.on("clientmod", async (event) => { event.returnValue = await getConfig("mods"); }); - ipcMain.on("legacyCapturer", async (event, arg) => { + ipcMain.on("legacyCapturer", async (event) => { event.returnValue = await getConfig("useLegacyCapturer"); }); - ipcMain.on("trayIcon", async (event, arg) => { + ipcMain.on("trayIcon", async (event) => { event.returnValue = await getConfig("trayIcon"); }); - ipcMain.on("disableAutogain", async (event, arg) => { + ipcMain.on("disableAutogain", async (event) => { event.returnValue = await getConfig("disableAutogain"); }); - ipcMain.on("titlebar", (event, arg) => { + ipcMain.on("titlebar", (event) => { event.returnValue = customTitlebar; }); - ipcMain.on("mobileMode", async (event, arg) => { + ipcMain.on("mobileMode", async (event) => { event.returnValue = await getConfig("mobileMode"); }); - ipcMain.on("shouldPatch", async (event, arg) => { + ipcMain.on("shouldPatch", async (event) => { event.returnValue = await getConfig("automaticPatches"); }); - ipcMain.on("openSettingsWindow", (event, arg) => { + ipcMain.on("openSettingsWindow", () => { createSettingsWindow(); }); ipcMain.on("setting-armcordCSP", async (event) => { @@ -146,5 +149,5 @@ export function registerIpc() { event.returnValue = false; } }); - ipcMain.handle("DESKTOP_CAPTURER_GET_SOURCES", (event, opts) => desktopCapturer.getSources(opts)); + ipcMain.handle("DESKTOP_CAPTURER_GET_SOURCES", (_event, opts) => desktopCapturer.getSources(opts)); } diff --git a/src/main.ts b/src/main.ts index a43a08f..c109eaf 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,34 +1,32 @@ // Modules to control application life and create native browser window -import {app, BrowserWindow, crashReporter, session} from "electron"; +import {BrowserWindow, app, crashReporter, session} from "electron"; import "v8-compile-cache"; import { + Settings, checkForDataFolder, - getConfig, checkIfConfigExists, + getConfig, injectElectronFlags, - setConfig, installModLoader, - getConfigLocation + setConfig } from "./utils"; import "./extensions/mods"; import "./tray"; -import fs from "fs"; -import {createCustomWindow, createNativeWindow, createTransparentWindow, mainWindow} from "./window"; +import {createCustomWindow, createNativeWindow, createTransparentWindow} from "./window"; import path from "path"; -export var iconPath: string; -export var settings: any; -export var customTitlebar: boolean; -export var clientName: "ArmCord"; -async function args() { - var argNum = 2; +export let iconPath: string; +export let settings: any; +export let customTitlebar: boolean; +async function args(): Promise { + let argNum = 2; if (process.argv[0] == "electron") argNum++; - var args = process.argv[argNum]; + let args = process.argv[argNum]; if (args == undefined) return; if (args.startsWith("--")) return; //electron flag if (args.includes("=")) { - var e = args.split("="); - await setConfig(e[0], e[1]); - console.log("Setting " + e[0] + " to " + e[1]); + let e = args.split("="); + await setConfig(e[0] as keyof Settings, e[1]); + console.log(`Setting ${e[0]} to ${e[1]}`); app.relaunch(); app.exit(); } @@ -70,7 +68,7 @@ if (!app.requestSingleInstanceLock()) { } else { iconPath = path.join(__dirname, "../", "/assets/ac_icon_transparent.png"); } - async function init() { + async function init(): Promise { switch (await getConfig("windowStyle")) { case "default": createCustomWindow(); @@ -93,7 +91,7 @@ if (!app.requestSingleInstanceLock()) { } await init(); await installModLoader(); - session.fromPartition("some-partition").setPermissionRequestHandler((webContents, permission, callback) => { + session.fromPartition("some-partition").setPermissionRequestHandler((_webContents, permission, callback) => { if (permission === "notifications") { // Approves the permissions request callback(true); diff --git a/src/menu.ts b/src/menu.ts index 6ccae58..5cb7b09 100644 --- a/src/menu.ts +++ b/src/menu.ts @@ -3,7 +3,7 @@ import {mainWindow} from "./window"; import {getConfig} from "./utils"; import {createSettingsWindow} from "./settings/main"; -function paste(contents: any) { +function paste(contents: any): void { const contentTypes = clipboard.availableFormats().toString(); //Workaround: fix pasting the images. if (contentTypes.includes("image/") && contentTypes.includes("text/html")) { @@ -11,7 +11,7 @@ function paste(contents: any) { } contents.paste(); } -export async function setMenu() { +export async function setMenu(): Promise { if ((await getConfig("alternativePaste")) == true) { mainWindow.on("focus", function () { console.log("[Window state manager] Focus"); @@ -39,7 +39,7 @@ export async function setMenu() { globalShortcut.unregister("CmdOrCtrl+V"); }); } - var template: Electron.MenuItemConstructorOptions[] = [ + let template: Electron.MenuItemConstructorOptions[] = [ { label: "ArmCord", submenu: [ @@ -48,28 +48,28 @@ export async function setMenu() { { label: "Developer tools", accelerator: "CmdOrCtrl+Shift+I", - click: function () { + click() { BrowserWindow.getFocusedWindow()!.webContents.toggleDevTools(); } }, { label: "Open settings", accelerator: "CmdOrCtrl+Shift+'", - click: function () { + click() { createSettingsWindow(); } }, { label: "Reload", accelerator: "CmdOrCtrl+R", - click: function () { + click() { mainWindow.reload(); } }, { label: "Quit", accelerator: "CmdOrCtrl+Q", - click: function () { + click() { app.quit(); } } @@ -86,7 +86,7 @@ export async function setMenu() { { label: "Paste", accelerator: "CmdOrCtrl+V", - click: function () { + click() { paste(mainWindow.webContents); } }, diff --git a/src/preload/bridge.ts b/src/preload/bridge.ts index b6c2fd2..2bd710a 100644 --- a/src/preload/bridge.ts +++ b/src/preload/bridge.ts @@ -9,7 +9,7 @@ interface IPCSources { name: string; thumbnail: HTMLCanvasElement; } -async function getDisplayMediaSelector() { +async function getDisplayMediaSelector(): Promise { const sources: IPCSources[] = await desktopCapturer.getSources({ types: ["screen", "window"] }); @@ -54,7 +54,7 @@ contextBridge.exposeInMainWorld("armcord", { ipcRenderer.invoke("getLang", toGet).then((result) => { return result; }), - getDisplayMediaSelector: getDisplayMediaSelector, + getDisplayMediaSelector, version: ipcRenderer.sendSync("get-app-version", "app-version"), mods: ipcRenderer.sendSync("clientmod"), packageVersion: ipcRenderer.sendSync("get-package-version", "app-version"), @@ -63,9 +63,11 @@ contextBridge.exposeInMainWorld("armcord", { }); let windowCallback: (arg0: object) => void; contextBridge.exposeInMainWorld("ArmCordRPC", { - listen: (callback: any) => (windowCallback = callback) + listen: (callback: any) => { + windowCallback = callback; + } }); -ipcRenderer.on("rpc", (event, data: object) => { +ipcRenderer.on("rpc", (_event, data: object) => { windowCallback(data); }); //to be only used inside armcord internal setup/splash etc diff --git a/src/preload/capturer.ts b/src/preload/capturer.ts index a00a941..04852d6 100644 --- a/src/preload/capturer.ts +++ b/src/preload/capturer.ts @@ -1,6 +1,6 @@ //Fixed context isolation version https://github.com/getferdi/ferdi/blob/develop/src/webview/screenshare.ts //original https://github.com/electron/electron/issues/16513#issuecomment-602070250 -import {addStyle, addScript} from "../utils"; +import {addScript, addStyle} from "../utils"; import fs from "fs"; import path from "path"; diff --git a/src/preload/mobile.ts b/src/preload/mobile.ts index d1d03f0..f9d8c03 100644 --- a/src/preload/mobile.ts +++ b/src/preload/mobile.ts @@ -1,9 +1,8 @@ -import {ipcRenderer} from "electron"; import {addStyle} from "../utils"; import * as fs from "fs"; import * as path from "path"; -export function injectMobileStuff() { - document.addEventListener("DOMContentLoaded", function (event) { +export function injectMobileStuff(): void { + document.addEventListener("DOMContentLoaded", function () { const mobileCSS = path.join(__dirname, "../", "/content/css/mobile.css"); addStyle(fs.readFileSync(mobileCSS, "utf8")); // TO-DO: clicking on the logo, or additional button triggers ESC button to move around the UI quicker diff --git a/src/preload/patch.ts b/src/preload/patch.ts index fe05e4b..1d5567f 100644 --- a/src/preload/patch.ts +++ b/src/preload/patch.ts @@ -4,16 +4,16 @@ import {ipcRenderer} from "electron"; import {injectJS} from "../utils"; -var patchEndpoint = "https://patch.armcord.xyz/"; -var version = ipcRenderer.sendSync("get-app-version", "app-version"); +const patchEndpoint = "https://patch.armcord.xyz"; +const version = ipcRenderer.sendSync("get-app-version", "app-version"); if (ipcRenderer.sendSync("shouldPatch")) { document.addEventListener("DOMContentLoaded", function () { - fetch(patchEndpoint + version + "/info.json", {cache: "no-store"}) //lmao + fetch(`${patchEndpoint}/${version}/info.json`, {cache: "no-store"}) //lmao .then((res) => res.json()) .then((res) => { if (res.patch == true) { console.log("Found a patch. Injecting..."); - injectJS(patchEndpoint + version + "/patch.js"); + injectJS(`${patchEndpoint}/${version}/patch.js`); } else { console.log("No patches have been found."); } diff --git a/src/preload/preload.ts b/src/preload/preload.ts index 121ceab..d907b2c 100644 --- a/src/preload/preload.ts +++ b/src/preload/preload.ts @@ -15,9 +15,8 @@ if (ipcRenderer.sendSync("legacyCapturer")) { import("./capturer"); } -var version = ipcRenderer.sendSync("displayVersion"); -var channel = ipcRenderer.sendSync("channel"); -async function updateLang() { +const version = ipcRenderer.sendSync("displayVersion"); +async function updateLang(): Promise { if (window.location.href.indexOf("setup.html") > -1) { console.log("Setup, skipping lang update"); } else { @@ -32,8 +31,8 @@ declare global { } } -console.log("ArmCord " + version); -ipcRenderer.on("themeLoader", (event, message) => { +console.log(`ArmCord ${version}`); +ipcRenderer.on("themeLoader", (_event, message) => { addStyle(message); }); if (window.location.href.indexOf("splash.html") > -1) { diff --git a/src/preload/titlebar.ts b/src/preload/titlebar.ts index 5d869ad..5b516ff 100644 --- a/src/preload/titlebar.ts +++ b/src/preload/titlebar.ts @@ -3,9 +3,9 @@ import {addStyle} from "../utils"; import * as fs from "fs"; import * as path from "path"; import os from "os"; -export function injectTitlebar() { - document.addEventListener("DOMContentLoaded", function (event) { - var elem = document.createElement("div"); +export function injectTitlebar(): void { + document.addEventListener("DOMContentLoaded", function (_event) { + const elem = document.createElement("div"); elem.innerHTML = `