-
-
Notifications
You must be signed in to change notification settings - Fork 722
Labels
A-linterArea - LinterArea - Linter
Description
What version of Oxlint are you using?
1.12.0
What command did you run?
oxlint
What does your .oxlintrc.json config file look like?
What happened?
promise/catch-or-return is not liking the following snippet:
async function fetchBlobs() {
const urlsToFetch = ['...']
const blobPromises = urlsToFetch.map(async (url) =>
fetch(url).then(async (res) => res.blob())
)
return Promise.all(blobPromises)
}The result of res.blob() is returned to the map, which is then passed to Promise.all. So the value is being returned up the chain.
It is happy with the following, which is functionally identical:
async function fetchBlobs() {
const urlsToFetch = ['...']
const blobPromises = urlsToFetch.map(async (url) => {
const response = await fetch(url)
return response.blob()
})
return Promise.all(blobPromises)
}Metadata
Metadata
Assignees
Labels
A-linterArea - LinterArea - Linter
{ "$schema": "./node_modules/oxlint/configuration_schema.json", "ignorePatterns": ["/node_modules", "/*.{js,ts}"], "plugins": ["eslint", "oxc", "typescript", "import", "promise", "unicorn"], "categories": { "correctness": "error", "nursery": "error", "pedantic": "error", "perf": "error", "restriction": "error", "style": "error", "suspicious": "error" } }