web/src/utils/atlas/uploadToIpfs.ts
Function uploadToIpfs
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function uploadToIpfs(config: Config, payload: IpfsUploadPayload): Promise<string | null> {
const formData = new FormData();
formData.append("file", payload.file, payload.name);
formData.append("name", payload.name);
formData.append("product", payload.product);
- Create a ticketCreate a ticket
Unnecessary 'await'. Open
Open
return await response.text();
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: no-return-await
Disallows unnecessary return await
.
Rationale
An async function always wraps the return value in a Promise.
Using return await
just adds extra time before the overreaching promise is resolved without changing the semantics.
Notes
- Has Fix
Config
Not configurable.
Examples
"no-return-await": true
For more information see this page.