[READ-ONLY] Mirror of https://github.com/bombshell-dev/tab. shell autocompletions for javascript CLIs
4

Configure Feed

Select the types of activity you want to include in your feed.

chore: upgrade eslint config to flat config (#14)

* chore: upgrade eslint config to flat config

Migrates the config to be a flat config file (`eslint.config.js`).

To facilitate this, also updates a couple of packages:

- `typescript-eslint` (and drops the `@typescript-eslint/*` packages)
- prettier
- prettier ESLint config

We also removed `eslint-plugin-prettier` since the `format:check` script
achieves the same, and the ESLint config disables all stylistic rules.

* pnpm install

* demo.citty

* using void operator

---------

Co-authored-by: AmirSa12 <amirhosseinpr184@gmail.com>

authored by

James Garbutt
AmirSa12
and committed by
GitHub
(Feb 26, 2025, 11:11 PM +0330) 11277dee fa066b96

+214 -226
-12
.eslintrc.json
··· 1 - { 2 - "extends": [ 3 - "eslint:recommended", 4 - "plugin:@typescript-eslint/recommended", 5 - "prettier" 6 - ], 7 - "parser": "@typescript-eslint/parser", 8 - "plugins": ["@typescript-eslint"], 9 - "rules": { 10 - "prettier/prettier": "error" 11 - } 12 - }
+4 -1
.github/workflows/ci.yml
··· 37 37 run: pnpm test 38 38 39 39 typecheck: 40 - name: Type Check 40 + name: Lint and Type Check 41 41 runs-on: ubuntu-latest 42 42 43 43 steps: ··· 56 56 57 57 - name: Install deps 58 58 run: pnpm install 59 + 60 + - name: Lint 61 + run: pnpm lint 59 62 60 63 - name: Type-check 61 64 run: pnpm type-check
+3 -3
demo.citty.ts
··· 1 - import { defineCommand, createMain, CommandDef } from 'citty'; 1 + import { defineCommand, createMain, CommandDef, ArgsDef } from 'citty'; 2 2 import tab from './src/citty'; 3 3 4 4 const main = defineCommand({ ··· 58 58 main.subCommands = { 59 59 dev: devCommand, 60 60 lint: lintCommand, 61 - } as Record<string, CommandDef<any>>; 61 + } as Record<string, CommandDef<ArgsDef>>; 62 62 63 63 const completion = await tab(main, { 64 64 subCommands: { ··· 121 121 }, 122 122 }); 123 123 124 - completion; 124 + void completion; 125 125 126 126 const cli = createMain(main); 127 127
+19
eslint.config.js
··· 1 + import eslintjs from '@eslint/js'; 2 + import { configs as tseslintConfigs } from 'typescript-eslint'; 3 + import prettierConfig from 'eslint-config-prettier'; 4 + 5 + const { configs: eslintConfigs } = eslintjs; 6 + 7 + export default [ 8 + { 9 + ...eslintConfigs.recommended, 10 + files: ['src/**/*.ts'], 11 + }, 12 + ...tseslintConfigs.strict, 13 + { 14 + rules: { 15 + '@typescript-eslint/no-unused-vars': 'off', 16 + }, 17 + }, 18 + prettierConfig, 19 + ];
+4 -5
package.json
··· 11 11 "format": "prettier --write .", 12 12 "format:check": "prettier --check .", 13 13 "build": "tsup", 14 - "prepare": "pnpm build" 14 + "prepare": "pnpm build", 15 + "lint": "eslint src \"./*.ts\"" 15 16 }, 16 17 "files": [ 17 18 "dist" ··· 21 22 "license": "ISC", 22 23 "devDependencies": { 23 24 "@types/node": "^22.7.4", 24 - "@typescript-eslint/eslint-plugin": "^8.20.0", 25 - "@typescript-eslint/parser": "^8.20.0", 26 25 "cac": "^6.7.14", 27 26 "citty": "^0.1.6", 28 27 "eslint-config-prettier": "^10.0.1", 29 - "eslint-plugin-prettier": "^5.2.2", 30 - "prettier": "^3.4.2", 28 + "prettier": "^3.5.2", 31 29 "tsup": "^8.3.6", 32 30 "tsx": "^4.19.1", 31 + "typescript-eslint": "^8.25.0", 33 32 "typescript": "^5.7.3", 34 33 "vitest": "^2.1.3" 35 34 },
+142 -166
pnpm-lock.yaml
··· 15 15 '@types/node': 16 16 specifier: ^22.7.4 17 17 version: 22.7.5 18 - '@typescript-eslint/eslint-plugin': 19 - specifier: ^8.20.0 20 - version: 8.20.0(@typescript-eslint/parser@8.20.0(eslint@9.18.0)(typescript@5.7.3))(eslint@9.18.0)(typescript@5.7.3) 21 - '@typescript-eslint/parser': 22 - specifier: ^8.20.0 23 - version: 8.20.0(eslint@9.18.0)(typescript@5.7.3) 24 18 cac: 25 19 specifier: ^6.7.14 26 20 version: 6.7.14 ··· 30 24 eslint-config-prettier: 31 25 specifier: ^10.0.1 32 26 version: 10.0.1(eslint@9.18.0) 33 - eslint-plugin-prettier: 34 - specifier: ^5.2.2 35 - version: 5.2.2(eslint-config-prettier@10.0.1(eslint@9.18.0))(eslint@9.18.0)(prettier@3.4.2) 36 27 prettier: 37 - specifier: ^3.4.2 38 - version: 3.4.2 28 + specifier: ^3.5.2 29 + version: 3.5.2 39 30 tsup: 40 31 specifier: ^8.3.6 41 32 version: 8.3.6(postcss@8.4.47)(tsx@4.19.1)(typescript@5.7.3) ··· 45 36 typescript: 46 37 specifier: ^5.7.3 47 38 version: 5.7.3 39 + typescript-eslint: 40 + specifier: ^8.25.0 41 + version: 8.25.0(eslint@9.18.0)(typescript@5.7.3) 48 42 vitest: 49 43 specifier: ^2.1.3 50 44 version: 2.1.3(@types/node@22.7.5) ··· 493 487 resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==} 494 488 engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} 495 489 496 - '@eslint/config-array@0.19.1': 497 - resolution: {integrity: sha512-fo6Mtm5mWyKjA/Chy1BYTdn5mGJoDNjC7C64ug20ADsRDGrA85bN3uK3MaKbeRkRuuIEAR5N33Jr1pbm411/PA==} 490 + '@eslint/config-array@0.19.2': 491 + resolution: {integrity: sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w==} 498 492 engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 499 493 500 494 '@eslint/core@0.10.0': 501 495 resolution: {integrity: sha512-gFHJ+xBOo4G3WRlR1e/3G8A6/KZAH6zcE/hkLRCZTi/B9avAG365QhFA8uOGzTMqgTghpn7/fSnscW++dpMSAw==} 502 496 engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 503 497 504 - '@eslint/eslintrc@3.2.0': 505 - resolution: {integrity: sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==} 498 + '@eslint/core@0.12.0': 499 + resolution: {integrity: sha512-cmrR6pytBuSMTaBweKoGMwu3EiHiEC+DoyupPmlZ0HxBJBtIxwe+j/E4XPIKNx+Q74c8lXKPwYawBf5glsTkHg==} 500 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 501 + 502 + '@eslint/eslintrc@3.3.0': 503 + resolution: {integrity: sha512-yaVPAiNAalnCZedKLdR21GOGILMLKPyqSLWaAjQFvYA2i/ciDi8ArYVr69Anohb6cH2Ukhqti4aFnYyPm8wdwQ==} 506 504 engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 507 505 508 506 '@eslint/js@9.18.0': 509 507 resolution: {integrity: sha512-fK6L7rxcq6/z+AaQMtiFTkvbHkBLNlwyRxHpKawP0x3u9+NC6MQTnFW+AdpwC6gfHTW0051cokQgtTN2FqlxQA==} 510 508 engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 511 509 512 - '@eslint/object-schema@2.1.5': 513 - resolution: {integrity: sha512-o0bhxnL89h5Bae5T318nFoFzGy+YE5i/gGkoPAgkmTVdRKTiv3p8JHevPiPaMwoloKfEiiaHlawCqaZMqRm+XQ==} 510 + '@eslint/object-schema@2.1.6': 511 + resolution: {integrity: sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==} 514 512 engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 515 513 516 - '@eslint/plugin-kit@0.2.5': 517 - resolution: {integrity: sha512-lB05FkqEdUg2AA0xEbUz0SnkXT1LcCTa438W4IWTUh4hdOnVbQyOJ81OrDXsJk/LSiJHubgGEFoR5EHq1NsH1A==} 514 + '@eslint/plugin-kit@0.2.7': 515 + resolution: {integrity: sha512-JubJ5B2pJ4k4yGxaNLdbjrnk9d/iDz6/q8wOilpIowd6PJPgaxCuHBnBszq7Ce2TyMrywm5r4PnKm6V3iiZF+g==} 518 516 engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 519 517 520 518 '@humanfs/core@0.19.1': ··· 533 531 resolution: {integrity: sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==} 534 532 engines: {node: '>=18.18'} 535 533 536 - '@humanwhocodes/retry@0.4.1': 537 - resolution: {integrity: sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==} 534 + '@humanwhocodes/retry@0.4.2': 535 + resolution: {integrity: sha512-xeO57FpIu4p1Ri3Jq/EXq4ClRm86dVF2z/+kvFnyqVYRavTZmaFaUBbWCOuuTh0o/g7DSsk6kc2vrS4Vl5oPOQ==} 538 536 engines: {node: '>=18.18'} 539 537 540 538 '@isaacs/cliui@8.0.2': ··· 574 572 '@pkgjs/parseargs@0.11.0': 575 573 resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} 576 574 engines: {node: '>=14'} 577 - 578 - '@pkgr/core@0.1.1': 579 - resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} 580 - engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} 581 575 582 576 '@rollup/rollup-android-arm-eabi@4.24.2': 583 577 resolution: {integrity: sha512-ufoveNTKDg9t/b7nqI3lwbCG/9IJMhADBNjjz/Jn6LxIZxD7T5L8l2uO/wD99945F1Oo8FvgbbZJRguyk/BdzA==} ··· 678 672 '@types/node@22.7.5': 679 673 resolution: {integrity: sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==} 680 674 681 - '@typescript-eslint/eslint-plugin@8.20.0': 682 - resolution: {integrity: sha512-naduuphVw5StFfqp4Gq4WhIBE2gN1GEmMUExpJYknZJdRnc+2gDzB8Z3+5+/Kv33hPQRDGzQO/0opHE72lZZ6A==} 675 + '@typescript-eslint/eslint-plugin@8.25.0': 676 + resolution: {integrity: sha512-VM7bpzAe7JO/BFf40pIT1lJqS/z1F8OaSsUB3rpFJucQA4cOSuH2RVVVkFULN+En0Djgr29/jb4EQnedUo95KA==} 683 677 engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 684 678 peerDependencies: 685 679 '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 686 680 eslint: ^8.57.0 || ^9.0.0 687 681 typescript: '>=4.8.4 <5.8.0' 688 682 689 - '@typescript-eslint/parser@8.20.0': 690 - resolution: {integrity: sha512-gKXG7A5HMyjDIedBi6bUrDcun8GIjnI8qOwVLiY3rx6T/sHP/19XLJOnIq/FgQvWLHja5JN/LSE7eklNBr612g==} 683 + '@typescript-eslint/parser@8.25.0': 684 + resolution: {integrity: sha512-4gbs64bnbSzu4FpgMiQ1A+D+urxkoJk/kqlDJ2W//5SygaEiAP2B4GoS7TEdxgwol2el03gckFV9lJ4QOMiiHg==} 691 685 engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 692 686 peerDependencies: 693 687 eslint: ^8.57.0 || ^9.0.0 694 688 typescript: '>=4.8.4 <5.8.0' 695 689 696 - '@typescript-eslint/scope-manager@8.20.0': 697 - resolution: {integrity: sha512-J7+VkpeGzhOt3FeG1+SzhiMj9NzGD/M6KoGn9f4dbz3YzK9hvbhVTmLj/HiTp9DazIzJ8B4XcM80LrR9Dm1rJw==} 690 + '@typescript-eslint/scope-manager@8.25.0': 691 + resolution: {integrity: sha512-6PPeiKIGbgStEyt4NNXa2ru5pMzQ8OYKO1hX1z53HMomrmiSB+R5FmChgQAP1ro8jMtNawz+TRQo/cSXrauTpg==} 698 692 engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 699 693 700 - '@typescript-eslint/type-utils@8.20.0': 701 - resolution: {integrity: sha512-bPC+j71GGvA7rVNAHAtOjbVXbLN5PkwqMvy1cwGeaxUoRQXVuKCebRoLzm+IPW/NtFFpstn1ummSIasD5t60GA==} 694 + '@typescript-eslint/type-utils@8.25.0': 695 + resolution: {integrity: sha512-d77dHgHWnxmXOPJuDWO4FDWADmGQkN5+tt6SFRZz/RtCWl4pHgFl3+WdYCn16+3teG09DY6XtEpf3gGD0a186g==} 702 696 engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 703 697 peerDependencies: 704 698 eslint: ^8.57.0 || ^9.0.0 705 699 typescript: '>=4.8.4 <5.8.0' 706 700 707 - '@typescript-eslint/types@8.20.0': 708 - resolution: {integrity: sha512-cqaMiY72CkP+2xZRrFt3ExRBu0WmVitN/rYPZErA80mHjHx/Svgp8yfbzkJmDoQ/whcytOPO9/IZXnOc+wigRA==} 701 + '@typescript-eslint/types@8.25.0': 702 + resolution: {integrity: sha512-+vUe0Zb4tkNgznQwicsvLUJgZIRs6ITeWSCclX1q85pR1iOiaj+4uZJIUp//Z27QWu5Cseiw3O3AR8hVpax7Aw==} 709 703 engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 710 704 711 - '@typescript-eslint/typescript-estree@8.20.0': 712 - resolution: {integrity: sha512-Y7ncuy78bJqHI35NwzWol8E0X7XkRVS4K4P4TCyzWkOJih5NDvtoRDW4Ba9YJJoB2igm9yXDdYI/+fkiiAxPzA==} 705 + '@typescript-eslint/typescript-estree@8.25.0': 706 + resolution: {integrity: sha512-ZPaiAKEZ6Blt/TPAx5Ot0EIB/yGtLI2EsGoY6F7XKklfMxYQyvtL+gT/UCqkMzO0BVFHLDlzvFqQzurYahxv9Q==} 713 707 engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 714 708 peerDependencies: 715 709 typescript: '>=4.8.4 <5.8.0' 716 710 717 - '@typescript-eslint/utils@8.20.0': 718 - resolution: {integrity: sha512-dq70RUw6UK9ei7vxc4KQtBRk7qkHZv447OUZ6RPQMQl71I3NZxQJX/f32Smr+iqWrB02pHKn2yAdHBb0KNrRMA==} 711 + '@typescript-eslint/utils@8.25.0': 712 + resolution: {integrity: sha512-syqRbrEv0J1wywiLsK60XzHnQe/kRViI3zwFALrNEgnntn1l24Ra2KvOAWwWbWZ1lBZxZljPDGOq967dsl6fkA==} 719 713 engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 720 714 peerDependencies: 721 715 eslint: ^8.57.0 || ^9.0.0 722 716 typescript: '>=4.8.4 <5.8.0' 723 717 724 - '@typescript-eslint/visitor-keys@8.20.0': 725 - resolution: {integrity: sha512-v/BpkeeYAsPkKCkR8BDwcno0llhzWVqPOamQrAEMdpZav2Y9OVjd9dwJyBLJWwf335B5DmlifECIkZRJCaGaHA==} 718 + '@typescript-eslint/visitor-keys@8.25.0': 719 + resolution: {integrity: sha512-kCYXKAum9CecGVHGij7muybDfTS2sD3t0L4bJsEZLkyrXUImiCTq1M3LG2SRtOhiHFwMR9wAFplpT6XHYjTkwQ==} 726 720 engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 727 721 728 722 '@vitest/expect@2.1.3': ··· 871 865 supports-color: 872 866 optional: true 873 867 868 + debug@4.4.0: 869 + resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==} 870 + engines: {node: '>=6.0'} 871 + peerDependencies: 872 + supports-color: '*' 873 + peerDependenciesMeta: 874 + supports-color: 875 + optional: true 876 + 874 877 deep-eql@5.0.2: 875 878 resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} 876 879 engines: {node: '>=6'} ··· 912 915 peerDependencies: 913 916 eslint: '>=7.0.0' 914 917 915 - eslint-plugin-prettier@5.2.2: 916 - resolution: {integrity: sha512-1yI3/hf35wmlq66C8yOyrujQnel+v5l1Vop5Cl2I6ylyNTT1JbuUUnV3/41PzwTzcyDp/oF0jWE3HXvcH5AQOQ==} 917 - engines: {node: ^14.18.0 || >=16.0.0} 918 - peerDependencies: 919 - '@types/eslint': '>=8.0.0' 920 - eslint: '>=8.0.0' 921 - eslint-config-prettier: '*' 922 - prettier: '>=3.0.0' 923 - peerDependenciesMeta: 924 - '@types/eslint': 925 - optional: true 926 - eslint-config-prettier: 927 - optional: true 928 - 929 918 eslint-scope@8.2.0: 930 919 resolution: {integrity: sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==} 931 920 engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} ··· 974 963 fast-deep-equal@3.1.3: 975 964 resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} 976 965 977 - fast-diff@1.3.0: 978 - resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} 979 - 980 966 fast-glob@3.3.3: 981 967 resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} 982 968 engines: {node: '>=8.6.0'} ··· 987 973 fast-levenshtein@2.0.6: 988 974 resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} 989 975 990 - fastq@1.18.0: 991 - resolution: {integrity: sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw==} 976 + fastq@1.19.1: 977 + resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==} 992 978 993 979 fdir@6.4.3: 994 980 resolution: {integrity: sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==} ··· 1014 1000 resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} 1015 1001 engines: {node: '>=16'} 1016 1002 1017 - flatted@3.3.2: 1018 - resolution: {integrity: sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==} 1003 + flatted@3.3.3: 1004 + resolution: {integrity: sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==} 1019 1005 1020 1006 foreground-child@3.3.0: 1021 1007 resolution: {integrity: sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==} ··· 1056 1042 resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} 1057 1043 engines: {node: '>= 4'} 1058 1044 1059 - import-fresh@3.3.0: 1060 - resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} 1045 + import-fresh@3.3.1: 1046 + resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==} 1061 1047 engines: {node: '>=6'} 1062 1048 1063 1049 imurmurhash@0.1.4: ··· 1260 1246 resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} 1261 1247 engines: {node: '>= 0.8.0'} 1262 1248 1263 - prettier-linter-helpers@1.0.0: 1264 - resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==} 1265 - engines: {node: '>=6.0.0'} 1266 - 1267 - prettier@3.4.2: 1268 - resolution: {integrity: sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==} 1249 + prettier@3.5.2: 1250 + resolution: {integrity: sha512-lc6npv5PH7hVqozBR7lkBNOGXV9vMwROAPlumdBkX0wTbbzPu/U1hk5yL8p2pt4Xoc+2mkT8t/sow2YrV/M5qg==} 1269 1251 engines: {node: '>=14'} 1270 1252 hasBin: true 1271 1253 ··· 1291 1273 resolve-pkg-maps@1.0.0: 1292 1274 resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} 1293 1275 1294 - reusify@1.0.4: 1295 - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} 1276 + reusify@1.1.0: 1277 + resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} 1296 1278 engines: {iojs: '>=1.0.0', node: '>=0.10.0'} 1297 1279 1298 1280 rollup@4.24.2: ··· 1303 1285 run-parallel@1.2.0: 1304 1286 resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} 1305 1287 1306 - semver@7.6.3: 1307 - resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} 1288 + semver@7.7.1: 1289 + resolution: {integrity: sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==} 1308 1290 engines: {node: '>=10'} 1309 1291 hasBin: true 1310 1292 ··· 1366 1348 resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} 1367 1349 engines: {node: '>=8'} 1368 1350 1369 - synckit@0.9.2: 1370 - resolution: {integrity: sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==} 1371 - engines: {node: ^14.18.0 || >=16.0.0} 1372 - 1373 1351 thenify-all@1.6.0: 1374 1352 resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} 1375 1353 engines: {node: '>=0.8'} ··· 1410 1388 resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} 1411 1389 hasBin: true 1412 1390 1413 - ts-api-utils@2.0.0: 1414 - resolution: {integrity: sha512-xCt/TOAc+EOHS1XPnijD3/yzpH6qg2xppZO1YDqGoVsNXfQfzHpOdNuXwrwOU8u4ITXJyDCTyt8w5g1sZv9ynQ==} 1391 + ts-api-utils@2.0.1: 1392 + resolution: {integrity: sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==} 1415 1393 engines: {node: '>=18.12'} 1416 1394 peerDependencies: 1417 1395 typescript: '>=4.8.4' ··· 1419 1397 ts-interface-checker@0.1.13: 1420 1398 resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} 1421 1399 1422 - tslib@2.8.1: 1423 - resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} 1424 - 1425 1400 tsup@8.3.6: 1426 1401 resolution: {integrity: sha512-XkVtlDV/58S9Ye0JxUUTcrQk4S+EqlOHKzg6Roa62rdjL1nGWNUstG0xgI4vanHdfIpjP448J8vlN0oK6XOJ5g==} 1427 1402 engines: {node: '>=18'} ··· 1449 1424 type-check@0.4.0: 1450 1425 resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} 1451 1426 engines: {node: '>= 0.8.0'} 1427 + 1428 + typescript-eslint@8.25.0: 1429 + resolution: {integrity: sha512-TxRdQQLH4g7JkoFlYG3caW5v1S6kEkz8rqt80iQJZUYPq1zD1Ra7HfQBJJ88ABRaMvHAXnwRvRB4V+6sQ9xN5Q==} 1430 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 1431 + peerDependencies: 1432 + eslint: ^8.57.0 || ^9.0.0 1433 + typescript: '>=4.8.4 <5.8.0' 1452 1434 1453 1435 typescript@5.7.3: 1454 1436 resolution: {integrity: sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==} ··· 1779 1761 1780 1762 '@eslint-community/regexpp@4.12.1': {} 1781 1763 1782 - '@eslint/config-array@0.19.1': 1764 + '@eslint/config-array@0.19.2': 1783 1765 dependencies: 1784 - '@eslint/object-schema': 2.1.5 1785 - debug: 4.3.7 1766 + '@eslint/object-schema': 2.1.6 1767 + debug: 4.4.0 1786 1768 minimatch: 3.1.2 1787 1769 transitivePeerDependencies: 1788 1770 - supports-color ··· 1791 1773 dependencies: 1792 1774 '@types/json-schema': 7.0.15 1793 1775 1794 - '@eslint/eslintrc@3.2.0': 1776 + '@eslint/core@0.12.0': 1777 + dependencies: 1778 + '@types/json-schema': 7.0.15 1779 + 1780 + '@eslint/eslintrc@3.3.0': 1795 1781 dependencies: 1796 1782 ajv: 6.12.6 1797 - debug: 4.3.7 1783 + debug: 4.4.0 1798 1784 espree: 10.3.0 1799 1785 globals: 14.0.0 1800 1786 ignore: 5.3.2 1801 - import-fresh: 3.3.0 1787 + import-fresh: 3.3.1 1802 1788 js-yaml: 4.1.0 1803 1789 minimatch: 3.1.2 1804 1790 strip-json-comments: 3.1.1 ··· 1807 1793 1808 1794 '@eslint/js@9.18.0': {} 1809 1795 1810 - '@eslint/object-schema@2.1.5': {} 1796 + '@eslint/object-schema@2.1.6': {} 1811 1797 1812 - '@eslint/plugin-kit@0.2.5': 1798 + '@eslint/plugin-kit@0.2.7': 1813 1799 dependencies: 1814 - '@eslint/core': 0.10.0 1800 + '@eslint/core': 0.12.0 1815 1801 levn: 0.4.1 1816 1802 1817 1803 '@humanfs/core@0.19.1': {} ··· 1825 1811 1826 1812 '@humanwhocodes/retry@0.3.1': {} 1827 1813 1828 - '@humanwhocodes/retry@0.4.1': {} 1814 + '@humanwhocodes/retry@0.4.2': {} 1829 1815 1830 1816 '@isaacs/cliui@8.0.2': 1831 1817 dependencies: ··· 1863 1849 '@nodelib/fs.walk@1.2.8': 1864 1850 dependencies: 1865 1851 '@nodelib/fs.scandir': 2.1.5 1866 - fastq: 1.18.0 1852 + fastq: 1.19.1 1867 1853 1868 1854 '@pkgjs/parseargs@0.11.0': 1869 1855 optional: true 1870 1856 1871 - '@pkgr/core@0.1.1': {} 1872 - 1873 1857 '@rollup/rollup-android-arm-eabi@4.24.2': 1874 1858 optional: true 1875 1859 ··· 1932 1916 dependencies: 1933 1917 undici-types: 6.19.8 1934 1918 1935 - '@typescript-eslint/eslint-plugin@8.20.0(@typescript-eslint/parser@8.20.0(eslint@9.18.0)(typescript@5.7.3))(eslint@9.18.0)(typescript@5.7.3)': 1919 + '@typescript-eslint/eslint-plugin@8.25.0(@typescript-eslint/parser@8.25.0(eslint@9.18.0)(typescript@5.7.3))(eslint@9.18.0)(typescript@5.7.3)': 1936 1920 dependencies: 1937 1921 '@eslint-community/regexpp': 4.12.1 1938 - '@typescript-eslint/parser': 8.20.0(eslint@9.18.0)(typescript@5.7.3) 1939 - '@typescript-eslint/scope-manager': 8.20.0 1940 - '@typescript-eslint/type-utils': 8.20.0(eslint@9.18.0)(typescript@5.7.3) 1941 - '@typescript-eslint/utils': 8.20.0(eslint@9.18.0)(typescript@5.7.3) 1942 - '@typescript-eslint/visitor-keys': 8.20.0 1922 + '@typescript-eslint/parser': 8.25.0(eslint@9.18.0)(typescript@5.7.3) 1923 + '@typescript-eslint/scope-manager': 8.25.0 1924 + '@typescript-eslint/type-utils': 8.25.0(eslint@9.18.0)(typescript@5.7.3) 1925 + '@typescript-eslint/utils': 8.25.0(eslint@9.18.0)(typescript@5.7.3) 1926 + '@typescript-eslint/visitor-keys': 8.25.0 1943 1927 eslint: 9.18.0 1944 1928 graphemer: 1.4.0 1945 1929 ignore: 5.3.2 1946 1930 natural-compare: 1.4.0 1947 - ts-api-utils: 2.0.0(typescript@5.7.3) 1931 + ts-api-utils: 2.0.1(typescript@5.7.3) 1948 1932 typescript: 5.7.3 1949 1933 transitivePeerDependencies: 1950 1934 - supports-color 1951 1935 1952 - '@typescript-eslint/parser@8.20.0(eslint@9.18.0)(typescript@5.7.3)': 1936 + '@typescript-eslint/parser@8.25.0(eslint@9.18.0)(typescript@5.7.3)': 1953 1937 dependencies: 1954 - '@typescript-eslint/scope-manager': 8.20.0 1955 - '@typescript-eslint/types': 8.20.0 1956 - '@typescript-eslint/typescript-estree': 8.20.0(typescript@5.7.3) 1957 - '@typescript-eslint/visitor-keys': 8.20.0 1958 - debug: 4.3.7 1938 + '@typescript-eslint/scope-manager': 8.25.0 1939 + '@typescript-eslint/types': 8.25.0 1940 + '@typescript-eslint/typescript-estree': 8.25.0(typescript@5.7.3) 1941 + '@typescript-eslint/visitor-keys': 8.25.0 1942 + debug: 4.4.0 1959 1943 eslint: 9.18.0 1960 1944 typescript: 5.7.3 1961 1945 transitivePeerDependencies: 1962 1946 - supports-color 1963 1947 1964 - '@typescript-eslint/scope-manager@8.20.0': 1948 + '@typescript-eslint/scope-manager@8.25.0': 1965 1949 dependencies: 1966 - '@typescript-eslint/types': 8.20.0 1967 - '@typescript-eslint/visitor-keys': 8.20.0 1950 + '@typescript-eslint/types': 8.25.0 1951 + '@typescript-eslint/visitor-keys': 8.25.0 1968 1952 1969 - '@typescript-eslint/type-utils@8.20.0(eslint@9.18.0)(typescript@5.7.3)': 1953 + '@typescript-eslint/type-utils@8.25.0(eslint@9.18.0)(typescript@5.7.3)': 1970 1954 dependencies: 1971 - '@typescript-eslint/typescript-estree': 8.20.0(typescript@5.7.3) 1972 - '@typescript-eslint/utils': 8.20.0(eslint@9.18.0)(typescript@5.7.3) 1973 - debug: 4.3.7 1955 + '@typescript-eslint/typescript-estree': 8.25.0(typescript@5.7.3) 1956 + '@typescript-eslint/utils': 8.25.0(eslint@9.18.0)(typescript@5.7.3) 1957 + debug: 4.4.0 1974 1958 eslint: 9.18.0 1975 - ts-api-utils: 2.0.0(typescript@5.7.3) 1959 + ts-api-utils: 2.0.1(typescript@5.7.3) 1976 1960 typescript: 5.7.3 1977 1961 transitivePeerDependencies: 1978 1962 - supports-color 1979 1963 1980 - '@typescript-eslint/types@8.20.0': {} 1964 + '@typescript-eslint/types@8.25.0': {} 1981 1965 1982 - '@typescript-eslint/typescript-estree@8.20.0(typescript@5.7.3)': 1966 + '@typescript-eslint/typescript-estree@8.25.0(typescript@5.7.3)': 1983 1967 dependencies: 1984 - '@typescript-eslint/types': 8.20.0 1985 - '@typescript-eslint/visitor-keys': 8.20.0 1986 - debug: 4.3.7 1968 + '@typescript-eslint/types': 8.25.0 1969 + '@typescript-eslint/visitor-keys': 8.25.0 1970 + debug: 4.4.0 1987 1971 fast-glob: 3.3.3 1988 1972 is-glob: 4.0.3 1989 1973 minimatch: 9.0.5 1990 - semver: 7.6.3 1991 - ts-api-utils: 2.0.0(typescript@5.7.3) 1974 + semver: 7.7.1 1975 + ts-api-utils: 2.0.1(typescript@5.7.3) 1992 1976 typescript: 5.7.3 1993 1977 transitivePeerDependencies: 1994 1978 - supports-color 1995 1979 1996 - '@typescript-eslint/utils@8.20.0(eslint@9.18.0)(typescript@5.7.3)': 1980 + '@typescript-eslint/utils@8.25.0(eslint@9.18.0)(typescript@5.7.3)': 1997 1981 dependencies: 1998 1982 '@eslint-community/eslint-utils': 4.4.1(eslint@9.18.0) 1999 - '@typescript-eslint/scope-manager': 8.20.0 2000 - '@typescript-eslint/types': 8.20.0 2001 - '@typescript-eslint/typescript-estree': 8.20.0(typescript@5.7.3) 1983 + '@typescript-eslint/scope-manager': 8.25.0 1984 + '@typescript-eslint/types': 8.25.0 1985 + '@typescript-eslint/typescript-estree': 8.25.0(typescript@5.7.3) 2002 1986 eslint: 9.18.0 2003 1987 typescript: 5.7.3 2004 1988 transitivePeerDependencies: 2005 1989 - supports-color 2006 1990 2007 - '@typescript-eslint/visitor-keys@8.20.0': 1991 + '@typescript-eslint/visitor-keys@8.25.0': 2008 1992 dependencies: 2009 - '@typescript-eslint/types': 8.20.0 1993 + '@typescript-eslint/types': 8.25.0 2010 1994 eslint-visitor-keys: 4.2.0 2011 1995 2012 1996 '@vitest/expect@2.1.3': ··· 2147 2131 dependencies: 2148 2132 ms: 2.1.3 2149 2133 2134 + debug@4.4.0: 2135 + dependencies: 2136 + ms: 2.1.3 2137 + 2150 2138 deep-eql@5.0.2: {} 2151 2139 2152 2140 deep-is@0.1.4: {} ··· 2244 2232 dependencies: 2245 2233 eslint: 9.18.0 2246 2234 2247 - eslint-plugin-prettier@5.2.2(eslint-config-prettier@10.0.1(eslint@9.18.0))(eslint@9.18.0)(prettier@3.4.2): 2248 - dependencies: 2249 - eslint: 9.18.0 2250 - prettier: 3.4.2 2251 - prettier-linter-helpers: 1.0.0 2252 - synckit: 0.9.2 2253 - optionalDependencies: 2254 - eslint-config-prettier: 10.0.1(eslint@9.18.0) 2255 - 2256 2235 eslint-scope@8.2.0: 2257 2236 dependencies: 2258 2237 esrecurse: 4.3.0 ··· 2266 2245 dependencies: 2267 2246 '@eslint-community/eslint-utils': 4.4.1(eslint@9.18.0) 2268 2247 '@eslint-community/regexpp': 4.12.1 2269 - '@eslint/config-array': 0.19.1 2248 + '@eslint/config-array': 0.19.2 2270 2249 '@eslint/core': 0.10.0 2271 - '@eslint/eslintrc': 3.2.0 2250 + '@eslint/eslintrc': 3.3.0 2272 2251 '@eslint/js': 9.18.0 2273 - '@eslint/plugin-kit': 0.2.5 2252 + '@eslint/plugin-kit': 0.2.7 2274 2253 '@humanfs/node': 0.16.6 2275 2254 '@humanwhocodes/module-importer': 1.0.1 2276 - '@humanwhocodes/retry': 0.4.1 2255 + '@humanwhocodes/retry': 0.4.2 2277 2256 '@types/estree': 1.0.6 2278 2257 '@types/json-schema': 7.0.15 2279 2258 ajv: 6.12.6 2280 2259 chalk: 4.1.2 2281 2260 cross-spawn: 7.0.6 2282 - debug: 4.3.7 2261 + debug: 4.4.0 2283 2262 escape-string-regexp: 4.0.0 2284 2263 eslint-scope: 8.2.0 2285 2264 eslint-visitor-keys: 4.2.0 ··· 2325 2304 2326 2305 fast-deep-equal@3.1.3: {} 2327 2306 2328 - fast-diff@1.3.0: {} 2329 - 2330 2307 fast-glob@3.3.3: 2331 2308 dependencies: 2332 2309 '@nodelib/fs.stat': 2.0.5 ··· 2339 2316 2340 2317 fast-levenshtein@2.0.6: {} 2341 2318 2342 - fastq@1.18.0: 2319 + fastq@1.19.1: 2343 2320 dependencies: 2344 - reusify: 1.0.4 2321 + reusify: 1.1.0 2345 2322 2346 2323 fdir@6.4.3(picomatch@4.0.2): 2347 2324 optionalDependencies: ··· 2362 2339 2363 2340 flat-cache@4.0.1: 2364 2341 dependencies: 2365 - flatted: 3.3.2 2342 + flatted: 3.3.3 2366 2343 keyv: 4.5.4 2367 2344 2368 - flatted@3.3.2: {} 2345 + flatted@3.3.3: {} 2369 2346 2370 2347 foreground-child@3.3.0: 2371 2348 dependencies: ··· 2404 2381 2405 2382 ignore@5.3.2: {} 2406 2383 2407 - import-fresh@3.3.0: 2384 + import-fresh@3.3.1: 2408 2385 dependencies: 2409 2386 parent-module: 1.0.1 2410 2387 resolve-from: 4.0.0 ··· 2564 2541 2565 2542 prelude-ls@1.2.1: {} 2566 2543 2567 - prettier-linter-helpers@1.0.0: 2568 - dependencies: 2569 - fast-diff: 1.3.0 2570 - 2571 - prettier@3.4.2: {} 2544 + prettier@3.5.2: {} 2572 2545 2573 2546 punycode@2.3.1: {} 2574 2547 ··· 2582 2555 2583 2556 resolve-pkg-maps@1.0.0: {} 2584 2557 2585 - reusify@1.0.4: {} 2558 + reusify@1.1.0: {} 2586 2559 2587 2560 rollup@4.24.2: 2588 2561 dependencies: ··· 2612 2585 dependencies: 2613 2586 queue-microtask: 1.2.3 2614 2587 2615 - semver@7.6.3: {} 2588 + semver@7.7.1: {} 2616 2589 2617 2590 shebang-command@2.0.0: 2618 2591 dependencies: ··· 2670 2643 dependencies: 2671 2644 has-flag: 4.0.0 2672 2645 2673 - synckit@0.9.2: 2674 - dependencies: 2675 - '@pkgr/core': 0.1.1 2676 - tslib: 2.8.1 2677 - 2678 2646 thenify-all@1.6.0: 2679 2647 dependencies: 2680 2648 thenify: 3.3.1 ··· 2708 2676 2709 2677 tree-kill@1.2.2: {} 2710 2678 2711 - ts-api-utils@2.0.0(typescript@5.7.3): 2679 + ts-api-utils@2.0.1(typescript@5.7.3): 2712 2680 dependencies: 2713 2681 typescript: 5.7.3 2714 2682 2715 2683 ts-interface-checker@0.1.13: {} 2716 - 2717 - tslib@2.8.1: {} 2718 2684 2719 2685 tsup@8.3.6(postcss@8.4.47)(tsx@4.19.1)(typescript@5.7.3): 2720 2686 dependencies: ··· 2753 2719 type-check@0.4.0: 2754 2720 dependencies: 2755 2721 prelude-ls: 1.2.1 2722 + 2723 + typescript-eslint@8.25.0(eslint@9.18.0)(typescript@5.7.3): 2724 + dependencies: 2725 + '@typescript-eslint/eslint-plugin': 8.25.0(@typescript-eslint/parser@8.25.0(eslint@9.18.0)(typescript@5.7.3))(eslint@9.18.0)(typescript@5.7.3) 2726 + '@typescript-eslint/parser': 8.25.0(eslint@9.18.0)(typescript@5.7.3) 2727 + '@typescript-eslint/utils': 8.25.0(eslint@9.18.0)(typescript@5.7.3) 2728 + eslint: 9.18.0 2729 + typescript: 5.7.3 2730 + transitivePeerDependencies: 2731 + - supports-color 2756 2732 2757 2733 typescript@5.7.3: {} 2758 2734
+1 -1
src/cac.ts
··· 25 25 if (cmd.name === 'complete') continue; // Skip completion command 26 26 27 27 // Get positional args info from command usage 28 - const args = (cmd.rawName.match(/\[.*?\]|\<.*?\>/g) || []).map((arg) => 28 + const args = (cmd.rawName.match(/\[.*?\]|<.*?>/g) || []).map((arg) => 29 29 arg.startsWith('[') 30 30 ); // true if optional (wrapped in []) 31 31
+7 -4
src/index.ts
··· 108 108 args, 109 109 handler, 110 110 options: new Map(), 111 - parent: parent ? this.commands.get(parent)! : undefined, 111 + parent: parent ? this.commands.get(parent) : undefined, 112 112 }); 113 113 return key; 114 114 } ··· 149 149 150 150 private matchCommand(args: string[]): [Command, string[]] { 151 151 args = this.stripOptions(args); 152 - let parts: string[] = []; 152 + const parts: string[] = []; 153 153 let remaining: string[] = []; 154 + // TODO (43081j): we should probably remove this non-null assertion and 155 + // throw if the `''` command doesn't exist 156 + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion 154 157 let matched: Command = this.commands.get('')!; 155 158 for (let i = 0; i < args.length; i++) { 156 159 const k = args[i]; ··· 336 339 ) { 337 340 const commandParts = [...previousArgs]; 338 341 339 - for (const k of this.commands.keys()) { 342 + for (const [k, command] of this.commands) { 340 343 if (k === '') continue; 341 344 const parts = k.split(' '); 342 345 let match = true; ··· 352 355 if (match && parts[i]?.startsWith(toComplete)) { 353 356 this.completions.push({ 354 357 value: parts[i], 355 - description: this.commands.get(k)!.description, 358 + description: command.description, 356 359 }); 357 360 } 358 361 }
+34 -34
src/zsh.ts
··· 28 28 __${name}_debug "CURRENT: \${CURRENT}, words[*]: \${words[*]}" 29 29 30 30 # The user could have moved the cursor backwards on the command-line. 31 - # We need to trigger completion from the \$CURRENT location, so we need 32 - # to truncate the command-line (\$words) up to the \$CURRENT location. 33 - # (We cannot use \$CURSOR as its value does not work when a command is an alias.) 31 + # We need to trigger completion from the $CURRENT location, so we need 32 + # to truncate the command-line ($words) up to the $CURRENT location. 33 + # (We cannot use $CURSOR as its value does not work when a command is an alias.) 34 34 words=( "\${=words[1,CURRENT]}" ) 35 35 __${name}_debug "Truncated words[*]: \${words[*]}," 36 36 ··· 58 58 __${name}_debug "About to call: eval \${requestComp}" 59 59 60 60 # Use eval to handle any environment variables and such 61 - out=\$(eval \${requestComp} 2>/dev/null) 61 + out=$(eval \${requestComp} 2>/dev/null) 62 62 __${name}_debug "completion output: \${out}" 63 63 64 64 # Extract the directive integer following a : from the last line ··· 73 73 # Remove the directive including the : and the newline 74 74 local suffix 75 75 (( suffix=\${#lastLine}+2)) 76 - out=\${out[1,-\$suffix]} 76 + out=\${out[1,-$suffix]} 77 77 else 78 - # There is no directive specified. Leave \$out as is. 78 + # There is no directive specified. Leave $out as is. 79 79 __${name}_debug "No directive found. Setting to default" 80 80 directive=0 81 81 fi ··· 84 84 __${name}_debug "completions: \${out}" 85 85 __${name}_debug "flagPrefix: \${flagPrefix}" 86 86 87 - if [ \$((directive & shellCompDirectiveError)) -ne 0 ]; then 87 + if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then 88 88 __${name}_debug "Completion received error. Ignoring completions." 89 89 return 90 90 fi 91 91 92 92 local activeHelpMarker="%" 93 93 local endIndex=\${#activeHelpMarker} 94 - local startIndex=\$((\${#activeHelpMarker}+1)) 94 + local startIndex=$((\${#activeHelpMarker}+1)) 95 95 local hasActiveHelp=0 96 96 while IFS='\n' read -r comp; do 97 - # Check if this is an activeHelp statement (i.e., prefixed with \$activeHelpMarker) 98 - if [ "\${comp[1,\$endIndex]}" = "\$activeHelpMarker" ];then 99 - __${name}_debug "ActiveHelp found: \$comp" 100 - comp="\${comp[\$startIndex,-1]}" 101 - if [ -n "\$comp" ]; then 97 + # Check if this is an activeHelp statement (i.e., prefixed with $activeHelpMarker) 98 + if [ "\${comp[1,$endIndex]}" = "$activeHelpMarker" ];then 99 + __${name}_debug "ActiveHelp found: $comp" 100 + comp="\${comp[$startIndex,-1]}" 101 + if [ -n "$comp" ]; then 102 102 compadd -x "\${comp}" 103 103 __${name}_debug "ActiveHelp will need delimiter" 104 104 hasActiveHelp=1 ··· 106 106 continue 107 107 fi 108 108 109 - if [ -n "\$comp" ]; then 109 + if [ -n "$comp" ]; then 110 110 # If requested, completions are returned with a description. 111 111 # The description is preceded by a TAB character. 112 112 # For zsh's _describe, we need to use a : instead of a TAB. 113 113 # We first need to escape any : as part of the completion itself. 114 114 comp=\${comp//:/\\:} 115 115 116 - local tab="\$(printf '\\t')" 117 - comp=\${comp//\$tab/:} 116 + local tab="$(printf '\\t')" 117 + comp=\${comp//$tab/:} 118 118 119 119 __${name}_debug "Adding completion: \${comp}" 120 120 completions+=\${comp} 121 - lastComp=\$comp 121 + lastComp=$comp 122 122 fi 123 123 done < <(printf "%s\n" "\${out[@]}") 124 124 125 125 # Add a delimiter after the activeHelp statements, but only if: 126 126 # - there are completions following the activeHelp statements, or 127 127 # - file completion will be performed (so there will be choices after the activeHelp) 128 - if [ \$hasActiveHelp -eq 1 ]; then 129 - if [ \${#completions} -ne 0 ] || [ \$((directive & shellCompDirectiveNoFileComp)) -eq 0 ]; then 128 + if [ $hasActiveHelp -eq 1 ]; then 129 + if [ \${#completions} -ne 0 ] || [ $((directive & shellCompDirectiveNoFileComp)) -eq 0 ]; then 130 130 __${name}_debug "Adding activeHelp delimiter" 131 131 compadd -x "--" 132 132 hasActiveHelp=0 133 133 fi 134 134 fi 135 135 136 - if [ \$((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then 136 + if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then 137 137 __${name}_debug "Activating nospace." 138 138 noSpace="-S ''" 139 139 fi 140 140 141 - if [ \$((directive & shellCompDirectiveKeepOrder)) -ne 0 ]; then 141 + if [ $((directive & shellCompDirectiveKeepOrder)) -ne 0 ]; then 142 142 __${name}_debug "Activating keep order." 143 143 keepOrder="-V" 144 144 fi 145 145 146 - if [ \$((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then 146 + if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then 147 147 # File extension filtering 148 148 local filteringCmd 149 149 filteringCmd='_files' 150 150 for filter in \${completions[@]}; do 151 151 if [ \${filter[1]} != '*' ]; then 152 152 # zsh requires a glob pattern to do file filtering 153 - filter="\\*.\$filter" 153 + filter="\\*.$filter" 154 154 fi 155 - filteringCmd+=" -g \$filter" 155 + filteringCmd+=" -g $filter" 156 156 done 157 157 filteringCmd+=" \${flagPrefix}" 158 158 159 - __${name}_debug "File filtering command: \$filteringCmd" 160 - _arguments '*:filename:'"\$filteringCmd" 161 - elif [ \$((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then 159 + __${name}_debug "File filtering command: $filteringCmd" 160 + _arguments '*:filename:'"$filteringCmd" 161 + elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then 162 162 # File completion for directories only 163 163 local subdir 164 164 subdir="\${completions[1]}" 165 - if [ -n "\$subdir" ]; then 166 - __${name}_debug "Listing directories in \$subdir" 165 + if [ -n "$subdir" ]; then 166 + __${name}_debug "Listing directories in $subdir" 167 167 pushd "\${subdir}" >/dev/null 2>&1 168 168 else 169 169 __${name}_debug "Listing directories in ." ··· 171 171 172 172 local result 173 173 _arguments '*:dirname:_files -/'" \${flagPrefix}" 174 - result=\$? 175 - if [ -n "\$subdir" ]; then 174 + result=$? 175 + if [ -n "$subdir" ]; then 176 176 popd >/dev/null 2>&1 177 177 fi 178 - return \$result 178 + return $result 179 179 else 180 180 __${name}_debug "Calling _describe" 181 - if eval _describe \$keepOrder "completions" completions -Q \${flagPrefix} \${noSpace}; then 181 + if eval _describe $keepOrder "completions" completions -Q \${flagPrefix} \${noSpace}; then 182 182 __${name}_debug "_describe found some completions" 183 183 184 184 # Return the success of having called _describe ··· 186 186 else 187 187 __${name}_debug "_describe did not find completions." 188 188 __${name}_debug "Checking if we should do file completion." 189 - if [ \$((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then 189 + if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then 190 190 __${name}_debug "deactivating file completion" 191 191 192 192 # We must return an error code here to let zsh know that there were no