From 360e5217ace9d477d4d00b0caedb6dcc81fe56ee Mon Sep 17 00:00:00 2001 From: Pierluigi Viti Date: Wed, 21 Aug 2024 17:07:49 +0200 Subject: [PATCH] fix: fix lint issues --- .github/{ => workflows}/codeql-analysis.yml | 0 .github/{ => workflows}/publish.yml | 0 .github/{ => workflows}/semantic-release.yml | 0 package.json | 3 + pnpm-lock.yaml | 505 ++++++++++++++++++- src/action/base.ts | 15 +- src/action/simple.ts | 6 +- src/action/spinner.ts | 13 +- src/action/types.ts | 2 +- src/config.ts | 5 +- src/flush.ts | 10 +- src/index.ts | 10 +- src/prompt.ts | 12 +- src/screen.ts | 1 + src/stream.ts | 5 +- src/styled/object.ts | 8 +- src/styled/progress.ts | 2 +- src/styled/table.ts | 42 +- src/styled/tree.ts | 10 +- src/theme.ts | 1 + src/util.ts | 17 +- src/wait.ts | 2 +- 22 files changed, 597 insertions(+), 72 deletions(-) rename .github/{ => workflows}/codeql-analysis.yml (100%) rename .github/{ => workflows}/publish.yml (100%) rename .github/{ => workflows}/semantic-release.yml (100%) diff --git a/.github/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml similarity index 100% rename from .github/codeql-analysis.yml rename to .github/workflows/codeql-analysis.yml diff --git a/.github/publish.yml b/.github/workflows/publish.yml similarity index 100% rename from .github/publish.yml rename to .github/workflows/publish.yml diff --git a/.github/semantic-release.yml b/.github/workflows/semantic-release.yml similarity index 100% rename from .github/semantic-release.yml rename to .github/workflows/semantic-release.yml diff --git a/package.json b/package.json index e0698d8..3aafd5f 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,9 @@ "@types/wordwrap": "^1.0.3", "@typescript-eslint/eslint-plugin": "^7.18.0", "eslint": "^8.57.0", + "eslint-config-oclif": "^5.2.1", + "eslint-config-oclif-typescript": "^3.1.9", + "eslint-config-prettier": "^9.1.0", "jest": "^29.7.0", "oclif": "^4.14.22", "semantic-release": "^24.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 456b58d..58637c0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -101,10 +101,19 @@ importers: version: 1.0.3 '@typescript-eslint/eslint-plugin': specifier: ^7.18.0 - version: 7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4))(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4) + version: 7.18.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4))(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4) eslint: specifier: ^8.57.0 version: 8.57.0(supports-color@8.1.1) + eslint-config-oclif: + specifier: ^5.2.1 + version: 5.2.1(eslint@8.57.0(supports-color@8.1.1)) + eslint-config-oclif-typescript: + specifier: ^3.1.9 + version: 3.1.9(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4) + eslint-config-prettier: + specifier: ^9.1.0 + version: 9.1.0(eslint@8.57.0(supports-color@8.1.1)) jest: specifier: ^29.7.0 version: 29.7.0(@types/node@22.4.2)(supports-color@8.1.1) @@ -1709,6 +1718,9 @@ packages: '@types/js-yaml@3.12.10': resolution: {integrity: sha512-/Mtaq/wf+HxXpvhzFYzrzCqNRcA958sW++7JOFC8nPrZcvfi/TrzOaaGbvt27ltJB2NQbHVAg5a1wUCsyMH7NA==} + '@types/json-schema@7.0.15': + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + '@types/json5@0.0.29': resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} @@ -1742,6 +1754,17 @@ packages: '@types/yargs@17.0.33': resolution: {integrity: sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==} + '@typescript-eslint/eslint-plugin@6.21.0': + resolution: {integrity: sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==} + 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 + '@typescript-eslint/eslint-plugin@7.18.0': resolution: {integrity: sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==} engines: {node: ^18.18.0 || >=20.0.0} @@ -1781,6 +1804,16 @@ packages: resolution: {integrity: sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==} engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/type-utils@6.21.0': + resolution: {integrity: sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + '@typescript-eslint/type-utils@7.18.0': resolution: {integrity: sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==} engines: {node: ^18.18.0 || >=20.0.0} @@ -1817,6 +1850,12 @@ packages: typescript: optional: true + '@typescript-eslint/utils@6.21.0': + resolution: {integrity: sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + '@typescript-eslint/utils@7.18.0': resolution: {integrity: sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==} engines: {node: ^18.18.0 || >=20.0.0} @@ -2116,6 +2155,10 @@ packages: cjs-module-lexer@1.3.1: resolution: {integrity: sha512-a3KdPAANPbNE4ZUv9h6LckSl9zLsYOP4MBmhIPkRaeyybt+r4UghLvq+xw/YwUcC1gqylCkL4rdVs3Lwupjm4Q==} + clean-regexp@1.0.0: + resolution: {integrity: sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==} + engines: {node: '>=4'} + clean-stack@2.2.0: resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} engines: {node: '>=6'} @@ -2196,6 +2239,9 @@ packages: config-chain@1.1.13: resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==} + confusing-browser-globals@1.0.11: + resolution: {integrity: sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA==} + consola@3.2.3: resolution: {integrity: sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==} engines: {node: ^14.18.0 || >=16.10.0} @@ -2389,6 +2435,10 @@ packages: emojilib@2.4.0: resolution: {integrity: sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==} + enhanced-resolve@5.17.1: + resolution: {integrity: sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==} + engines: {node: '>=10.13.0'} + env-ci@11.0.0: resolution: {integrity: sha512-apikxMgkipkgTvMdRT9MNqWx5VLOci79F4VBd7Op/7OPjjoanjdAvn6fglMCCEf/1bAh8eOiuEVCUs4V3qP3nQ==} engines: {node: ^18.17 || >=20.6.1} @@ -2472,6 +2522,14 @@ packages: eslint-plugin-promise: ^6.0.0 typescript: '*' + eslint-config-oclif-typescript@3.1.9: + resolution: {integrity: sha512-sQ0PfzhMVhu3+oP/2LMQkcGSdtszwhUdw1Tb01QimEkg5PTVJp+8QlJkTytWp+6yVyVLUL2H/J4TgCtjJ/DQgA==} + engines: {node: '>=18.0.0'} + + eslint-config-oclif@5.2.1: + resolution: {integrity: sha512-f0I7oB3lkbEnTqH+F18tKNmZG78aDjiCWz7co0Zbz6s12k655jUvb6FtzHniCmATqaHfcVVdrOldBT6P3bKpxA==} + engines: {node: '>=18.0.0'} + eslint-config-prettier@9.1.0: resolution: {integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==} hasBin: true @@ -2487,9 +2545,28 @@ packages: eslint-plugin-n: '^15.0.0 || ^16.0.0 ' eslint-plugin-promise: ^6.0.0 + eslint-config-xo-space@0.35.0: + resolution: {integrity: sha512-+79iVcoLi3PvGcjqYDpSPzbLfqYpNcMlhsCBRsnmDoHAn4npJG6YxmHpelQKpXM7v/EeZTUKb4e1xotWlei8KA==} + engines: {node: '>=12'} + peerDependencies: + eslint: '>=8.56.0' + + eslint-config-xo@0.44.0: + resolution: {integrity: sha512-YG4gdaor0mJJi8UBeRJqDPO42MedTWYMaUyucF5bhm2pi/HS98JIxfFQmTLuyj6hGpQlAazNfyVnn7JuDn+Sew==} + engines: {node: '>=18'} + peerDependencies: + eslint: '>=8.56.0' + eslint-import-resolver-node@0.3.9: resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} + eslint-import-resolver-typescript@3.6.1: + resolution: {integrity: sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==} + engines: {node: ^14.18.0 || >=16.0.0} + peerDependencies: + eslint: '*' + eslint-plugin-import: '*' + eslint-module-utils@2.8.1: resolution: {integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==} engines: {node: '>=4'} @@ -2517,6 +2594,12 @@ packages: peerDependencies: eslint: '>=8' + eslint-plugin-es@4.1.0: + resolution: {integrity: sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ==} + engines: {node: '>=8.10.0'} + peerDependencies: + eslint: '>=4.19.1' + eslint-plugin-import@2.29.1: resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==} engines: {node: '>=4'} @@ -2527,12 +2610,42 @@ packages: '@typescript-eslint/parser': optional: true + eslint-plugin-mocha@10.5.0: + resolution: {integrity: sha512-F2ALmQVPT1GoP27O1JTZGrV9Pqg8k79OeIuvw63UxMtQKREZtmkK1NFgkZQ2TW7L2JSSFKHFPTtHu5z8R9QNRw==} + engines: {node: '>=14.0.0'} + peerDependencies: + eslint: '>=7.0.0' + + eslint-plugin-n@15.7.0: + resolution: {integrity: sha512-jDex9s7D/Qial8AGVIHq4W7NswpUD5DPDL2RH8Lzd9EloWUuvUkHfv4FRLMipH5q2UtyurorBkPeNi1wVWNh3Q==} + engines: {node: '>=12.22.0'} + peerDependencies: + eslint: '>=7.0.0' + eslint-plugin-n@16.6.2: resolution: {integrity: sha512-6TyDmZ1HXoFQXnhCTUjVFULReoBPOAjpuiKELMkeP40yffI/1ZRO+d9ug/VC6fqISo2WkuIBk3cvuRPALaWlOQ==} engines: {node: '>=16.0.0'} peerDependencies: eslint: '>=7.0.0' + eslint-plugin-perfectionist@2.11.0: + resolution: {integrity: sha512-XrtBtiu5rbQv88gl+1e2RQud9te9luYNvKIgM9emttQ2zutHPzY/AQUucwxscDKV4qlTkvLTxjOFvxqeDpPorw==} + peerDependencies: + astro-eslint-parser: ^1.0.2 + eslint: '>=8.0.0' + svelte: '>=3.0.0' + svelte-eslint-parser: ^0.37.0 + vue-eslint-parser: '>=9.0.0' + peerDependenciesMeta: + astro-eslint-parser: + optional: true + svelte: + optional: true + svelte-eslint-parser: + optional: true + vue-eslint-parser: + optional: true + eslint-plugin-prettier@5.2.1: resolution: {integrity: sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==} engines: {node: ^14.18.0 || >=16.0.0} @@ -2553,10 +2666,34 @@ packages: peerDependencies: eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 + eslint-plugin-unicorn@48.0.1: + resolution: {integrity: sha512-FW+4r20myG/DqFcCSzoumaddKBicIPeFnTrifon2mWIzlfyvzwyqZjqVP7m4Cqr/ZYisS2aiLghkUWaPg6vtCw==} + engines: {node: '>=16'} + peerDependencies: + eslint: '>=8.44.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-utils@2.1.0: + resolution: {integrity: sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==} + engines: {node: '>=6'} + + eslint-utils@3.0.0: + resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} + engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} + peerDependencies: + eslint: '>=5' + + eslint-visitor-keys@1.3.0: + resolution: {integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==} + engines: {node: '>=4'} + + eslint-visitor-keys@2.1.0: + resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==} + engines: {node: '>=10'} + 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} @@ -2894,6 +3031,9 @@ packages: resolution: {integrity: sha512-jHRQzjSDzMtFy34AGj1DN+vq54WVuhSvKgrHf0OMiFQTwDD4L/qqofVEWjLOBMTn5+lCD3fPg32W9yOfnEJTTw==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + hosted-git-info@2.8.9: + resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} + hosted-git-info@7.0.2: resolution: {integrity: sha512-puUZAUKT5m8Zzvs72XWy3HtvVbTWljRE66cP60bxJzAqf2DgICo7lYTY2IHUmLnNpjYvw5bvmoHvPc0QO2a62w==} engines: {node: ^16.14.0 || >=18.0.0} @@ -3329,6 +3469,11 @@ packages: engines: {node: '>=4'} hasBin: true + jsesc@3.0.2: + resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==} + engines: {node: '>=6'} + hasBin: true + json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} @@ -3498,6 +3643,10 @@ packages: resolution: {integrity: sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + min-indent@1.0.1: + resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} + engines: {node: '>=4'} + minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} @@ -3533,6 +3682,9 @@ packages: mz@2.7.0: resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} + natural-compare-lite@1.4.0: + resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} + natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} @@ -3559,6 +3711,9 @@ packages: node-releases@2.0.18: resolution: {integrity: sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==} + normalize-package-data@2.5.0: + resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} + normalize-package-data@6.0.2: resolution: {integrity: sha512-V6gygoYb/5EmNI+MEGrWkC+e6+Rr7mTmfHrxDbLzxQogBkgzo76rkok0Am6thgSF7Mv2nLOajAJj5vDJZEFn7g==} engines: {node: ^16.14.0 || >=18.0.0} @@ -3867,6 +4022,10 @@ packages: resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} engines: {node: '>=8'} + pluralize@8.0.0: + resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} + engines: {node: '>=4'} + possible-typed-array-names@1.0.0: resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} engines: {node: '>= 0.4'} @@ -3934,6 +4093,9 @@ packages: resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==} engines: {node: '>=10'} + rambda@7.5.0: + resolution: {integrity: sha512-y/M9weqWAH4iopRd7EHDEQQvpFPHj1AA3oHozE9tfITHUtTR7Z9PSlIRRG2l1GuW7sefC1cXFfIcF+cgnShdBA==} + rc@1.2.8: resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} hasBin: true @@ -3945,6 +4107,14 @@ packages: resolution: {integrity: sha512-MbgfoNPANMdb4oRBNg5eqLbB2t2r+o5Ua1pNt8BqGp4I0FJZhuVSOj3PaBPni4azWuSzEdNn2evevzVmEk1ohQ==} engines: {node: '>=18'} + read-pkg-up@7.0.1: + resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} + engines: {node: '>=8'} + + read-pkg@5.2.0: + resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} + engines: {node: '>=8'} + read-pkg@9.0.1: resolution: {integrity: sha512-9viLL4/n1BJUCT1NXVTdS1jtm80yDEgR5T4yCelII49Mbj0v1rZdKqj7zCiYdbB0CuCgdrvHcNogAKTFPBocFA==} engines: {node: '>=18'} @@ -3972,10 +4142,18 @@ packages: regenerator-transform@0.15.2: resolution: {integrity: sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg==} + regexp-tree@0.1.27: + resolution: {integrity: sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==} + hasBin: true + regexp.prototype.flags@1.5.2: resolution: {integrity: sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==} engines: {node: '>= 0.4'} + regexpp@3.2.0: + resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==} + engines: {node: '>=8'} + regexpu-core@5.3.2: resolution: {integrity: sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==} engines: {node: '>=4'} @@ -3984,6 +4162,10 @@ packages: resolution: {integrity: sha512-o/3ikDxtXaA59BmZuZrJZDJv8NMDGSj+6j6XaeBmHw8eY1i1qd9+6H+LjVvQXx3HN6aRCGa1cUdJ9RaJZUugnQ==} engines: {node: '>=14'} + regjsparser@0.10.0: + resolution: {integrity: sha512-qx+xQGZVsy55CH0a1hiVwHmqjLryfh7wQyF5HO07XJ9f7dQMY/gPQHhlyDkIzJKC+x2fUCpCcUODUUUFrm7SHA==} + hasBin: true + regjsparser@0.9.1: resolution: {integrity: sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==} hasBin: true @@ -4070,6 +4252,10 @@ packages: resolution: {integrity: sha512-hunMQrEy1T6Jr2uEVjrAIqjwWcQTgOAcIM52C8MY1EZSD3DDNft04XzvYKPqjED65bNVVko0YI38nYeEHCX3yw==} engines: {node: '>=12'} + semver@5.7.2: + resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} + hasBin: true + semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true @@ -4246,6 +4432,10 @@ packages: resolution: {integrity: sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==} engines: {node: '>=18'} + strip-indent@3.0.0: + resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} + engines: {node: '>=8'} + strip-json-comments@2.0.1: resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} engines: {node: '>=0.10.0'} @@ -4290,6 +4480,10 @@ packages: resolution: {integrity: sha512-7gr8p9TQP6RAHusBOSLs46F4564ZrjV8xFmw5zCmgmhGUcw2hxsShhJ6CEiHQMgPDwAQ1fWHPM0ypc4RMAig4A==} engines: {node: ^14.18.0 || >=16.0.0} + tapable@2.2.1: + resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} + engines: {node: '>=6'} + temp-dir@3.0.0: resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} engines: {node: '>=14.16'} @@ -4402,6 +4596,14 @@ packages: resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} engines: {node: '>=10'} + type-fest@0.6.0: + resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} + engines: {node: '>=8'} + + type-fest@0.8.1: + resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} + engines: {node: '>=8'} + type-fest@1.4.0: resolution: {integrity: sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==} engines: {node: '>=10'} @@ -7013,6 +7215,8 @@ snapshots: '@types/js-yaml@3.12.10': {} + '@types/json-schema@7.0.15': {} + '@types/json5@0.0.29': {} '@types/mute-stream@0.0.4': @@ -7041,6 +7245,44 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 + '@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4))(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4)': + dependencies: + '@eslint-community/regexpp': 4.11.0 + '@typescript-eslint/parser': 6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4) + '@typescript-eslint/scope-manager': 6.21.0 + '@typescript-eslint/type-utils': 6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4) + '@typescript-eslint/utils': 6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 6.21.0 + debug: 4.3.6(supports-color@8.1.1) + eslint: 8.57.0(supports-color@8.1.1) + graphemer: 1.4.0 + ignore: 5.3.2 + natural-compare: 1.4.0 + semver: 7.6.3 + ts-api-utils: 1.3.0(typescript@5.5.4) + optionalDependencies: + typescript: 5.5.4 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4))(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4)': + dependencies: + '@eslint-community/regexpp': 4.11.0 + '@typescript-eslint/parser': 6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4) + '@typescript-eslint/scope-manager': 7.18.0 + '@typescript-eslint/type-utils': 7.18.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4) + '@typescript-eslint/utils': 7.18.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 7.18.0 + eslint: 8.57.0(supports-color@8.1.1) + graphemer: 1.4.0 + ignore: 5.3.2 + natural-compare: 1.4.0 + ts-api-utils: 1.3.0(typescript@5.5.4) + optionalDependencies: + typescript: 5.5.4 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4))(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4)': dependencies: '@eslint-community/regexpp': 4.11.0 @@ -7095,6 +7337,18 @@ snapshots: '@typescript-eslint/types': 7.18.0 '@typescript-eslint/visitor-keys': 7.18.0 + '@typescript-eslint/type-utils@6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4)': + dependencies: + '@typescript-eslint/typescript-estree': 6.21.0(supports-color@8.1.1)(typescript@5.5.4) + '@typescript-eslint/utils': 6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4) + debug: 4.3.6(supports-color@8.1.1) + eslint: 8.57.0(supports-color@8.1.1) + ts-api-utils: 1.3.0(typescript@5.5.4) + optionalDependencies: + typescript: 5.5.4 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/type-utils@7.18.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4)': dependencies: '@typescript-eslint/typescript-estree': 7.18.0(supports-color@8.1.1)(typescript@5.5.4) @@ -7141,6 +7395,20 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/utils@6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4)': + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0(supports-color@8.1.1)) + '@types/json-schema': 7.0.15 + '@types/semver': 7.5.8 + '@typescript-eslint/scope-manager': 6.21.0 + '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/typescript-estree': 6.21.0(supports-color@8.1.1)(typescript@5.5.4) + eslint: 8.57.0(supports-color@8.1.1) + semver: 7.6.3 + transitivePeerDependencies: + - supports-color + - typescript + '@typescript-eslint/utils@7.18.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0(supports-color@8.1.1)) @@ -7516,6 +7784,10 @@ snapshots: cjs-module-lexer@1.3.1: {} + clean-regexp@1.0.0: + dependencies: + escape-string-regexp: 1.0.5 + clean-stack@2.2.0: {} clean-stack@3.0.1: @@ -7601,6 +7873,8 @@ snapshots: ini: 1.3.8 proto-list: 1.2.4 + confusing-browser-globals@1.0.11: {} + consola@3.2.3: {} constant-case@3.0.4: @@ -7780,6 +8054,11 @@ snapshots: emojilib@2.4.0: {} + enhanced-resolve@5.17.1: + dependencies: + graceful-fs: 4.2.11 + tapable: 2.2.1 + env-ci@11.0.0: dependencies: execa: 8.0.1 @@ -7923,6 +8202,36 @@ snapshots: transitivePeerDependencies: - supports-color + eslint-config-oclif-typescript@3.1.9(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4): + dependencies: + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4))(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4) + '@typescript-eslint/parser': 6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4) + eslint-config-xo-space: 0.35.0(eslint@8.57.0(supports-color@8.1.1)) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4))(eslint-plugin-import@2.29.1)(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4))(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1) + eslint-plugin-mocha: 10.5.0(eslint@8.57.0(supports-color@8.1.1)) + eslint-plugin-n: 15.7.0(eslint@8.57.0(supports-color@8.1.1)) + eslint-plugin-perfectionist: 2.11.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4) + transitivePeerDependencies: + - astro-eslint-parser + - eslint + - eslint-import-resolver-node + - eslint-import-resolver-webpack + - supports-color + - svelte + - svelte-eslint-parser + - typescript + - vue-eslint-parser + + eslint-config-oclif@5.2.1(eslint@8.57.0(supports-color@8.1.1)): + dependencies: + eslint-config-xo-space: 0.35.0(eslint@8.57.0(supports-color@8.1.1)) + eslint-plugin-mocha: 10.5.0(eslint@8.57.0(supports-color@8.1.1)) + eslint-plugin-n: 15.7.0(eslint@8.57.0(supports-color@8.1.1)) + eslint-plugin-unicorn: 48.0.1(eslint@8.57.0(supports-color@8.1.1)) + transitivePeerDependencies: + - eslint + eslint-config-prettier@9.1.0(eslint@8.57.0(supports-color@8.1.1)): dependencies: eslint: 8.57.0(supports-color@8.1.1) @@ -7934,6 +8243,16 @@ snapshots: eslint-plugin-n: 16.6.2(eslint@8.57.0(supports-color@8.1.1)) eslint-plugin-promise: 6.6.0(eslint@8.57.0(supports-color@8.1.1)) + eslint-config-xo-space@0.35.0(eslint@8.57.0(supports-color@8.1.1)): + dependencies: + eslint: 8.57.0(supports-color@8.1.1) + eslint-config-xo: 0.44.0(eslint@8.57.0(supports-color@8.1.1)) + + eslint-config-xo@0.44.0(eslint@8.57.0(supports-color@8.1.1)): + dependencies: + confusing-browser-globals: 1.0.11 + eslint: 8.57.0(supports-color@8.1.1) + eslint-import-resolver-node@0.3.9(supports-color@8.1.1): dependencies: debug: 3.2.7(supports-color@8.1.1) @@ -7942,6 +8261,44 @@ snapshots: transitivePeerDependencies: - supports-color + eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4))(eslint-plugin-import@2.29.1)(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1): + dependencies: + debug: 4.3.6(supports-color@8.1.1) + enhanced-resolve: 5.17.1 + eslint: 8.57.0(supports-color@8.1.1) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4))(eslint-plugin-import@2.29.1)(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1))(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4))(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1) + fast-glob: 3.3.2 + get-tsconfig: 4.7.6 + is-core-module: 2.15.0 + is-glob: 4.0.3 + transitivePeerDependencies: + - '@typescript-eslint/parser' + - eslint-import-resolver-node + - eslint-import-resolver-webpack + - supports-color + + eslint-module-utils@2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9(supports-color@8.1.1))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4))(eslint-plugin-import@2.29.1)(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1))(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1): + dependencies: + debug: 3.2.7(supports-color@8.1.1) + optionalDependencies: + '@typescript-eslint/parser': 6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4) + eslint: 8.57.0(supports-color@8.1.1) + eslint-import-resolver-node: 0.3.9(supports-color@8.1.1) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4))(eslint-plugin-import@2.29.1)(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1) + transitivePeerDependencies: + - supports-color + + eslint-module-utils@2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4))(eslint-plugin-import@2.29.1)(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1))(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1): + dependencies: + debug: 3.2.7(supports-color@8.1.1) + optionalDependencies: + '@typescript-eslint/parser': 6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4) + eslint: 8.57.0(supports-color@8.1.1) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4))(eslint-plugin-import@2.29.1)(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1) + transitivePeerDependencies: + - supports-color + eslint-module-utils@2.8.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9(supports-color@8.1.1))(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1): dependencies: debug: 3.2.7(supports-color@8.1.1) @@ -7959,6 +8316,39 @@ snapshots: eslint: 8.57.0(supports-color@8.1.1) eslint-compat-utils: 0.5.1(eslint@8.57.0(supports-color@8.1.1)) + eslint-plugin-es@4.1.0(eslint@8.57.0(supports-color@8.1.1)): + dependencies: + eslint: 8.57.0(supports-color@8.1.1) + eslint-utils: 2.1.0 + regexpp: 3.2.0 + + eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4))(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1): + dependencies: + array-includes: 3.1.8 + array.prototype.findlastindex: 1.2.5 + array.prototype.flat: 1.3.2 + array.prototype.flatmap: 1.3.2 + debug: 3.2.7(supports-color@8.1.1) + doctrine: 2.1.0 + eslint: 8.57.0(supports-color@8.1.1) + eslint-import-resolver-node: 0.3.9(supports-color@8.1.1) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9(supports-color@8.1.1))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4))(eslint-plugin-import@2.29.1)(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1))(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1) + hasown: 2.0.2 + is-core-module: 2.15.0 + is-glob: 4.0.3 + minimatch: 3.1.2 + object.fromentries: 2.0.8 + object.groupby: 1.0.3 + object.values: 1.2.0 + semver: 6.3.1 + tsconfig-paths: 3.15.0 + optionalDependencies: + '@typescript-eslint/parser': 6.21.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4) + transitivePeerDependencies: + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - supports-color + eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4))(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1): dependencies: array-includes: 3.1.8 @@ -7986,6 +8376,25 @@ snapshots: - eslint-import-resolver-webpack - supports-color + eslint-plugin-mocha@10.5.0(eslint@8.57.0(supports-color@8.1.1)): + dependencies: + eslint: 8.57.0(supports-color@8.1.1) + eslint-utils: 3.0.0(eslint@8.57.0(supports-color@8.1.1)) + globals: 13.24.0 + rambda: 7.5.0 + + eslint-plugin-n@15.7.0(eslint@8.57.0(supports-color@8.1.1)): + dependencies: + builtins: 5.1.0 + eslint: 8.57.0(supports-color@8.1.1) + eslint-plugin-es: 4.1.0(eslint@8.57.0(supports-color@8.1.1)) + eslint-utils: 3.0.0(eslint@8.57.0(supports-color@8.1.1)) + ignore: 5.3.2 + is-core-module: 2.15.0 + minimatch: 3.1.2 + resolve: 1.22.8 + semver: 7.6.3 + eslint-plugin-n@16.6.2(eslint@8.57.0(supports-color@8.1.1)): dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0(supports-color@8.1.1)) @@ -8001,6 +8410,16 @@ snapshots: resolve: 1.22.8 semver: 7.6.3 + eslint-plugin-perfectionist@2.11.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4): + dependencies: + '@typescript-eslint/utils': 7.18.0(eslint@8.57.0(supports-color@8.1.1))(supports-color@8.1.1)(typescript@5.5.4) + eslint: 8.57.0(supports-color@8.1.1) + minimatch: 9.0.5 + natural-compare-lite: 1.4.0 + transitivePeerDependencies: + - supports-color + - typescript + eslint-plugin-prettier@5.2.1(eslint-config-prettier@9.1.0(eslint@8.57.0(supports-color@8.1.1)))(eslint@8.57.0(supports-color@8.1.1))(prettier@3.3.3): dependencies: eslint: 8.57.0(supports-color@8.1.1) @@ -8014,11 +8433,43 @@ snapshots: dependencies: eslint: 8.57.0(supports-color@8.1.1) + eslint-plugin-unicorn@48.0.1(eslint@8.57.0(supports-color@8.1.1)): + dependencies: + '@babel/helper-validator-identifier': 7.24.7 + '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0(supports-color@8.1.1)) + ci-info: 3.9.0 + clean-regexp: 1.0.0 + eslint: 8.57.0(supports-color@8.1.1) + esquery: 1.6.0 + indent-string: 4.0.0 + is-builtin-module: 3.2.1 + jsesc: 3.0.2 + lodash: 4.17.21 + pluralize: 8.0.0 + read-pkg-up: 7.0.1 + regexp-tree: 0.1.27 + regjsparser: 0.10.0 + semver: 7.6.3 + strip-indent: 3.0.0 + eslint-scope@7.2.2: dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 + eslint-utils@2.1.0: + dependencies: + eslint-visitor-keys: 1.3.0 + + eslint-utils@3.0.0(eslint@8.57.0(supports-color@8.1.1)): + dependencies: + eslint: 8.57.0(supports-color@8.1.1) + eslint-visitor-keys: 2.1.0 + + eslint-visitor-keys@1.3.0: {} + + eslint-visitor-keys@2.1.0: {} + eslint-visitor-keys@3.4.3: {} eslint@8.57.0(supports-color@8.1.1): @@ -8445,6 +8896,8 @@ snapshots: hook-std@3.0.0: {} + hosted-git-info@2.8.9: {} + hosted-git-info@7.0.2: dependencies: lru-cache: 10.4.3 @@ -9044,6 +9497,8 @@ snapshots: jsesc@2.5.2: {} + jsesc@3.0.2: {} + json-buffer@3.0.1: {} json-parse-better-errors@1.0.2: {} @@ -9182,6 +9637,8 @@ snapshots: mimic-response@4.0.0: {} + min-indent@1.0.1: {} + minimatch@3.1.2: dependencies: brace-expansion: 1.1.11 @@ -9214,6 +9671,8 @@ snapshots: object-assign: 4.1.1 thenify-all: 1.6.0 + natural-compare-lite@1.4.0: {} + natural-compare@1.4.0: {} natural-orderby@3.0.2: {} @@ -9238,6 +9697,13 @@ snapshots: node-releases@2.0.18: {} + normalize-package-data@2.5.0: + dependencies: + hosted-git-info: 2.8.9 + resolve: 1.22.8 + semver: 5.7.2 + validate-npm-package-license: 3.0.4 + normalize-package-data@6.0.2: dependencies: hosted-git-info: 7.0.2 @@ -9479,6 +9945,8 @@ snapshots: dependencies: find-up: 4.1.0 + pluralize@8.0.0: {} + possible-typed-array-names@1.0.0: {} postcss-load-config@6.0.1(tsx@4.17.0): @@ -9522,6 +9990,8 @@ snapshots: quick-lru@5.1.1: {} + rambda@7.5.0: {} + rc@1.2.8: dependencies: deep-extend: 0.6.0 @@ -9537,6 +10007,19 @@ snapshots: read-pkg: 9.0.1 type-fest: 4.25.0 + read-pkg-up@7.0.1: + dependencies: + find-up: 4.1.0 + read-pkg: 5.2.0 + type-fest: 0.8.1 + + read-pkg@5.2.0: + dependencies: + '@types/normalize-package-data': 2.4.4 + normalize-package-data: 2.5.0 + parse-json: 5.2.0 + type-fest: 0.6.0 + read-pkg@9.0.1: dependencies: '@types/normalize-package-data': 2.4.4 @@ -9575,6 +10058,8 @@ snapshots: dependencies: '@babel/runtime': 7.25.0 + regexp-tree@0.1.27: {} + regexp.prototype.flags@1.5.2: dependencies: call-bind: 1.0.7 @@ -9582,6 +10067,8 @@ snapshots: es-errors: 1.3.0 set-function-name: 2.0.2 + regexpp@3.2.0: {} + regexpu-core@5.3.2: dependencies: '@babel/regjsgen': 0.8.0 @@ -9595,6 +10082,10 @@ snapshots: dependencies: '@pnpm/npm-conf': 2.3.1 + regjsparser@0.10.0: + dependencies: + jsesc: 0.5.0 + regjsparser@0.9.1: dependencies: jsesc: 0.5.0 @@ -9717,6 +10208,8 @@ snapshots: semver-regex@4.0.5: {} + semver@5.7.2: {} + semver@6.3.1: {} semver@7.6.3: {} @@ -9911,6 +10404,10 @@ snapshots: strip-final-newline@4.0.0: {} + strip-indent@3.0.0: + dependencies: + min-indent: 1.0.1 + strip-json-comments@2.0.1: {} strip-json-comments@3.1.1: {} @@ -9956,6 +10453,8 @@ snapshots: '@pkgr/core': 0.1.1 tslib: 2.6.3 + tapable@2.2.1: {} + temp-dir@3.0.0: {} tempy@3.1.0: @@ -10070,6 +10569,10 @@ snapshots: type-fest@0.21.3: {} + type-fest@0.6.0: {} + + type-fest@0.8.1: {} + type-fest@1.4.0: {} type-fest@2.19.0: {} diff --git a/src/action/base.ts b/src/action/base.ts index a0dba66..fb0349c 100644 --- a/src/action/base.ts +++ b/src/action/base.ts @@ -1,7 +1,10 @@ +/* eslint-disable @typescript-eslint/no-non-null-assertion */ +/* eslint-disable @typescript-eslint/non-nullable-type-assertion-style */ +/* eslint-disable @typescript-eslint/unbound-method */ import { inspect } from 'node:util' import { castArray } from '../util' -import { Options } from './types' +import type { Options } from './types' export interface ITask { action: string @@ -15,7 +18,7 @@ export type ActionType = 'debug' | 'simple' | 'spinner' export class ActionBase { std: 'stderr' | 'stdout' = 'stderr' - protected stdmocks?: ['stderr' | 'stdout', string[]][] + protected stdmocks?: Array<['stderr' | 'stdout', string[]]> type!: ActionType @@ -62,9 +65,9 @@ export class ActionBase { this.globals.action.task = task } - public pause(fn: () => any, icon?: string): Promise { + public async pause(fn: () => any, icon?: string): Promise { const { task } = this - const active = task && task.active + const active = task?.active if (task && active) { this._pause(icon) this._stdout(false) @@ -81,7 +84,7 @@ export class ActionBase { public async pauseAsync(fn: () => Promise, icon?: string): Promise { const { task } = this - const active = task && task.active + const active = task?.active if (task && active) { this._pause(icon) this._stdout(false) @@ -98,7 +101,7 @@ export class ActionBase { public start(action: string, status?: string, opts: Options = {}): void { this.std = opts.stdout ? 'stdout' : 'stderr' - const task = { action, active: Boolean(this.task && this.task.active), status } + const task = { action, active: Boolean(this.task?.active), status } this.task = task this._start(opts) diff --git a/src/action/simple.ts b/src/action/simple.ts index df551f5..c592df0 100644 --- a/src/action/simple.ts +++ b/src/action/simple.ts @@ -1,9 +1,9 @@ -import { ActionBase, ActionType } from './base' +import { ActionBase, type ActionType } from './base' export default class SimpleAction extends ActionBase { public type: ActionType = 'simple' - private _flush() { + private _flush(): void { this._write(this.std, '\n') this._flushStdout() } @@ -13,7 +13,7 @@ export default class SimpleAction extends ActionBase { else this._flush() } - private _render(action: string, status?: string) { + private _render(action: string, status?: string): void { if (!this.task) return if (this.task.active) this._flush() this._write(this.std, status ? `${action}... ${status}` : `${action}...`) diff --git a/src/action/spinner.ts b/src/action/spinner.ts index 512ef89..cbab740 100644 --- a/src/action/spinner.ts +++ b/src/action/spinner.ts @@ -1,12 +1,13 @@ +/* eslint-disable @typescript-eslint/no-unsafe-argument */ import ansiStyles from 'ansi-styles' import chalk from 'chalk' import stripAnsi from 'strip-ansi' import * as supportsColor from 'supports-color' import { errtermwidth } from '../screen' -import { ActionBase, ActionType } from './base' +import { ActionBase, type ActionType } from './base' import spinners from './spinners' -import { Options } from './types' +import type { Options } from './types' const ansiEscapes = require('ansi-escapes') @@ -48,7 +49,7 @@ export default class SpinnerAction extends ActionBase { this.output = undefined } - private _render(icon?: string) { + private _render(icon?: string): void { if (!this.task) return this._reset() this._flushStdout() @@ -59,7 +60,7 @@ export default class SpinnerAction extends ActionBase { this._write(this.std, this.output) } - private _reset() { + private _reset(): void { if (!this.output) return const lines = this._lines(this.output) this._write(this.std, ansiEscapes.cursorLeft + ansiEscapes.cursorUp(lines) + ansiEscapes.eraseDown) @@ -73,7 +74,7 @@ export default class SpinnerAction extends ActionBase { if (this.spinner) clearInterval(this.spinner) this._render() this.spinner = setInterval( - (icon) => this._render.bind(this)(icon), + (icon) => { this._render.bind(this)(icon); }, process.platform === 'win32' ? 500 : 100, 'spinner', ) @@ -88,7 +89,7 @@ export default class SpinnerAction extends ActionBase { this.output = undefined } - private getFrames(opts?: Options) { + private getFrames(opts?: Options): string[] { if (opts?.style) return spinners[opts.style].frames return spinners[process.platform === 'win32' ? 'line' : 'dots2'].frames diff --git a/src/action/types.ts b/src/action/types.ts index 7fe562e..046870b 100644 --- a/src/action/types.ts +++ b/src/action/types.ts @@ -1,4 +1,4 @@ -import spinners from './spinners' +import type spinners from './spinners' export type Options = { stdout?: boolean diff --git a/src/config.ts b/src/config.ts index 5710302..eecc23e 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,5 +1,5 @@ import Cache from '@oclif/core/lib/cache' -import { ActionBase } from './action/base' +import type { ActionBase } from './action/base' import simple from './action/simple' import spinner from './action/spinner' @@ -17,6 +17,7 @@ const globals = g.ux || (g.ux = {}) const actionType = (Boolean(process.stderr.isTTY) && !process.env.CI && + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion !['dumb', 'emacs-color'].includes(process.env.TERM!) && 'spinner') || 'simple' @@ -50,7 +51,7 @@ export class Config { } } -function fetch() { +function fetch(): any { const core = Cache.getInstance().get('@oclif/core') const major = core?.version.split('.')[0] || 'unknown' if (globals[major]) return globals[major] diff --git a/src/flush.ts b/src/flush.ts index b1bedcd..b5263f9 100644 --- a/src/flush.ts +++ b/src/flush.ts @@ -1,10 +1,10 @@ import { error } from "@oclif/core/lib/errors" -function timeout(p: Promise, ms: number) { - function wait(ms: number, unref = false) { +async function timeout(p: Promise, ms: number): Promise { + async function wait(ms: number, unref = false): Promise { return new Promise((resolve) => { - const t: any = setTimeout(() => resolve(null), ms) + const t: any = setTimeout(() => { resolve(null); }, ms) if (unref) t.unref() }) } @@ -12,9 +12,9 @@ function timeout(p: Promise, ms: number) { return Promise.race([p, wait(ms, true).then(() => error('timed out'))]) } -async function _flush() { +async function _flush(): Promise { const p = new Promise((resolve) => { - process.stdout.once('drain', () => resolve(null)) + process.stdout.once('drain', () => { resolve(null); }) }) const flushed = process.stdout.write('') diff --git a/src/index.ts b/src/index.ts index ce48f4a..3003b2f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,9 @@ +/* eslint-disable @typescript-eslint/unbound-method */ +/* eslint-disable @typescript-eslint/no-unsafe-argument */ import chalk from 'chalk' import { format as utilFormat } from 'node:util' -import { ActionBase } from './action/base' +import type { ActionBase } from './action/base' import { config } from './config' import { flush as _flush } from './flush' import * as uxPrompt from './prompt' @@ -11,6 +13,7 @@ import write from './write' import { Errors } from '@oclif/core' const hyperlinker = require('hyperlinker') +// eslint-disable-next-line @typescript-eslint/no-extraneous-class export class ux { public static config = config @@ -172,7 +175,7 @@ export { warn } -const uxProcessExitHandler = async () => { +const uxProcessExitHandler = async (): Promise => { try { await ux.done() } catch (error) { @@ -185,13 +188,14 @@ const uxProcessExitHandler = async () => { // only attach named listener once const uxListener = process.listeners('exit').find((fn) => fn.name === uxProcessExitHandler.name) if (!uxListener) { + // eslint-disable-next-line @typescript-eslint/no-misused-promises process.once('exit', uxProcessExitHandler) } export { ActionBase } from './action/base' export { Config, config } from './config' export { ExitError } from './exit' -export { IPromptOptions } from './prompt' +export type { IPromptOptions } from './prompt' export { Table } from './styled' export { colorize } from './theme' diff --git a/src/prompt.ts b/src/prompt.ts index 96f597b..660a3a4 100644 --- a/src/prompt.ts +++ b/src/prompt.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/unbound-method */ import chalk from 'chalk' import { config } from './config' @@ -25,7 +26,7 @@ interface IPromptConfig { type: 'hide' | 'mask' | 'normal' | 'single' } -function normal(options: IPromptConfig, retries = 100): Promise { +async function normal(options: IPromptConfig, retries = 100): Promise { if (retries < 0) throw new Error('no input') return new Promise((resolve, reject) => { let timer: NodeJS.Timeout @@ -47,13 +48,14 @@ function normal(options: IPromptConfig, retries = 100): Promise { if (!options.default && options.required && data === '') { resolve(normal(options, retries - 1)) } else { + // eslint-disable-next-line @typescript-eslint/non-nullable-type-assertion-style resolve(data || (options.default as string)) } }) }) } -function getPrompt(name: string, type?: string, defaultValue?: string) { +function getPrompt(name: string, type?: string, defaultValue?: string): string { let prompt = '> ' if (defaultValue && type === 'hide') { @@ -75,7 +77,7 @@ async function single(options: IPromptConfig): Promise { return response } -function replacePrompt(prompt: string) { +function replacePrompt(prompt: string): void { const ansiEscapes = require('ansi-escapes') process.stderr.write( ansiEscapes.cursorHide + @@ -142,7 +144,7 @@ async function _prompt(name: string, inputOptions: Partial = {}) * @returns Promise */ export async function prompt(name: string, options: IPromptOptions = {}): Promise { - return config.action.pauseAsync(() => _prompt(name, options), chalk.cyan('?')) + return config.action.pauseAsync(async () => _prompt(name, options), chalk.cyan('?')) } /** @@ -150,7 +152,7 @@ export async function prompt(name: string, options: IPromptOptions = {}): Promis * @param message - confirmation text * @returns Promise */ -export function confirm(message: string): Promise { +export async function confirm(message: string): Promise { return config.action.pauseAsync(async () => { const confirm = async (): Promise => { const raw = await _prompt(message) diff --git a/src/screen.ts b/src/screen.ts index 68b623e..8c238e5 100644 --- a/src/screen.ts +++ b/src/screen.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-non-null-assertion */ function termwidth(stream: any): number { if (!stream.isTTY) { diff --git a/src/stream.ts b/src/stream.ts index 184b68d..0f36e04 100644 --- a/src/stream.ts +++ b/src/stream.ts @@ -9,6 +9,7 @@ class Stream { } public emit(event: string, ...args: any[]): boolean { + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument return process[this.channel].emit(event, ...args) } @@ -16,12 +17,12 @@ class Stream { return process[this.channel].getWindowSize() } - public on(event: string, listener: (...args: any[]) => void): Stream { + public on(event: string, listener: (...args: any[]) => void): this { process[this.channel].on(event, listener) return this } - public once(event: string, listener: (...args: any[]) => void): Stream { + public once(event: string, listener: (...args: any[]) => void): this { process[this.channel].once(event, listener) return this } diff --git a/src/styled/object.ts b/src/styled/object.ts index 2edee2b..b691377 100644 --- a/src/styled/object.ts +++ b/src/styled/object.ts @@ -4,12 +4,12 @@ import { inspect } from 'node:util' export default function styledObject(obj: any, keys?: string[]): string { const output: string[] = [] - const keyLengths = Object.keys(obj).map((key) => key.toString().length) + const keyLengths = Object.keys(obj as object).map((key) => key.toString().length) const maxKeyLength = Math.max(...keyLengths) + 2 - function pp(obj: any) { + function pp(obj: any): any { if (typeof obj === 'string' || typeof obj === 'number') return obj if (typeof obj === 'object') { - return Object.keys(obj) + return Object.keys(obj as object) .map((k) => k + ': ' + inspect(obj[k])) .join(', ') } @@ -20,7 +20,7 @@ export default function styledObject(obj: any, keys?: string[]): string { const logKeyValue = (key: string, value: any): string => `${chalk.blue(key)}:` + ' '.repeat(maxKeyLength - key.length - 1) + pp(value) - for (const key of keys || Object.keys(obj).sort()) { + for (const key of keys || Object.keys(obj as object).sort()) { const value = obj[key] if (Array.isArray(value)) { if (value.length > 0) { diff --git a/src/styled/progress.ts b/src/styled/progress.ts index d935f98..a11f1ec 100644 --- a/src/styled/progress.ts +++ b/src/styled/progress.ts @@ -1,5 +1,5 @@ // 3pp -import { Options, SingleBar } from 'cli-progress' +import { type Options, SingleBar } from 'cli-progress' export default function progress(options: Options = {}): SingleBar { diff --git a/src/styled/table.ts b/src/styled/table.ts index 4d79dfa..2aac108 100644 --- a/src/styled/table.ts +++ b/src/styled/table.ts @@ -1,3 +1,8 @@ +/* eslint-disable @typescript-eslint/method-signature-style */ +/* eslint-disable @typescript-eslint/no-namespace */ +/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ +/* eslint-disable @typescript-eslint/no-non-null-assertion */ +/* eslint-disable @typescript-eslint/unbound-method */ import chalk from 'chalk' import {safeDump} from 'js-yaml' import {orderBy} from 'natural-orderby' @@ -8,13 +13,13 @@ import sw from 'string-width' import {stdtermwidth} from '../screen' import {capitalize, sumBy} from '../util' import write from '../write' -import { Interfaces, Flags as F } from '@oclif/core' +import { type Interfaces, Flags as F } from '@oclif/core' class Table> { - columns: (table.Column & {key: string; maxWidth?: number; width?: number})[] + columns: Array & {key: string; maxWidth?: number; width?: number}> - options: table.Options & {printLine(s: any): any} + options: table.Options & {printLine: (s: any) => any} constructor( private data: T[], @@ -48,14 +53,14 @@ class Table> { 'no-header': options['no-header'] ?? false, 'no-truncate': options['no-truncate'] ?? false, output: csv ? 'csv' : output, - printLine: printLine ?? ((s: any) => write.stdout(s + '\n')), + printLine: printLine ?? ((s: any) => { write.stdout(s + '\n'); }), rowStart: ' ', sort, title, } } - display() { + display(): any { // build table rows from input array data let rows = this.data.map((d) => { const row: any = {} @@ -127,10 +132,10 @@ class Table> { private filterColumnsFromHeaders( filters: string[], - ): (table.Column & {key: string; maxWidth?: number; width?: number})[] { + ): Array & {key: string; maxWidth?: number; width?: number}> { // unique filters = [...new Set(filters)] - const cols: (table.Column & {key: string; maxWidth?: number; width?: number})[] = [] + const cols: Array & {key: string; maxWidth?: number; width?: number}> = [] for (const f of filters) { const c = this.columns.find((c) => c.header.toLowerCase() === f.toLowerCase()) if (c) cols.push(c) @@ -153,7 +158,7 @@ class Table> { return values.map((e) => (lineToBeEscaped ? `"${e.replaceAll('"', '""')}"` : e)) } - private outputCSV() { + private outputCSV(): void { const {columns, data, options} = this if (!options['no-header']) { @@ -166,11 +171,11 @@ class Table> { } } - private outputJSON() { + private outputJSON(): void { this.options.printLine(JSON.stringify(this.resolveColumnsToObjectArray(), undefined, 2)) } - private outputTable() { + private outputTable(): any { const {data, options} = this // column truncation // @@ -187,7 +192,7 @@ class Table> { // terminal width const maxWidth = stdtermwidth - 2 // truncation logic - const shouldShorten = () => { + const shouldShorten = (): void => { // don't shorten if full mode if (options['no-truncate'] || (!process.stdout.isTTY && !process.env.CLI_UX_SKIP_TTY_CHECK)) return @@ -274,7 +279,6 @@ class Table> { if (lines > numOfLines) numOfLines = lines } - // eslint-disable-next-line unicorn/no-new-array const linesIndexess = [...new Array(numOfLines).keys()] // print row @@ -285,16 +289,16 @@ class Table> { const width = col.width! let d = (row as any)[col.key] d = d.split('\n')[i] || '' - const visualWidth = sw(d) + const visualWidth = sw(d as string) const colorWidth = d.length - visualWidth let cell = d.padEnd(width + colorWidth) if (cell.length - colorWidth > width || visualWidth === width) { // truncate the cell, preserving ANSI escape sequences, and keeping // into account the width of fullwidth unicode characters - cell = sliceAnsi(cell, 0, width - 2) + '… ' + cell = sliceAnsi(cell as string, 0, width - 2) + '… ' // pad with spaces; this is necessary in case the original string // contained fullwidth characters which cannot be split - cell += ' '.repeat(width - sw(cell)) + cell += ' '.repeat(width - sw(cell as string)) } l += cell @@ -305,11 +309,11 @@ class Table> { } } - private outputYAML() { + private outputYAML(): void { this.options.printLine(safeDump(this.resolveColumnsToObjectArray())) } - private resolveColumnsToObjectArray() { + private resolveColumnsToObjectArray(): any { const {columns, data} = this return data.map((d: any) => Object.fromEntries(columns.map((col) => [col.key, d[col.key] ?? '']))) } @@ -380,7 +384,7 @@ export namespace table { minWidth: number } - export type Columns> = {[key: string]: Partial>} + export type Columns> = Record>> // export type OutputType = 'csv' | 'json' | 'yaml' @@ -403,5 +407,5 @@ const getWidestColumnWith = (data: any[], columnKey: string): number => // convert multi-line cell to single longest line // for width calculations const manyLines = (d as string).split('\n') - return Math.max(previous, manyLines.length > 1 ? Math.max(...manyLines.map((r: string) => sw(r))) : sw(d)) + return Math.max(previous as number, manyLines.length > 1 ? Math.max(...manyLines.map((r: string) => sw(r))) : sw(d as string)) }, 0) diff --git a/src/styled/tree.ts b/src/styled/tree.ts index 0d6812a..7e1a947 100644 --- a/src/styled/tree.ts +++ b/src/styled/tree.ts @@ -1,12 +1,12 @@ const treeify = require('object-treeify') export class Tree { - nodes: { [key: string]: Tree } = {} + nodes: Record = {} display(logger: any = console.log): void { - const addNodes = function (nodes: any) { - const tree: { [key: string]: any } = {} - for (const p of Object.keys(nodes)) { + const addNodes = function (nodes: any): Record { + const tree: Record = {} + for (const p of Object.keys(nodes as object)) { tree[p] = addNodes(nodes[p].nodes) } @@ -17,7 +17,7 @@ export class Tree { logger(treeify(tree)) } - insert(child: string, value: Tree = new Tree()): Tree { + insert(child: string, value: Tree = new Tree()): this { this.nodes[child] = value return this } diff --git a/src/theme.ts b/src/theme.ts index cd06a01..cb8678b 100644 --- a/src/theme.ts +++ b/src/theme.ts @@ -91,6 +91,7 @@ export type Theme = { function isStandardChalk(color: any): color is StandardChalk { + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument return STANDARD_CHALK.includes(color) } diff --git a/src/util.ts b/src/util.ts index 860bbae..b23892b 100644 --- a/src/util.ts +++ b/src/util.ts @@ -1,15 +1,14 @@ -export function pickBy>( +export function pickBy | ArrayLike>( obj: T, fn: (i: T[keyof T]) => boolean, ): Partial { - return Object.entries(obj).reduce((o, [k, v]) => { + return Object.entries(obj).reduce((o, [k, v]) => { if (fn(v)) o[k] = v return o - }, {} as any) + }, {}) } -export function compact(a: (T | undefined)[]): T[] { - // eslint-disable-next-line unicorn/prefer-native-coercion-functions +export function compact(a: Array): T[] { return a.filter((a): a is T => Boolean(a)) } @@ -85,6 +84,7 @@ export function isNotFalsy(input: string): boolean { } export function uniq(arr: T[]): T[] { + // eslint-disable-next-line @typescript-eslint/require-array-sort-compare return [...new Set(arr)].sort() } @@ -92,16 +92,17 @@ export function mapValues, TResult>( obj: { [P in keyof T]: T[P] }, fn: (i: T[keyof T], k: keyof T) => TResult, ): { [P in keyof T]: TResult } { - return Object.entries(obj).reduce((o, [k, v]) => { + return Object.entries(obj).reduce((o, [k, v]) => { + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unnecessary-type-assertion o[k] = fn(v as any, k as any) return o - }, {} as any) + }, {}) } function get(obj: Record, path: string): unknown { return path.split('.').reduce((o, p) => o?.[p], obj) } -export function mergeNestedObjects(objs: Record[], path: string): Record { +export function mergeNestedObjects(objs: Array>, path: string): Record { return Object.fromEntries(objs.flatMap((o) => Object.entries(get(o, path) ?? {})).reverse()) } diff --git a/src/wait.ts b/src/wait.ts index ecf2835..04b9275 100644 --- a/src/wait.ts +++ b/src/wait.ts @@ -1,4 +1,4 @@ -export default (ms = 1000): Promise => +export default async (ms = 1000): Promise => new Promise((resolve) => { setTimeout(resolve, ms) })