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"
|
"@typescript-eslint"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"no-unused-vars": "warn",
|
|
||||||
"no-unused-expressions": "warn",
|
|
||||||
"@typescript-eslint/naming-convention": "warn",
|
"@typescript-eslint/naming-convention": "warn",
|
||||||
"@typescript-eslint/semi": "warn",
|
"@typescript-eslint/semi": "warn",
|
||||||
"curly": "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);
|
const { exitCode: code, stdout, stderr } = await this.commandRun.spawnAsync(devChat, args, spawnAsyncOptions, onStdoutPartial, undefined, undefined, undefined);
|
||||||
|
|
||||||
if (stderr) {
|
if (stderr) {
|
||||||
const errorMessage = stderr.trim().match(/Error:(.+)/)?.[1];
|
|
||||||
return {
|
return {
|
||||||
"prompt-hash": "",
|
"prompt-hash": "",
|
||||||
user: "",
|
user: "",
|
||||||
date: "",
|
date: "",
|
||||||
response: errorMessage ? `Error: ${errorMessage}` : "Unknown error",
|
response: stderr,
|
||||||
isError: true,
|
isError: true,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -12,9 +12,7 @@
|
|||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"jsx": "react",
|
"jsx": "react",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true
|
||||||
"noUnusedLocals": true,
|
|
||||||
"noUnusedParameters": true,
|
|
||||||
},
|
},
|
||||||
"exclude": ["test"]
|
"exclude": ["test"]
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user