feat: enable oxlint suspicious category, fix 24 violations (#22727)
publish-github-action / publish (push) Has been cancelled
publish-github-action / publish (push) Has been cancelled
This commit is contained in:
@@ -53,6 +53,7 @@ function getOrCreateClientState(name?: string): MockClientState {
|
||||
class MockStdioTransport {
|
||||
stderr: null = null
|
||||
pid = 12345
|
||||
// oxlint-disable-next-line no-useless-constructor
|
||||
constructor(_opts: any) {}
|
||||
async start() {
|
||||
if (connectShouldHang) return new Promise<void>(() => {}) // never resolves
|
||||
@@ -64,6 +65,7 @@ class MockStdioTransport {
|
||||
}
|
||||
|
||||
class MockStreamableHTTP {
|
||||
// oxlint-disable-next-line no-useless-constructor
|
||||
constructor(_url: URL, _opts?: any) {}
|
||||
async start() {
|
||||
if (connectShouldHang) return new Promise<void>(() => {}) // never resolves
|
||||
@@ -76,6 +78,7 @@ class MockStreamableHTTP {
|
||||
}
|
||||
|
||||
class MockSSE {
|
||||
// oxlint-disable-next-line no-useless-constructor
|
||||
constructor(_url: URL, _opts?: any) {}
|
||||
async start() {
|
||||
if (connectShouldHang) return new Promise<void>(() => {}) // never resolves
|
||||
|
||||
@@ -60,12 +60,11 @@ function chat(text: string) {
|
||||
function hanging(ready: () => void) {
|
||||
const encoder = new TextEncoder()
|
||||
let timer: ReturnType<typeof setTimeout> | undefined
|
||||
const first =
|
||||
`data: ${JSON.stringify({
|
||||
id: "chatcmpl-1",
|
||||
object: "chat.completion.chunk",
|
||||
choices: [{ delta: { role: "assistant" } }],
|
||||
})}` + "\n\n"
|
||||
const first = `data: ${JSON.stringify({
|
||||
id: "chatcmpl-1",
|
||||
object: "chat.completion.chunk",
|
||||
choices: [{ delta: { role: "assistant" } }],
|
||||
})}\n\n`
|
||||
const rest =
|
||||
[
|
||||
`data: ${JSON.stringify({
|
||||
|
||||
Reference in New Issue
Block a user