Skip to content

Commit b669091

Browse files
committed
chore: lint for esm
1 parent 985bbf3 commit b669091

File tree

9 files changed

+19
-19
lines changed

9 files changed

+19
-19
lines changed

packages/ipfs-unixfs-exporter/package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"prepare": "aegir build",
1313
"test": "aegir test",
1414
"build": "aegir build",
15-
"postbuild": "cd dist && npx json -I -f package.json -e 'this.types=\"src/index.d.ts\"'",
1615
"clean": "rimraf ./dist",
1716
"lint": "aegir ts -p check && aegir lint",
1817
"coverage": "nyc -s npm run test -t node && nyc report --reporter=html",
@@ -38,7 +37,7 @@
3837
"@types/mocha": "^8.2.1",
3938
"@types/sinon": "^10.0.0",
4039
"abort-controller": "^3.0.0",
41-
"aegir": "https://gitpkg.now.sh/ipfs/aegir?feat/build-esm-modules",
40+
"aegir": "https://gitpkg.now.sh/ipfs/aegir?feat/build-esm-modules-follow-up",
4241
"copy": "^0.3.2",
4342
"crypto-browserify": "^3.12.0",
4443
"detect-node": "^2.0.4",
@@ -47,7 +46,6 @@
4746
"it-all": "^1.0.5",
4847
"it-buffer-stream": "^2.0.0",
4948
"it-first": "^1.0.6",
50-
"json": "^11.0.0",
5149
"merge-options": "^3.0.4",
5250
"murmurhash3js-revisited": "^3.0.0",
5351
"native-abort-controller": "^1.0.3",
@@ -72,6 +70,9 @@
7270
},
7371
"types": "dist/src/index.d.ts",
7472
"eslintConfig": {
75-
"extends": "ipfs"
73+
"extends": "ipfs",
74+
"parserOptions": {
75+
"sourceType": "module"
76+
}
7677
}
7778
}

packages/ipfs-unixfs-exporter/src/utils/find-cid-in-shard.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
'use strict'
21

32
import { Bucket, createHAMT } from 'hamt-sharding'
43
import { decode } from '@ipld/dag-pb'

packages/ipfs-unixfs-exporter/test/exporter-subtree.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import randomBytes from 'it-buffer-stream'
99
import uint8ArrayConcat from 'uint8arrays/concat.js'
1010
import asAsyncIterable from './helpers/as-async-iterable.js'
1111

12-
const ONE_MEG = Math.pow(1024, 2)
13-
1412
import { exporter, walkPath } from './../src/index.js'
1513

14+
const ONE_MEG = Math.pow(1024, 2)
15+
1616
describe('exporter subtree', () => {
1717
const block = blockApi()
1818

packages/ipfs-unixfs-exporter/test/exporter.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-env mocha */
2-
'use strict'
2+
33
// @ts-ignore needs types properly fixed
44
import { expect } from 'aegir/utils/chai.js'
55
import { UnixFS } from 'ipfs-unixfs'

packages/ipfs-unixfs-exporter/test/importer.spec.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import extend from 'merge-options'
66
// @ts-ignore needs types properly fixed
77
import { expect } from 'aegir/utils/chai.js'
88
import sinon from 'sinon'
9-
import { UnixFS } from 'ipfs-unixfs'
9+
import { UnixFS, parseMtime } from 'ipfs-unixfs'
1010
import collectLeafCids from './helpers/collect-leaf-cids.js'
1111
// @ts-ignore
1212
import loadFixture from 'aegir/utils/fixtures.js'
@@ -20,7 +20,6 @@ import last from 'it-last'
2020
import { CID } from 'multiformats/cid'
2121
import { base58btc } from 'multiformats/bases/base58'
2222
import { decode } from '@ipld/dag-pb'
23-
import { parseMtime } from 'ipfs-unixfs'
2423

2524
/** @type {Uint8Array} */
2625
const bigFile = loadFixture(('test') + '/fixtures/1.2MiB.txt')

packages/ipfs-unixfs-importer/package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"prepare": "aegir build --no-bundle",
1313
"test": "aegir test",
1414
"build": "aegir build",
15-
"postbuild": "cd dist && npx json -I -f package.json -e 'this.types=\"src/index.d.ts\"'",
1615
"clean": "rimraf ./dist",
1716
"lint": "aegir ts -p check && aegir lint",
1817
"coverage": "nyc -s npm run test -t node && nyc report --reporter=html",
@@ -36,13 +35,12 @@
3635
"homepage": "https://github.com/ipfs/js-ipfs-unixfs#readme",
3736
"devDependencies": {
3837
"@types/mocha": "^8.2.1",
39-
"aegir": "https://gitpkg.now.sh/ipfs/aegir?feat/build-esm-modules",
38+
"aegir": "https://gitpkg.now.sh/ipfs/aegir?feat/build-esm-modules-follow-up",
4039
"assert": "^2.0.0",
4140
"copy": "^0.3.2",
4241
"crypto-browserify": "^3.12.0",
4342
"events": "^3.3.0",
4443
"it-buffer-stream": "^2.0.0",
45-
"json": "^11.0.0",
4644
"nyc": "^15.0.0",
4745
"readable-stream": "^3.6.0",
4846
"rimraf": "^3.0.2",
@@ -67,6 +65,9 @@
6765
},
6866
"types": "dist/src/index.d.ts",
6967
"eslintConfig": {
70-
"extends": "ipfs"
68+
"extends": "ipfs",
69+
"parserOptions": {
70+
"sourceType": "module"
71+
}
7172
}
7273
}

packages/ipfs-unixfs-importer/src/flat-to-shard.js

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ async function flatToShard (child, dir, threshold, options) {
1717
let newDir = dir
1818

1919
if (dir instanceof DirFlat && dir.directChildrenCount() >= threshold) {
20-
2120
// @ts-ignore Dir type conflict!?
2221
newDir = await convertToShard(dir, options)
2322
}

packages/ipfs-unixfs-importer/test/chunker-fixed-size.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import chunker from '../src/chunker/fixed-size.js'
33
// @ts-ignore needs types properly fixed
44
import { expect } from 'aegir/utils/chai.js'
55
import all from 'it-all'
6-
const rawFile = new Uint8Array(Math.pow(2, 20))
76
import uint8ArrayFromString from 'uint8arrays/from-string.js'
87
import uint8ArrayConcat from 'uint8arrays/concat.js'
98
import defaultOptions from '../src/options.js'
109
import asAsyncIterable from './helpers/as-async-iterable.js'
10+
const rawFile = new Uint8Array(Math.pow(2, 20))
1111

1212
describe('chunker: fixed size', function () {
1313
this.timeout(30000)

packages/ipfs-unixfs/package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"prepare:types": "aegir build --no-bundle",
1616
"test": "aegir test",
1717
"build": "aegir build",
18-
"postbuild": "cd dist && npx json -I -f package.json -e 'this.types=\"src/index.d.ts\"'",
1918
"clean": "rimraf ./dist",
2019
"lint": "aegir ts -p check && aegir lint",
2120
"coverage": "nyc -s aegir test -t node && nyc report --reporter=html",
@@ -39,9 +38,8 @@
3938
"homepage": "https://github.com/ipfs/js-ipfs-unixfs#readme",
4039
"devDependencies": {
4140
"@types/mocha": "^8.2.1",
42-
"aegir": "https://gitpkg.now.sh/ipfs/aegir?feat/build-esm-modules",
41+
"aegir": "https://gitpkg.now.sh/ipfs/aegir?feat/build-esm-modules-follow-up",
4342
"copy": "^0.3.2",
44-
"json": "^11.0.0",
4543
"mkdirp": "^1.0.4",
4644
"npm-run-all": "^4.1.5",
4745
"nyc": "^15.0.0",
@@ -55,6 +53,9 @@
5553
"types": "dist/src/index.d.ts",
5654
"eslintConfig": {
5755
"extends": "ipfs",
56+
"parserOptions": {
57+
"sourceType": "module"
58+
},
5859
"ignorePatterns": [
5960
"src/unixfs.d.ts"
6061
]

0 commit comments

Comments
 (0)