Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

chore: use eslint-config-ipfs #3287

Merged
merged 7 commits into from
Oct 6, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/interface-ipfs-core/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "ipfs"
}
4 changes: 2 additions & 2 deletions packages/interface-ipfs-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"uint8arrays": "^1.1.0"
},
"devDependencies": {
"aegir": "^26.0.0",
"aegir": "git://github.com/ipfs/aegir#eslint-config",
"ipfsd-ctl": "^7.0.0"
},
"contributors": [
Expand Down Expand Up @@ -135,4 +135,4 @@
"Łukasz Magiera <[email protected]>",
"Максим Ильин <[email protected]>"
]
}
}
3 changes: 3 additions & 0 deletions packages/ipfs-core-utils/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "ipfs"
}
4 changes: 2 additions & 2 deletions packages/ipfs-core-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"uint8arrays": "^1.1.0"
},
"devDependencies": {
"aegir": "^26.0.0",
"aegir": "git://github.com/ipfs/aegir#eslint-config",
"delay": "^4.3.0"
}
}
}
3 changes: 3 additions & 0 deletions packages/ipfs-http-client/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "ipfs"
}
4 changes: 2 additions & 2 deletions packages/ipfs-http-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"uint8arrays": "^1.1.0"
},
"devDependencies": {
"aegir": "^26.0.0",
"aegir": "git://github.com/ipfs/aegir#eslint-config",
"cross-env": "^7.0.0",
"go-ipfs": "^0.6.0",
"interface-ipfs-core": "^0.140.0",
Expand Down Expand Up @@ -188,4 +188,4 @@
"Łukasz Magiera <[email protected]>",
"Xmader <[email protected]>"
]
}
}
2 changes: 1 addition & 1 deletion packages/ipfs-http-client/src/add-all.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const anySignal = require('any-signal')
const AbortController = require('abort-controller').default

module.exports = configure((api) => {
// eslint-disable-next-line valid-jsdoc
/**
* @type {import('../../ipfs/src/core/components/add-all').AddAll<import('.').HttpOptions>}
*/
Expand Down Expand Up @@ -51,6 +50,7 @@ module.exports = configure((api) => {
*/

/**
* @param {*} input
* @returns {UnixFSEntry}
*/
function toCoreInterface ({ name, hash, size, mode, mtime, mtimeNsecs }) {
Expand Down
2 changes: 0 additions & 2 deletions packages/ipfs-http-client/src/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ const configure = require('./lib/configure')
* @typedef {import("./lib/core").ClientOptions} ClientOptions
*/

// eslint-disable-next-line valid-jsdoc
/**
* @param {ClientOptions} options
*/
module.exports = (options) => {
const all = addAll(options)

return configure(() => {
// eslint-disable-next-line valid-jsdoc
/**
* @type {import('../../ipfs/src/core/components/add').Add<import('.').HttpOptions>}
*/
Expand Down
1 change: 0 additions & 1 deletion packages/ipfs-http-client/src/bitswap/stat.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const configure = require('../lib/configure')
const toUrlSearchParams = require('../lib/to-url-search-params')

module.exports = configure(api => {
// eslint-disable-next-line valid-jsdoc
/**
* @type {import('../../../ipfs/src/core/components/bitswap/stat').Stat<import('..').HttpOptions>}
*/
Expand Down
1 change: 0 additions & 1 deletion packages/ipfs-http-client/src/bitswap/unwant.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const configure = require('../lib/configure')
const toUrlSearchParams = require('../lib/to-url-search-params')

module.exports = configure(api => {
// eslint-disable-next-line valid-jsdoc
/**
* @type {import('../../../ipfs/src/core/components/bitswap/unwant').Unwant<import('..').HttpOptions>}
*/
Expand Down
1 change: 0 additions & 1 deletion packages/ipfs-http-client/src/bitswap/wantlist-for-peer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const configure = require('../lib/configure')
const toUrlSearchParams = require('../lib/to-url-search-params')

module.exports = configure(api => {
// eslint-disable-next-line valid-jsdoc
/**
* @type {import('../../../ipfs/src/core/components/bitswap/wantlist-for-peer').WantlistForPeer<import('..').HttpOptions>}
*/
Expand Down
1 change: 0 additions & 1 deletion packages/ipfs-http-client/src/bitswap/wantlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const configure = require('../lib/configure')
const toUrlSearchParams = require('../lib/to-url-search-params')

module.exports = configure(api => {
// eslint-disable-next-line valid-jsdoc
/**
* @type {import('../../../ipfs/src/core/components/bitswap/wantlist').WantlistFn<import('..').HttpOptions>}
*/
Expand Down
1 change: 0 additions & 1 deletion packages/ipfs-http-client/src/block/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const configure = require('../lib/configure')
const toUrlSearchParams = require('../lib/to-url-search-params')

module.exports = configure(api => {
// eslint-disable-next-line valid-jsdoc
/**
* @type {import('../../../ipfs/src/core/components/block/get').BlockGet<import('..').HttpOptions>}
*/
Expand Down
1 change: 0 additions & 1 deletion packages/ipfs-http-client/src/block/put.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const anySignal = require('any-signal')
const AbortController = require('abort-controller').default

module.exports = configure(api => {
// eslint-disable-next-line valid-jsdoc
/**
* @type {import('../../../ipfs/src/core/components/block/put').BlockPut<import('..').HttpOptions>}
*/
Expand Down
1 change: 0 additions & 1 deletion packages/ipfs-http-client/src/id.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const configure = require('./lib/configure')
const toUrlSearchParams = require('./lib/to-url-search-params')

module.exports = configure(api => {
// eslint-disable-next-line valid-jsdoc
/**
* @type {import('../../ipfs/src/core/components/id').Id<import('.').HttpOptions>}
*/
Expand Down
1 change: 0 additions & 1 deletion packages/ipfs-http-client/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const urlSource = require('ipfs-utils/src/files/url-source')
* @property {(format: string) => Promise<any>} [ipld.loadFormat] - an async function that takes the name of an [IPLD format](https://github.com/ipld/interface-ipld-format) as a string and should return the implementation of that codec
*/

// eslint-disable-next-line valid-jsdoc
/**
* @param {ClientOptions} options
*/
Expand Down
14 changes: 7 additions & 7 deletions packages/ipfs-http-client/src/lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ const parseTimeout = (value) => {

/**
* @typedef {Object} ClientOptions
* @prop {string} [host]
* @prop {number} [port]
* @prop {string} [protocol]
* @prop {Headers|Record<string, string>} [headers] - Request headers.
* @prop {number|string} [timeout] - Amount of time until request should timeout in ms or humand readable. https://www.npmjs.com/package/parse-duration for valid string values.
* @prop {string} [apiPath] - Path to the API.
* @prop {URL|string} [url] - Full API URL.
* @property {string} [host]
* @property {number} [port]
* @property {string} [protocol]
* @property {Headers|Record<string, string>} [headers] - Request headers.
* @property {number|string} [timeout] - Amount of time until request should timeout in ms or humand readable. https://www.npmjs.com/package/parse-duration for valid string values.
* @property {string} [apiPath] - Path to the API.
* @property {URL|string} [url] - Full API URL.
*/

class Client extends HTTP {
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-client/src/lib/to-url-search-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const modeToString = require('./mode-to-string')
const mtimeToObject = require('./mtime-to-object')

/**
* @param {object} params
* @param {*} params
* @returns {URLSearchParams}
*/
module.exports = ({ arg, searchParams, hashAlg, mtime, mode, ...options } = {}) => {
Expand Down
1 change: 0 additions & 1 deletion packages/ipfs-http-client/src/resolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const configure = require('./lib/configure')
const toUrlSearchParams = require('./lib/to-url-search-params')

module.exports = configure(api => {
// eslint-disable-next-line valid-jsdoc
/**
* @type {import('../../ipfs/src/core/components/resolve').Resolve<import('.').HttpOptions>}
*/
Expand Down
1 change: 0 additions & 1 deletion packages/ipfs-http-client/src/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const configure = require('./lib/configure')
const toUrlSearchParams = require('./lib/to-url-search-params')

module.exports = configure(api => {
// eslint-disable-next-line valid-jsdoc
/**
* @type {import('../../ipfs/src/core/components/version').Version<import('.').HttpOptions>}
*/
Expand Down
3 changes: 3 additions & 0 deletions packages/ipfs-message-port-client/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "ipfs"
}
4 changes: 2 additions & 2 deletions packages/ipfs-message-port-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"cids": "^1.0.0"
},
"devDependencies": {
"aegir": "^26.0.0",
"aegir": "git://github.com/ipfs/aegir#eslint-config",
"cross-env": "^7.0.0",
"interface-ipfs-core": "^0.140.0",
"ipfs": "^0.50.2",
Expand All @@ -53,4 +53,4 @@
"contributors": [
"Irakli Gozalishvili <[email protected]>"
]
}
}
4 changes: 4 additions & 0 deletions packages/ipfs-message-port-client/src/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class BlockClient extends Client {

/**
* Get a raw IPFS block.
*
* @param {CID} cid - A CID that corresponds to the desired block
* @param {Object} [options]
* @param {number} [options.timeout] - A timeout in ms
Expand All @@ -51,6 +52,7 @@ class BlockClient extends Client {

/**
* Stores input as an IPFS block.
*
* @param {Block|Uint8Array} block - A Block or Uint8Array of block data
* @param {Object} [options]
* @param {CID} [options.cid] - A CID to store the block under (if block is
Expand Down Expand Up @@ -85,6 +87,7 @@ class BlockClient extends Client {

/**
* Remove one or more IPFS block(s).
*
* @param {CID|CID[]} cids - Block(s) to be removed
* @param {Object} [options]
* @param {boolean} [options.force=false] - Ignores nonexistent blocks
Expand Down Expand Up @@ -114,6 +117,7 @@ class BlockClient extends Client {

/**
* Returns information about a raw IPFS block.
*
* @param {CID} cid - Block to get information about.
* @param {Object} [options]
* @param {number} [options.timeout] - A timeout in ms
Expand Down
7 changes: 7 additions & 0 deletions packages/ipfs-message-port-client/src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class Query {

/**
* Data that will be structure cloned over message channel.
*
* @returns {Object}
*/
toJSON () {
Expand All @@ -63,6 +64,7 @@ class Query {

/**
* Data that will be transferred over message channel.
*
* @returns {Transferable[]}
*/
transfer () {
Expand All @@ -80,11 +82,13 @@ class Query {
*
* It is expected that there will be at most one transport for a message port
* instance.
*
* @class
*/
class Transport {
/**
* Create transport for the underlying message port.
*
* @param {MessagePort} [port]
*/
constructor (port) {
Expand Down Expand Up @@ -209,6 +213,7 @@ class Transport {
/**
* Aborts this query by failing with `AbortError` and sending an abort message
* to the server. If query is no longer pending this has no effect.
*
* @param {string} id
*/
abort (id) {
Expand All @@ -230,6 +235,7 @@ class Transport {

/**
* Sends a given `query` with a given `id` over the message channel.
*
* @param {MessagePort} port
* @param {string} id
* @param {Query<any, any>} query
Expand All @@ -249,6 +255,7 @@ class Transport {

/**
* Handler is invoked when message on the message port is received.
*
* @param {MessageEvent} event
*/
handleEvent (event) {
Expand Down
8 changes: 7 additions & 1 deletion packages/ipfs-message-port-client/src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const {
encodeIterable,
encodeCallback
} = require('ipfs-message-port-protocol/src/core')
/** @type {<T> (stream:ReadableStream<T>) => AsyncIterable<T>} */
/** @type {<T>(stream:ReadableStream<T>) => AsyncIterable<T>} */
// @ts-ignore - browser-stream-to-it has not types
const iterateReadableStream = require('browser-readablestream-to-it')

Expand Down Expand Up @@ -160,6 +160,7 @@ class CoreClient extends Client {

/**
* Returns content addressed by a valid IPFS Path.
*
* @param {string|CID} inputPath
* @param {Object} [options]
* @param {number} [options.offset]
Expand All @@ -177,6 +178,7 @@ class CoreClient extends Client {

/**
* Decodes values yield by `ipfs.add`.
*
* @param {AddedEntry} data
* @returns {AddedData}
*/
Expand Down Expand Up @@ -291,6 +293,7 @@ const encodeAddAllInput = (input, transfer) => {
/**
* Function encodes individual item of some `AsyncIterable` by choosing most
* effective strategy.
*
* @param {ArrayBuffer|ArrayBufferView|Blob|string|FileObject} content
* @param {Transferable[]} transfer
* @returns {FileInput|ArrayBuffer|ArrayBufferView}
Expand Down Expand Up @@ -400,6 +403,7 @@ const encodeFileContent = (content, transfer) => {
/**
* Pattern matches given input as `Iterable<I>` and returns back either matched
* iterable or `null`.
*
* @template I
* @param {Iterable<I>|AddInput|AddAllInput} input
* @returns {Iterable<I>|null}
Expand All @@ -417,6 +421,7 @@ const asIterable = (input) => {
/**
* Pattern matches given `input` as `AsyncIterable<I>` and returns back either
* matched `AsyncIterable` or `null`.
*
* @template I
* @param {AsyncIterable<I>|AddInput|AddAllInput} input
* @returns {AsyncIterable<I>|null}
Expand Down Expand Up @@ -449,6 +454,7 @@ const asReadableStream = (input) => {
/**
* Pattern matches given input as "FileObject" and returns back eithr matched
* input or `null`.
*
* @param {*} input
* @returns {FileObject|null}
*/
Expand Down
1 change: 1 addition & 0 deletions packages/ipfs-message-port-client/src/dag.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class DAGClient extends Client {

/**
* Enumerate all the entries in a graph
*
* @param {CID} cid - CID of the DAG node to enumerate
* @param {Object} [options]
* @param {string} [options.path]
Expand Down
7 changes: 4 additions & 3 deletions packages/ipfs-message-port-client/src/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ class FilesClient extends Client {
*
* @param {string|CID} pathOrCID
* @param {Object} [options]
* @param {boolean} [options.hash=false] If true will only return hash
* @param {boolean} [options.size=false] If true will only return size
* @param {boolean} [options.withLocal=false] If true computes size of the dag that is local, and total size when possible
* @param {boolean} [options.hash=false] - If true will only return hash
* @param {boolean} [options.size=false] - If true will only return size
* @param {boolean} [options.withLocal=false] - If true computes size of the dag that is local, and total size when possible
* @param {number} [options.timeout]
* @param {AbortSignal} [options.signal]
* @returns {Promise<Stat>}
Expand All @@ -60,6 +60,7 @@ module.exports = FilesClient

/**
* Turns content address (path or CID) into path.
*
* @param {string|CID} pathOrCID
* @returns {string}
*/
Expand Down
Loading