diff --git a/src/actions/commands/fold.ts b/src/actions/commands/fold.ts index 23f9f87a0b2..74e7475df0d 100644 --- a/src/actions/commands/fold.ts +++ b/src/actions/commands/fold.ts @@ -6,7 +6,7 @@ import { VimState } from '../../state/vimState'; import { BaseCommand, RegisterAction } from '../base'; import { BaseOperator } from '../operator'; -type FoldDirection = 'up' | 'down' | undefined; +type FoldDirection = 'up' | 'down'; abstract class CommandFold extends BaseCommand { modes = [Mode.Normal, Mode.Visual, Mode.VisualLine]; abstract commandName: string; diff --git a/src/cmd_line/commands/read.ts b/src/cmd_line/commands/read.ts index c517d1eb598..f53e3f80183 100644 --- a/src/cmd_line/commands/read.ts +++ b/src/cmd_line/commands/read.ts @@ -6,9 +6,10 @@ import { VimState } from '../../state/vimState'; import { ExCommand } from '../../vimscript/exCommand'; import { fileNameParser, FileOpt, fileOptParser } from '../../vimscript/parserUtils'; -export type IReadCommandArguments = { - opt: FileOpt; -} & ({ cmd: string } | { file: string } | object); +export type IReadCommandArguments = + | { opt: FileOpt; cmd: string } + | { opt: FileOpt; file: string } + | { opt: FileOpt }; // // Implements :read and :read! @@ -17,21 +18,17 @@ export type IReadCommandArguments = { // export class ReadCommand extends ExCommand { public static readonly argParser: Parser = seq( - whitespace.then(fileOptParser).fallback([]), + whitespace.then(fileOptParser).fallback([]), optWhitespace .then( alt<{ cmd: string } | { file: string }>( string('!') .then(all) - .map((cmd) => { - return { cmd }; - }), - fileNameParser.map((file) => { - return { file }; - }), + .map((cmd) => ({ cmd })), + fileNameParser.map((file) => ({ file })), ), ) - .fallback(undefined), + .fallback({}), ).map(([opt, other]) => new ReadCommand({ opt, ...other })); private readonly arguments: IReadCommandArguments; diff --git a/src/cmd_line/commands/write.ts b/src/cmd_line/commands/write.ts index 7af6c5b6dbe..fa2a8596743 100644 --- a/src/cmd_line/commands/write.ts +++ b/src/cmd_line/commands/write.ts @@ -14,7 +14,8 @@ export type IWriteCommandArguments = { opt: FileOpt; bgWrite: boolean; file?: string; -} & ({ cmd: string } | object); + cmd?: string; +}; // // Implements :write diff --git a/yarn.lock b/yarn.lock index 5980c2fa352..9700480fcac 100644 --- a/yarn.lock +++ b/yarn.lock @@ -688,101 +688,105 @@ integrity sha512-LyeCIU3jb9d38w0MXFwta9r0Jx23ugujkAxdwLTNCyspdZTKUc43t7ppPbCiPoQ/Ivd/pnDFZrb4hWd45wrsgA== "@typescript-eslint/eslint-plugin@^8.0.0": - version "8.46.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.46.3.tgz#6f7aeaf9f5c611425db9b8f983e8d3fe5deece3c" - integrity sha512-sbaQ27XBUopBkRiuY/P9sWGOWUW4rl8fDoHIUmLpZd8uldsTyB4/Zg6bWTegPoTLnKj9Hqgn3QD6cjPNB32Odw== + version "8.48.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.48.0.tgz#cdc9bdbe947713f658eb6109eeeea5d746824cf4" + integrity sha512-XxXP5tL1txl13YFtrECECQYeZjBZad4fyd3cFV4a19LkAY/bIp9fev3US4S5fDVV2JaYFiKAZ/GRTOLer+mbyQ== dependencies: "@eslint-community/regexpp" "^4.10.0" - "@typescript-eslint/scope-manager" "8.46.3" - "@typescript-eslint/type-utils" "8.46.3" - "@typescript-eslint/utils" "8.46.3" - "@typescript-eslint/visitor-keys" "8.46.3" + "@typescript-eslint/scope-manager" "8.48.0" + "@typescript-eslint/type-utils" "8.48.0" + "@typescript-eslint/utils" "8.48.0" + "@typescript-eslint/visitor-keys" "8.48.0" graphemer "^1.4.0" ignore "^7.0.0" natural-compare "^1.4.0" ts-api-utils "^2.1.0" "@typescript-eslint/parser@^8.0.0": - version "8.46.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.46.3.tgz#3badfb62d2e2dc733d02a038073e3f65f2cb833d" - integrity sha512-6m1I5RmHBGTnUGS113G04DMu3CpSdxCAU/UvtjNWL4Nuf3MW9tQhiJqRlHzChIkhy6kZSAQmc+I1bcGjE3yNKg== - dependencies: - "@typescript-eslint/scope-manager" "8.46.3" - "@typescript-eslint/types" "8.46.3" - "@typescript-eslint/typescript-estree" "8.46.3" - "@typescript-eslint/visitor-keys" "8.46.3" + version "8.48.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.48.0.tgz#fc39ea9b1c8b2414c1f4b625277629e12a940e6b" + integrity sha512-jCzKdm/QK0Kg4V4IK/oMlRZlY+QOcdjv89U2NgKHZk1CYTj82/RVSx1mV/0gqCVMJ/DA+Zf/S4NBWNF8GQ+eqQ== + dependencies: + "@typescript-eslint/scope-manager" "8.48.0" + "@typescript-eslint/types" "8.48.0" + "@typescript-eslint/typescript-estree" "8.48.0" + "@typescript-eslint/visitor-keys" "8.48.0" debug "^4.3.4" -"@typescript-eslint/project-service@8.46.3": - version "8.46.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/project-service/-/project-service-8.46.3.tgz#4555c685407ea829081218fa033d7b032607aaef" - integrity sha512-Fz8yFXsp2wDFeUElO88S9n4w1I4CWDTXDqDr9gYvZgUpwXQqmZBr9+NTTql5R3J7+hrJZPdpiWaB9VNhAKYLuQ== +"@typescript-eslint/project-service@8.48.0": + version "8.48.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/project-service/-/project-service-8.48.0.tgz#c21f6f897fbc4e61c7b1e20906ea1d59594ccc2d" + integrity sha512-Ne4CTZyRh1BecBf84siv42wv5vQvVmgtk8AuiEffKTUo3DrBaGYZueJSxxBZ8fjk/N3DrgChH4TOdIOwOwiqqw== dependencies: - "@typescript-eslint/tsconfig-utils" "^8.46.3" - "@typescript-eslint/types" "^8.46.3" + "@typescript-eslint/tsconfig-utils" "^8.48.0" + "@typescript-eslint/types" "^8.48.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@8.46.3": - version "8.46.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.46.3.tgz#2e330f566e135ccac13477b98dd88d8f176e4dff" - integrity sha512-FCi7Y1zgrmxp3DfWfr+3m9ansUUFoy8dkEdeQSgA9gbm8DaHYvZCdkFRQrtKiedFf3Ha6VmoqoAaP68+i+22kg== +"@typescript-eslint/scope-manager@8.48.0": + version "8.48.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.48.0.tgz#8306afdf409364d4e434813f0df9a8557ddff751" + integrity sha512-uGSSsbrtJrLduti0Q1Q9+BF1/iFKaxGoQwjWOIVNJv0o6omrdyR8ct37m4xIl5Zzpkp69Kkmvom7QFTtue89YQ== dependencies: - "@typescript-eslint/types" "8.46.3" - "@typescript-eslint/visitor-keys" "8.46.3" + "@typescript-eslint/types" "8.48.0" + "@typescript-eslint/visitor-keys" "8.48.0" -"@typescript-eslint/tsconfig-utils@8.46.3", "@typescript-eslint/tsconfig-utils@^8.46.3": - version "8.46.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.46.3.tgz#cad33398c762c97fe56a8defda00c16505abefa3" - integrity sha512-GLupljMniHNIROP0zE7nCcybptolcH8QZfXOpCfhQDAdwJ/ZTlcaBOYebSOZotpti/3HrHSw7D3PZm75gYFsOA== +"@typescript-eslint/tsconfig-utils@8.48.0", "@typescript-eslint/tsconfig-utils@^8.48.0": + version "8.48.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.48.0.tgz#05cf091cd9f24a8e047783ff979136df6cf1be04" + integrity sha512-WNebjBdFdyu10sR1M4OXTt2OkMd5KWIL+LLfeH9KhgP+jzfDV/LI3eXzwJ1s9+Yc0Kzo2fQCdY/OpdusCMmh6w== -"@typescript-eslint/type-utils@8.46.3": - version "8.46.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.46.3.tgz#71188df833d7697ecff256cd1d3889a20552d78c" - integrity sha512-ZPCADbr+qfz3aiTTYNNkCbUt+cjNwI/5McyANNrFBpVxPt7GqpEYz5ZfdwuFyGUnJ9FdDXbGODUu6iRCI6XRXw== +"@typescript-eslint/type-utils@8.48.0": + version "8.48.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.48.0.tgz#eb4e0e60e545b448112f291b6652eeddb16db83f" + integrity sha512-zbeVaVqeXhhab6QNEKfK96Xyc7UQuoFWERhEnj3mLVnUWrQnv15cJNseUni7f3g557gm0e46LZ6IJ4NJVOgOpw== dependencies: - "@typescript-eslint/types" "8.46.3" - "@typescript-eslint/typescript-estree" "8.46.3" - "@typescript-eslint/utils" "8.46.3" + "@typescript-eslint/types" "8.48.0" + "@typescript-eslint/typescript-estree" "8.48.0" + "@typescript-eslint/utils" "8.48.0" debug "^4.3.4" ts-api-utils "^2.1.0" -"@typescript-eslint/types@8.46.3", "@typescript-eslint/types@^8.46.0", "@typescript-eslint/types@^8.46.3": +"@typescript-eslint/types@8.48.0", "@typescript-eslint/types@^8.48.0": + version "8.48.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.48.0.tgz#f0dc5cf27217346e9b0d90556911e01d90d0f2a5" + integrity sha512-cQMcGQQH7kwKoVswD1xdOytxQR60MWKM1di26xSUtxehaDs/32Zpqsu5WJlXTtTTqyAVK8R7hvsUnIXRS+bjvA== + +"@typescript-eslint/types@^8.46.0": version "8.46.3" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.46.3.tgz#da05ea40e91359b4275dbb3a489f2f7907a02245" integrity sha512-G7Ok9WN/ggW7e/tOf8TQYMaxgID3Iujn231hfi0Pc7ZheztIJVpO44ekY00b7akqc6nZcvregk0Jpah3kep6hA== -"@typescript-eslint/typescript-estree@8.46.3": - version "8.46.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.46.3.tgz#c12406afba707f9779ce0c0151a08c33b3a96d41" - integrity sha512-f/NvtRjOm80BtNM5OQtlaBdM5BRFUv7gf381j9wygDNL+qOYSNOgtQ/DCndiYi80iIOv76QqaTmp4fa9hwI0OA== +"@typescript-eslint/typescript-estree@8.48.0": + version "8.48.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.48.0.tgz#38b340524ce34ce0e46ca541a86cf6cad8872e5b" + integrity sha512-ljHab1CSO4rGrQIAyizUS6UGHHCiAYhbfcIZ1zVJr5nMryxlXMVWS3duFPSKvSUbFPwkXMFk1k0EMIjub4sRRQ== dependencies: - "@typescript-eslint/project-service" "8.46.3" - "@typescript-eslint/tsconfig-utils" "8.46.3" - "@typescript-eslint/types" "8.46.3" - "@typescript-eslint/visitor-keys" "8.46.3" + "@typescript-eslint/project-service" "8.48.0" + "@typescript-eslint/tsconfig-utils" "8.48.0" + "@typescript-eslint/types" "8.48.0" + "@typescript-eslint/visitor-keys" "8.48.0" debug "^4.3.4" - fast-glob "^3.3.2" - is-glob "^4.0.3" minimatch "^9.0.4" semver "^7.6.0" + tinyglobby "^0.2.15" ts-api-utils "^2.1.0" -"@typescript-eslint/utils@8.46.3": - version "8.46.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.46.3.tgz#b6c7994b7c1ee2fe338ab32f7b3d4424856a73ce" - integrity sha512-VXw7qmdkucEx9WkmR3ld/u6VhRyKeiF1uxWwCy/iuNfokjJ7VhsgLSOTjsol8BunSw190zABzpwdNsze2Kpo4g== +"@typescript-eslint/utils@8.48.0": + version "8.48.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.48.0.tgz#c1196befb664f50be10692c781c7fc7624c1a5f9" + integrity sha512-yTJO1XuGxCsSfIVt1+1UrLHtue8xz16V8apzPYI06W0HbEbEWHxHXgZaAgavIkoh+GeV6hKKd5jm0sS6OYxWXQ== dependencies: "@eslint-community/eslint-utils" "^4.7.0" - "@typescript-eslint/scope-manager" "8.46.3" - "@typescript-eslint/types" "8.46.3" - "@typescript-eslint/typescript-estree" "8.46.3" + "@typescript-eslint/scope-manager" "8.48.0" + "@typescript-eslint/types" "8.48.0" + "@typescript-eslint/typescript-estree" "8.48.0" -"@typescript-eslint/visitor-keys@8.46.3": - version "8.46.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.46.3.tgz#6811b15053501981059c58e1c01b39242bd5c0f6" - integrity sha512-uk574k8IU0rOF/AjniX8qbLSGURJVUCeM5e4MIMKBFFi8weeiLrG1fyQejyLXQpRZbU/1BuQasleV/RfHC3hHg== +"@typescript-eslint/visitor-keys@8.48.0": + version "8.48.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.48.0.tgz#6b07ef5661a85d08b01fbe4b8310a7311a6471af" + integrity sha512-T0XJMaRPOH3+LBbAfzR2jalckP1MSG/L9eUtY0DEzUyVaXJ/t6zN0nR7co5kz0Jko/nkSYCBRkz1djvjajVTTg== dependencies: - "@typescript-eslint/types" "8.46.3" + "@typescript-eslint/types" "8.48.0" eslint-visitor-keys "^4.2.1" "@typespec/ts-http-runtime@^0.3.0": @@ -2554,7 +2558,7 @@ fast-fifo@^1.1.0: resolved "https://registry.yarnpkg.com/fast-fifo/-/fast-fifo-1.3.2.tgz#286e31de96eb96d38a97899815740ba2a4f3640c" integrity sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ== -fast-glob@^3.3.2, fast-glob@^3.3.3: +fast-glob@^3.3.3: version "3.3.3" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.3.tgz#d06d585ce8dba90a16b0505c543c3ccfb3aeb818" integrity sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg== @@ -2618,6 +2622,11 @@ fd-slicer@~1.1.0: dependencies: pend "~1.2.0" +fdir@^6.5.0: + version "6.5.0" + resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.5.0.tgz#ed2ab967a331ade62f18d077dae192684d50d350" + integrity sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg== + fecha@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/fecha/-/fecha-4.2.0.tgz#3ffb6395453e3f3efff850404f0a59b6747f5f41" @@ -4937,6 +4946,11 @@ picomatch@^2.3.1: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== +picomatch@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.3.tgz#796c76136d1eead715db1e7bad785dedd695a042" + integrity sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q== + pidtree@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.6.0.tgz#90ad7b6d42d5841e69e0a2419ef38f8883aa057c" @@ -6099,6 +6113,14 @@ time-stamp@^1.0.0: resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-1.1.0.tgz#764a5a11af50561921b133f3b44e618687e0f5c3" integrity sha1-dkpaEa9QVhkhsTPztE5hhofg9cM= +tinyglobby@^0.2.15: + version "0.2.15" + resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.15.tgz#e228dd1e638cea993d2fdb4fcd2d4602a79951c2" + integrity sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ== + dependencies: + fdir "^6.5.0" + picomatch "^4.0.3" + tmp@^0.2.3: version "0.2.5" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.5.tgz#b06bcd23f0f3c8357b426891726d16015abfd8f8"