Skip to content

Commit

Permalink
chore: make linting consistent across projects
Browse files Browse the repository at this point in the history
in some cases we weren't running prettier, and in some cases we weren't linting - try to make things more consistent across packages
  • Loading branch information
travis committed Oct 25, 2023
1 parent 06e0ca9 commit d949993
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 22 deletions.
2 changes: 1 addition & 1 deletion packages/capabilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"types": "dist/src/index.d.ts",
"main": "src/index.js",
"scripts": {
"lint": "tsc && eslint '**/*.{js,ts}' && prettier --check '**/*.{js,ts,yml,json}' --ignore-path ../../.gitignore",
"lint": "tsc --build && eslint '**/*.{js,ts}' && prettier --check '**/*.{js,ts,yml,json}' --ignore-path ../../.gitignore",
"build": "tsc --build",
"check": "tsc --build",
"test": "pnpm run test:node && pnpm run test:browser",
Expand Down
2 changes: 1 addition & 1 deletion packages/did-mailto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"scripts": {
"build": "tsc --build",
"check": "tsc --build",
"lint": "tsc --build",
"lint": "tsc --build && prettier --check '**/*.{js,ts,yml,json}' --ignore-path ../../.gitignore",
"test": "mocha --bail --timeout 10s -n no-warnings -n experimental-vm-modules -n experimental-fetch test/**/*.spec.js",
"test-watch": "pnpm build && mocha --bail --timeout 10s --watch --parallel -n no-warnings -n experimental-vm-modules -n experimental-fetch --watch-files src,test"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/filecoin-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"scripts": {
"build": "tsc --build",
"check": "tsc --build",
"lint": "tsc --build",
"lint": "tsc --build && eslint '**/*.{js,ts}' && prettier --check '**/*.{js,ts,yml,json}' --ignore-path ../../.gitignore",
"test": "mocha --bail --timeout 10s -n no-warnings -n experimental-vm-modules -n experimental-fetch test/**/*.spec.js",
"test-watch": "pnpm build && mocha --bail --timeout 10s --watch --parallel -n no-warnings -n experimental-vm-modules -n experimental-fetch --watch-files src,test"
},
Expand Down
6 changes: 5 additions & 1 deletion packages/filecoin-api/src/aggregator/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ export type BufferQueue = Queue<BufferMessage>
export type BufferStore = Store<Link, BufferRecord>
export type AggregateStore = Store<AggregateRecordKey, AggregateRecord>
export type PieceAcceptQueue = Queue<PieceAcceptMessage>
export type InclusionStore = QueryableStore<InclusionRecordKey, InclusionRecord, InclusionRecordQueryByGroup>
export type InclusionStore = QueryableStore<
InclusionRecordKey,
InclusionRecord,
InclusionRecordQueryByGroup
>
export type AggregateOfferQueue = Queue<AggregateOfferMessage>

export interface ServiceContext {
Expand Down
6 changes: 5 additions & 1 deletion packages/filecoin-api/src/deal-tracker/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import type { Signer } from '@ucanto/interface'
import { PieceLink } from '@web3-storage/data-segment'
import { QueryableStore } from '../types.js'

export type DealStore = QueryableStore<DealRecordKey, DealRecord, DealRecordQueryByPiece>
export type DealStore = QueryableStore<
DealRecordKey,
DealRecord,
DealRecordQueryByPiece
>

export interface ServiceContext {
/**
Expand Down
6 changes: 5 additions & 1 deletion packages/filecoin-api/src/storefront/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ import {
ServiceConfig,
} from '../types.js'

export type PieceStore = UpdatableAndQueryableStore<PieceRecordKey, PieceRecord, Pick<PieceRecord, 'status'>>
export type PieceStore = UpdatableAndQueryableStore<
PieceRecordKey,
PieceRecord,
Pick<PieceRecord, 'status'>
>
export type FilecoinSubmitQueue = Queue<FilecoinSubmitMessage>
export type PieceOfferQueue = Queue<PieceOfferMessage>
export type TaskStore = Store<UnknownLink, Invocation>
Expand Down
4 changes: 2 additions & 2 deletions packages/filecoin-api/test/aggregator.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('Aggregator', () => {
pieceAcceptQueue,
aggregateOfferQueue,
queuedMessages,
validateAuthorization
validateAuthorization,
}
)
})
Expand Down Expand Up @@ -147,7 +147,7 @@ describe('Aggregator', () => {
minAggregateSize: 2 ** 34,
minUtilizationFactor: 4,
},
validateAuthorization
validateAuthorization,
}
)
})
Expand Down
2 changes: 1 addition & 1 deletion packages/filecoin-api/test/context/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export function getConnection(id, service) {
id: id,
service,
codec: CAR.inbound,
validateAuthorization
validateAuthorization,
})
const connection = Client.connect({
id: id,
Expand Down
2 changes: 1 addition & 1 deletion packages/filecoin-api/test/deal-tracker.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('deal-tracker', () => {
assert.fail(error)
},
},
validateAuthorization
validateAuthorization,
}
)
})
Expand Down
4 changes: 2 additions & 2 deletions packages/filecoin-api/test/dealer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('Dealer', () => {
aggregateStore,
offerStore,
queuedMessages,
validateAuthorization
validateAuthorization,
}
)
})
Expand Down Expand Up @@ -109,7 +109,7 @@ describe('Dealer', () => {
},
},
service,
validateAuthorization
validateAuthorization,
}
)
})
Expand Down
8 changes: 4 additions & 4 deletions packages/filecoin-api/test/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ export const test = {
...StorefrontService.test,
},
aggregator: {
...AggregatorService.test
...AggregatorService.test,
},
dealer: {
...DealerService.test,
},
dealTracker: {
...DealTrackerService.test
}
...DealTrackerService.test,
},
},
events: {
storefront: {
...StorefrontEvents.test,
},
aggregator: {
...AggregatorEvents.test
...AggregatorEvents.test,
},
dealer: {
...DealerEvents.test,
Expand Down
4 changes: 2 additions & 2 deletions packages/filecoin-api/test/storefront.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('storefront', () => {
taskStore,
receiptStore,
queuedMessages,
validateAuthorization
validateAuthorization,
}
)
})
Expand Down Expand Up @@ -135,7 +135,7 @@ describe('storefront', () => {
assert.fail(error)
},
},
validateAuthorization
validateAuthorization,
}
)
})
Expand Down
2 changes: 1 addition & 1 deletion packages/filecoin-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"types": "dist/src/index.d.ts",
"main": "src/index.js",
"scripts": {
"lint": "eslint '**/*.{js,ts}' && prettier --check '**/*.{js,ts,yml,json}' --ignore-path ../../.gitignore",
"lint": "tsc --build && eslint '**/*.{js,ts}' && prettier --check '**/*.{js,ts,yml,json}' --ignore-path ../../.gitignore",
"build": "tsc --build",
"test": "npm run test:all",
"test:all": "run-s test:browser test:node",
Expand Down
2 changes: 1 addition & 1 deletion packages/upload-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"scripts": {
"build": "tsc --build",
"check": "tsc --build",
"lint": "tsc --build",
"lint": "tsc --build && eslint '**/*.{js,ts}' && prettier --check '**/*.{js,ts,yml,json}' --ignore-path ../../.gitignore",
"test": "mocha --bail --timeout 10s -n no-warnings -n experimental-vm-modules -n experimental-fetch 'test/**/*.spec.js'",
"test-watch": "pnpm build && mocha --bail --timeout 10s --watch --parallel -n no-warnings -n experimental-vm-modules -n experimental-fetch --watch-files src,test"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/upload-api/test/storage/provisions-storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import * as Types from '../../src/types.js'
* @param {Types.Provision} item
* @returns {string}
*/
const itemKey = ({customer, consumer, provider}) => `${customer}:${consumer}@${provider}`
const itemKey = ({ customer, consumer, provider }) =>
`${customer}:${consumer}@${provider}`

/**
* @implements {Types.ProvisionsStorage}
Expand Down
2 changes: 1 addition & 1 deletion packages/upload-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"types": "dist/src/index.d.ts",
"main": "src/index.js",
"scripts": {
"lint": "eslint '**/*.{js,ts}' && prettier --check '**/*.{js,ts,yml,json}' --ignore-path ../../.gitignore",
"lint": "tsc --build && eslint '**/*.{js,ts}' && prettier --check '**/*.{js,ts,yml,json}' --ignore-path ../../.gitignore",
"build": "tsc --build",
"check": "tsc --build",
"test": "npm-run-all -p -r mock test:all",
Expand Down

0 comments on commit d949993

Please sign in to comment.