exec-sh
exec-sh copied to clipboard
A 'declare' modifier cannot be used in an already ambient context.
tsc -p tsconfig.json
"typescript": "^4.2.3",
"exec-sh": "^0.3.5"
yarn run v1.22.5
$ tsc -p tsconfig.json
node_modules/exec-sh/types/index.d.ts:6:3 - error TS1038: A 'declare' modifier cannot be used in an already ambient context.
6 declare function execSh (command: string | string[], options?: SpawnOptionsWithoutStdio | boolean, callback?: execShCallback): ChildProcessWithoutNullStreams;
~~~~~~~
node_modules/exec-sh/types/index.d.ts:7:3 - error TS1038: A 'declare' modifier cannot be used in an already ambient context.
7 declare function execSh (command: string | string[], callback?: execShCallback): ChildProcessWithoutNullStreams;
~~~~~~~
node_modules/exec-sh/types/index.d.ts:8:3 - error TS1038: A 'declare' modifier cannot be used in an already ambient context.
8 declare namespace execSh {
~~~~~~~
src/bot/commands/private/administration/exec.administration.command.ts:40:55 - error TS2559: Type 'true' has no properties in common with type 'SpawnOptionsWithoutStdio'.
40 const execCommand = await exec.promise(command, true);
~~~~
Found 4 errors.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Could not reproduce the issue with 'declare'. Function type issue is valid. #20 is reverted for now. released 0.3.6.
#23 may work better
Fixed by #23