Skip to content

Commit

Permalink
chore: appease linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Shaw committed May 1, 2024
1 parent 9e4774e commit 782c6d0
Show file tree
Hide file tree
Showing 12 changed files with 2,443 additions and 2,524 deletions.
2 changes: 1 addition & 1 deletion packages/eslint-config-w3up/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"eslint-plugin-jsdoc": "^46.8.2"
},
"peerDependencies": {
"eslint": ">= 8"
"eslint": "^8.56.0"
},
"eslintConfig": {
"extends": "./index.js",
Expand Down
3 changes: 3 additions & 0 deletions packages/filecoin-api/test/context/queue-implementations.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import * as API from '../../src/types.js'
import { Queue } from './queue.js'

/**
* @template T
* @param {Map<string, unknown[]>} queuedMessages
* @param {{ new (config: { onMessage: (msg: T) => void }): API.Queue<T> }} [QueueImplementation]
*/
export const getQueueImplementations = (
queuedMessages,
Expand Down
6 changes: 1 addition & 5 deletions packages/filecoin-api/test/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ export async function randomBlob(size) {
const bytes = await randomBytes(size)
const hash = await sha256.digest(bytes)
const cid = CID.create(1, raw.code, hash)

return {
cid,
bytes,
}
return { cid, bytes }
}

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/upload-api/src/blob/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export const BlobSizeOutsideOfSupportedRangeName =
'BlobSizeOutsideOfSupportedRange'
export class BlobSizeOutsideOfSupportedRange extends Failure {
/**
* @param {Number} blobSize
* @param {Number} maxUploadSize
* @param {number} blobSize
* @param {number} maxUploadSize
*/
constructor(blobSize, maxUploadSize) {
super()
Expand Down
3 changes: 2 additions & 1 deletion packages/upload-api/src/index/lib/sharded-dag-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const view = ({ root, blocks }) => {
dagCBOR.decode(rootBytes)
)
switch (version) {
case 'index/sharded/dag@0.1':
case 'index/sharded/dag@0.1': {
const dagIndex = {
content: dagIndexData.content,
shards: new DigestMap(),
Expand All @@ -82,6 +82,7 @@ export const view = ({ root, blocks }) => {
dagIndex.shards.set(Digest.decode(blobIndexData[0]), blobIndex)
}
return ok(dagIndex)
}
default:
return error(
/** @type {import('@web3-storage/capabilities/types').UnknownFormat} */
Expand Down
2 changes: 1 addition & 1 deletion packages/upload-api/test/handlers/ucan.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ export const test = {

/**
* @type {import('@web3-storage/capabilities/types').BlobAddress}
**/
*/
// @ts-expect-error receipt out is unknown
const address = next.allocate.receipt.out.ok?.address
assert.ok(address)
Expand Down
2 changes: 1 addition & 1 deletion packages/upload-api/test/helpers/blob.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function parseBlobAddReceiptNext(receipt) {
// Get invocations next
/**
* @type {import('@ucanto/interface').Invocation[]}
**/
*/
// @ts-expect-error read only effect
const forkInvocations = receipt.fx.fork
const allocateTask = forkInvocations.find(
Expand Down
2 changes: 1 addition & 1 deletion packages/upload-api/test/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export { Context }
* Return whether the provided stack trace string appears to be generated
* by a deployed upload-api.
* Heuristics:
* * stack trace files paths will start with `file:///var/task/upload-api` because of how the lambda environment is working
* - stack trace files paths will start with `file:///var/task/upload-api` because of how the lambda environment is working
*
* @param {string} stack
*/
Expand Down
2 changes: 2 additions & 0 deletions packages/upload-api/test/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export async function randomCAR(size) {
const hash = await sha256.digest(bytes)
const root = CID.create(1, raw.code, hash)

// @ts-expect-error old multiformats in @ipld/car
const { writer, out } = CarWriter.create(root)
writer.put({ cid: root, bytes })
writer.close()
Expand All @@ -113,6 +114,7 @@ export async function randomCAR(size) {
return Object.assign(blob, { cid, roots: [root] })
}

// eslint-disable-next-line
export async function randomCID() {
const bytes = await randomBytes(10)
const hash = await sha256.digest(bytes)
Expand Down
1 change: 1 addition & 0 deletions packages/upload-client/test/helpers/car.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { toBlock } from './block.js'
*/
export async function toCAR(bytes) {
const block = await toBlock(bytes)
// @ts-expect-error old multiformats in @ipld/car
const { writer, out } = CarWriter.create(block.cid)
writer.put(block)
writer.close()
Expand Down
1 change: 1 addition & 0 deletions packages/w3up-client/test/helpers/car.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export async function toCAR(bytes) {
const hash = await sha256.digest(bytes)
const root = CID.create(1, raw.code, hash)

// @ts-expect-error old multiformats in @ipld/car
const { writer, out } = CarWriter.create(root)
writer.put({ cid: root, bytes })
writer.close()
Expand Down
Loading

0 comments on commit 782c6d0

Please sign in to comment.