Skip to content

Commit

Permalink
chore: lint for esm
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Jul 23, 2021
1 parent 985bbf3 commit f438708
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 24 deletions.
5 changes: 0 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ jobs:
script:
- npm run depcheck -- $RUN_SINCE -- -- -p

- stage: check
name: dep-check (unused deps)
script:
- npm run depcheck -- $RUN_SINCE -- -- -- --unused

- stage: test
name: chrome
addons:
Expand Down
9 changes: 5 additions & 4 deletions packages/ipfs-unixfs-exporter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"prepare": "aegir build",
"test": "aegir test",
"build": "aegir build",
"postbuild": "cd dist && npx json -I -f package.json -e 'this.types=\"src/index.d.ts\"'",
"clean": "rimraf ./dist",
"lint": "aegir ts -p check && aegir lint",
"coverage": "nyc -s npm run test -t node && nyc report --reporter=html",
Expand All @@ -38,7 +37,7 @@
"@types/mocha": "^8.2.1",
"@types/sinon": "^10.0.0",
"abort-controller": "^3.0.0",
"aegir": "https://gitpkg.now.sh/ipfs/aegir?feat/build-esm-modules",
"aegir": "https://gitpkg.now.sh/ipfs/aegir?feat/build-esm-modules-follow-up",
"copy": "^0.3.2",
"crypto-browserify": "^3.12.0",
"detect-node": "^2.0.4",
Expand All @@ -47,7 +46,6 @@
"it-all": "^1.0.5",
"it-buffer-stream": "^2.0.0",
"it-first": "^1.0.6",
"json": "^11.0.0",
"merge-options": "^3.0.4",
"murmurhash3js-revisited": "^3.0.0",
"native-abort-controller": "^1.0.3",
Expand All @@ -72,6 +70,9 @@
},
"types": "dist/src/index.d.ts",
"eslintConfig": {
"extends": "ipfs"
"extends": "ipfs",
"parserOptions": {
"sourceType": "module"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use strict'

import { Bucket, createHAMT } from 'hamt-sharding'
import { decode } from '@ipld/dag-pb'
Expand Down
4 changes: 2 additions & 2 deletions packages/ipfs-unixfs-exporter/test/exporter-subtree.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import randomBytes from 'it-buffer-stream'
import uint8ArrayConcat from 'uint8arrays/concat.js'
import asAsyncIterable from './helpers/as-async-iterable.js'

const ONE_MEG = Math.pow(1024, 2)

import { exporter, walkPath } from './../src/index.js'

const ONE_MEG = Math.pow(1024, 2)

describe('exporter subtree', () => {
const block = blockApi()

Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-unixfs-exporter/test/exporter.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-env mocha */
'use strict'

// @ts-ignore needs types properly fixed
import { expect } from 'aegir/utils/chai.js'
import { UnixFS } from 'ipfs-unixfs'
Expand Down
3 changes: 1 addition & 2 deletions packages/ipfs-unixfs-exporter/test/importer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import extend from 'merge-options'
// @ts-ignore needs types properly fixed
import { expect } from 'aegir/utils/chai.js'
import sinon from 'sinon'
import { UnixFS } from 'ipfs-unixfs'
import { UnixFS, parseMtime } from 'ipfs-unixfs'
import collectLeafCids from './helpers/collect-leaf-cids.js'
// @ts-ignore
import loadFixture from 'aegir/utils/fixtures.js'
Expand All @@ -20,7 +20,6 @@ import last from 'it-last'
import { CID } from 'multiformats/cid'
import { base58btc } from 'multiformats/bases/base58'
import { decode } from '@ipld/dag-pb'
import { parseMtime } from 'ipfs-unixfs'

/** @type {Uint8Array} */
const bigFile = loadFixture(('test') + '/fixtures/1.2MiB.txt')
Expand Down
9 changes: 5 additions & 4 deletions packages/ipfs-unixfs-importer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"prepare": "aegir build --no-bundle",
"test": "aegir test",
"build": "aegir build",
"postbuild": "cd dist && npx json -I -f package.json -e 'this.types=\"src/index.d.ts\"'",
"clean": "rimraf ./dist",
"lint": "aegir ts -p check && aegir lint",
"coverage": "nyc -s npm run test -t node && nyc report --reporter=html",
Expand All @@ -36,13 +35,12 @@
"homepage": "https://github.com/ipfs/js-ipfs-unixfs#readme",
"devDependencies": {
"@types/mocha": "^8.2.1",
"aegir": "https://gitpkg.now.sh/ipfs/aegir?feat/build-esm-modules",
"aegir": "https://gitpkg.now.sh/ipfs/aegir?feat/build-esm-modules-follow-up",
"assert": "^2.0.0",
"copy": "^0.3.2",
"crypto-browserify": "^3.12.0",
"events": "^3.3.0",
"it-buffer-stream": "^2.0.0",
"json": "^11.0.0",
"nyc": "^15.0.0",
"readable-stream": "^3.6.0",
"rimraf": "^3.0.2",
Expand All @@ -67,6 +65,9 @@
},
"types": "dist/src/index.d.ts",
"eslintConfig": {
"extends": "ipfs"
"extends": "ipfs",
"parserOptions": {
"sourceType": "module"
}
}
}
1 change: 0 additions & 1 deletion packages/ipfs-unixfs-importer/src/flat-to-shard.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ async function flatToShard (child, dir, threshold, options) {
let newDir = dir

if (dir instanceof DirFlat && dir.directChildrenCount() >= threshold) {

// @ts-ignore Dir type conflict!?
newDir = await convertToShard(dir, options)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import chunker from '../src/chunker/fixed-size.js'
// @ts-ignore needs types properly fixed
import { expect } from 'aegir/utils/chai.js'
import all from 'it-all'
const rawFile = new Uint8Array(Math.pow(2, 20))
import uint8ArrayFromString from 'uint8arrays/from-string.js'
import uint8ArrayConcat from 'uint8arrays/concat.js'
import defaultOptions from '../src/options.js'
import asAsyncIterable from './helpers/as-async-iterable.js'
const rawFile = new Uint8Array(Math.pow(2, 20))

describe('chunker: fixed size', function () {
this.timeout(30000)
Expand Down
7 changes: 4 additions & 3 deletions packages/ipfs-unixfs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"prepare:types": "aegir build --no-bundle",
"test": "aegir test",
"build": "aegir build",
"postbuild": "cd dist && npx json -I -f package.json -e 'this.types=\"src/index.d.ts\"'",
"clean": "rimraf ./dist",
"lint": "aegir ts -p check && aegir lint",
"coverage": "nyc -s aegir test -t node && nyc report --reporter=html",
Expand All @@ -39,9 +38,8 @@
"homepage": "https://github.com/ipfs/js-ipfs-unixfs#readme",
"devDependencies": {
"@types/mocha": "^8.2.1",
"aegir": "https://gitpkg.now.sh/ipfs/aegir?feat/build-esm-modules",
"aegir": "https://gitpkg.now.sh/ipfs/aegir?feat/build-esm-modules-follow-up",
"copy": "^0.3.2",
"json": "^11.0.0",
"mkdirp": "^1.0.4",
"npm-run-all": "^4.1.5",
"nyc": "^15.0.0",
Expand All @@ -55,6 +53,9 @@
"types": "dist/src/index.d.ts",
"eslintConfig": {
"extends": "ipfs",
"parserOptions": {
"sourceType": "module"
},
"ignorePatterns": [
"src/unixfs.d.ts"
]
Expand Down

0 comments on commit f438708

Please sign in to comment.