Update ESLint rules and error handling
- Remove "no-unused-vars" and "no-unused-expressions" from .eslintrc.json. - Simplify error handling in devchat.ts by returning stderr directly. - Remove "noUnusedLocals" and "noUnusedParameters" from tsconfig.json.
This commit is contained in:
parent
ba097eab26
commit
3136748f72
@ -9,8 +9,6 @@
|
||||
"@typescript-eslint"
|
||||
],
|
||||
"rules": {
|
||||
"no-unused-vars": "warn",
|
||||
"no-unused-expressions": "warn",
|
||||
"@typescript-eslint/naming-convention": "warn",
|
||||
"@typescript-eslint/semi": "warn",
|
||||
"curly": "warn",
|
||||
|
@ -208,12 +208,11 @@ class DevChat {
|
||||
const { exitCode: code, stdout, stderr } = await this.commandRun.spawnAsync(devChat, args, spawnAsyncOptions, onStdoutPartial, undefined, undefined, undefined);
|
||||
|
||||
if (stderr) {
|
||||
const errorMessage = stderr.trim().match(/Error:(.+)/)?.[1];
|
||||
return {
|
||||
"prompt-hash": "",
|
||||
user: "",
|
||||
date: "",
|
||||
response: errorMessage ? `Error: ${errorMessage}` : "Unknown error",
|
||||
response: stderr,
|
||||
isError: true,
|
||||
};
|
||||
}
|
||||
|
@ -12,9 +12,7 @@
|
||||
"rootDir": "src",
|
||||
"strict": true,
|
||||
"jsx": "react",
|
||||
"esModuleInterop": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"esModuleInterop": true
|
||||
},
|
||||
"exclude": ["test"]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user