mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: Migrate TaskQueue to TypeScript (#5658)
This is a simple module but took a bit of work because: * It wraps a Promise that can return basically anything. In a pure TS codebase we'd solve these with generics, so you could do `new TaskQueue<T>` where `T` will be what's returned from the queue, but because we're calling that from JS we can't yet. I've left a TODO and once we migrate the call sites to TS we can do a much better job than the `void | any` type I've gone with for now. * It was used in typedefs via `Puppeteer.TaskQueue`. I've removed that entry from `externs.d.ts` in favour of importing it and using the type directly. This does mean that we have imports that ESLint doesn't realiase are actually used but I think this is better than maintaining `externs.d.ts`.
This commit is contained in:
@@ -111,7 +111,8 @@ module.exports = {
|
||||
"no-unused-vars": 0,
|
||||
"@typescript-eslint/no-unused-vars": 2,
|
||||
"semi": 0,
|
||||
"@typescript-eslint/semi": 2
|
||||
"@typescript-eslint/semi": 2,
|
||||
"@typescript-eslint/no-empty-function": 0
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user