Skip to content

Commit

Permalink
chore: apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Potsides <alex@achingbrain.net>
  • Loading branch information
vasco-santos and achingbrain committed Apr 14, 2021
1 parent 8e91334 commit 98325d9
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 36 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v2
- run: npm install
- run: npx aegir lint
- run: npx aegir ts -p check
- uses: gozala/typescript-error-reporter-action@v1.0.8
- run: npx aegir build
- run: npx aegir dep-check
- uses: ipfs/aegir/actions/bundle-size@master
Expand All @@ -35,7 +35,7 @@ jobs:
with:
node-version: ${{ matrix.node }}
- run: npm install
- run: npx nyc --reporter=lcov aegir test -t node -- --bail
- run: npx aegir test -t node --cov --bail
- uses: codecov/codecov-action@v1
test-chrome:
needs: check
Expand All @@ -50,7 +50,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: npm install
- run: npx aegir test -t browser -t webworker --bail -- --browsers FirefoxHeadless
- run: npx aegir test -t browser -t webworker --bail -- --browser firefox
test-ts:
needs: check
runs-on: ubuntu-latest
Expand Down
2 changes: 0 additions & 2 deletions src/address-manager/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use strict'

/** @typedef {import('../types').EventEmitterFactory} Events */
/** @type Events */
const EventEmitter = require('events')
const { Multiaddr } = require('multiaddr')
const PeerId = require('peer-id')
Expand Down
2 changes: 0 additions & 2 deletions src/connection-manager/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ const LatencyMonitor = require('./latency-monitor')
// @ts-ignore retimer does not have types
const retimer = require('retimer')

/** @typedef {import('../types').EventEmitterFactory} Events */
/** @type Events */
const EventEmitter = require('events')

const PeerId = require('peer-id')
Expand Down
2 changes: 0 additions & 2 deletions src/connection-manager/latency-monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* This code is based on `latency-monitor` (https://github.com/mlucool/latency-monitor) by `mlucool` (https://github.com/mlucool), available under Apache License 2.0 (https://github.com/mlucool/latency-monitor/blob/master/LICENSE)
*/

/** @typedef {import('../types').EventEmitterFactory} Events */
/** @type Events */
const EventEmitter = require('events')
const VisibilityChangeEmitter = require('./visibility-change-emitter')
const debug = require('debug')('latency-monitor:LatencyMonitor')
Expand Down
2 changes: 0 additions & 2 deletions src/connection-manager/visibility-change-emitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
*/
'use strict'

/** @typedef {import('../types').EventEmitterFactory} Events */
/** @type Events */
const EventEmitter = require('events')

const debug = require('debug')('latency-monitor:VisibilityChangeEmitter')
Expand Down
2 changes: 0 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ const debug = require('debug')
const log = Object.assign(debug('libp2p'), {
error: debug('libp2p:err')
})
/** @typedef {import('./types').EventEmitterFactory} Events */
/** @type Events */
const EventEmitter = require('events')

const errCode = require('err-code')
Expand Down
2 changes: 0 additions & 2 deletions src/metrics/stats.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// @ts-nocheck
'use strict'

/** @typedef {import('../types').EventEmitterFactory} Events */
/** @type Events */
const EventEmitter = require('events')
const Big = require('bignumber.js')
const MovingAverage = require('moving-average')
Expand Down
2 changes: 0 additions & 2 deletions src/peer-store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

const errcode = require('err-code')

/** @typedef {import('../types').EventEmitterFactory} Events */
/** @type Events */
const EventEmitter = require('events')
const PeerId = require('peer-id')

Expand Down
18 changes: 0 additions & 18 deletions src/types.d.ts

This file was deleted.

3 changes: 2 additions & 1 deletion test/core/ping.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ describe('ping', () => {
if (firstInvocation) {
firstInvocation = false

for await (const data of stream) { // eslint-disable-line
// eslint-disable-next-line no-unreachable-loop
for await (const data of stream) {
return {
value: data,
done: false
Expand Down

0 comments on commit 98325d9

Please sign in to comment.