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

Commit daf40cb

Browse files
committed
chore: fix linting
1 parent 3de94a5 commit daf40cb

File tree

28 files changed

+117
-91
lines changed

28 files changed

+117
-91
lines changed

src/cli/commands/daemon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ module.exports = {
8080
print('Daemon is ready')
8181

8282
const cleanup = async () => {
83-
print(`Received interrupt signal, shutting down...`)
83+
print('Received interrupt signal, shutting down...')
8484
await daemon.stop()
8585
process.exit(0)
8686
}

src/cli/commands/file/ls.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module.exports = {
1111
argv.resolve((async () => {
1212
const path = argv.key
1313
// `ipfs file ls` is deprecated. See https://ipfs.io/docs/commands/#ipfs-file-ls
14-
argv.print(`This functionality is deprecated, and will be removed in future versions. If possible, please use 'ipfs ls' instead.`)
14+
argv.print('This functionality is deprecated, and will be removed in future versions. If possible, please use \'ipfs ls\' instead.')
1515

1616
const ipfs = await argv.getIpfs()
1717
let links = await ipfs.ls(path)

src/cli/commands/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ module.exports = {
5757
})
5858
} catch (err) {
5959
if (err.code === 'EACCES') {
60-
err.message = `EACCES: permission denied, stat $IPFS_PATH/version`
60+
err.message = 'EACCES: permission denied, stat $IPFS_PATH/version'
6161
}
6262
throw err
6363
}

src/cli/commands/version.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ module.exports = {
1717
commit: {
1818
type: 'boolean',
1919
default: false,
20-
describe: `Include the version's commit hash`
20+
describe: 'Include the version\'s commit hash'
2121
},
2222
repo: {
2323
type: 'boolean',
2424
default: false,
25-
describe: `Print only the repo's version number`
25+
describe: 'Print only the repo\'s version number'
2626
},
2727
all: {
2828
type: 'boolean',

src/core/components/pin/gc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function createMarkedSet (ipfs, callback) {
7777
(cb) => ipfs._repo.root.get(MFS_ROOT_KEY, (err, mh) => {
7878
if (err) {
7979
if (err.code === 'ERR_NOT_FOUND') {
80-
log(`No blocks in MFS`)
80+
log('No blocks in MFS')
8181
return cb(null, [])
8282
}
8383
return cb(expErr(err, 'Could not get MFS root from datastore'))

src/core/components/pin/pin-manager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ class PinManager {
274274
this.repo.datastore.get(PIN_DS_KEY, (err, mh) => {
275275
if (err) {
276276
if (err.code === 'ERR_NOT_FOUND') {
277-
this.log(`No pinned blocks`)
277+
this.log('No pinned blocks')
278278
return callback(null, [])
279279
}
280280
return callback(new Error(`Could not get pin sets root from datastore: ${err.message}`))

src/core/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const s = superstruct({
2121

2222
return true
2323
},
24-
'multiaddr-ipfs': v => mafmt.IPFS.matches(v) ? true : `multiaddr IPFS invalid`
24+
'multiaddr-ipfs': v => mafmt.IPFS.matches(v) ? true : 'multiaddr IPFS invalid'
2525
}
2626
})
2727

src/core/ipns/publisher.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class IpnsPublisher {
4848

4949
_putRecordToRouting (record, peerId, callback) {
5050
if (!(PeerId.isPeerId(peerId))) {
51-
const errMsg = `peerId received is not valid`
51+
const errMsg = 'peerId received is not valid'
5252

5353
log.error(errMsg)
5454
return callback(errcode(new Error(errMsg), 'ERR_INVALID_PEER_ID'))
@@ -87,7 +87,7 @@ class IpnsPublisher {
8787

8888
_publishEntry (key, entry, peerId, callback) {
8989
if (!(Key.isKey(key))) {
90-
const errMsg = `datastore key does not have a valid format`
90+
const errMsg = 'datastore key does not have a valid format'
9191

9292
log.error(errMsg)
9393
return callback(errcode(new Error(errMsg), 'ERR_INVALID_DATASTORE_KEY'))
@@ -118,14 +118,14 @@ class IpnsPublisher {
118118

119119
_publishPublicKey (key, publicKey, peerId, callback) {
120120
if ((!Key.isKey(key))) {
121-
const errMsg = `datastore key does not have a valid format`
121+
const errMsg = 'datastore key does not have a valid format'
122122

123123
log.error(errMsg)
124124
return callback(errcode(new Error(errMsg), 'ERR_INVALID_DATASTORE_KEY'))
125125
}
126126

127127
if (!publicKey || !publicKey.bytes) {
128-
const errMsg = `one or more of the provided parameters are not defined`
128+
const errMsg = 'one or more of the provided parameters are not defined'
129129

130130
log.error(errMsg)
131131
return callback(errcode(new Error(errMsg), 'ERR_UNDEFINED_PARAMETER'))
@@ -149,7 +149,7 @@ class IpnsPublisher {
149149
// If `checkRouting` is true and we have no existing record, this method will check the routing system for any existing records.
150150
_getPublished (peerId, options, callback) {
151151
if (!(PeerId.isPeerId(peerId))) {
152-
const errMsg = `peerId received is not valid`
152+
const errMsg = 'peerId received is not valid'
153153

154154
log.error(errMsg)
155155
return callback(errcode(new Error(errMsg), 'ERR_INVALID_PEER_ID'))
@@ -209,7 +209,7 @@ class IpnsPublisher {
209209

210210
_updateOrCreateRecord (privKey, value, validity, peerId, callback) {
211211
if (!(PeerId.isPeerId(peerId))) {
212-
const errMsg = `peerId received is not valid`
212+
const errMsg = 'peerId received is not valid'
213213

214214
log.error(errMsg)
215215
return callback(errcode(new Error(errMsg), 'ERR_INVALID_PEER_ID'))

src/core/ipns/republisher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class IpnsRepublisher {
167167
record = ipns.unmarshal(dsVal)
168168
} catch (err) {
169169
log.error(err)
170-
return callback(errcode(new Error(`found ipns record that we couldn't convert to a value`), 'ERR_INVALID_IPNS_RECORD'))
170+
return callback(errcode(new Error('found ipns record that we couldn\'t convert to a value'), 'ERR_INVALID_IPNS_RECORD'))
171171
}
172172

173173
callback(null, record.value)

src/core/ipns/resolver.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class IpnsResolver {
108108
ipnsEntry = ipns.unmarshal(record)
109109
} catch (err) {
110110
log.error(err)
111-
return callback(errcode(new Error(`found ipns record that we couldn't convert to a value`), 'ERR_INVALID_RECORD_RECEIVED'))
111+
return callback(errcode(new Error('found ipns record that we couldn\'t convert to a value'), 'ERR_INVALID_RECORD_RECEIVED'))
112112
}
113113

114114
// if the record has a public key validate it
@@ -131,7 +131,7 @@ class IpnsResolver {
131131
peerId.pubKey = crypto.keys.unmarshalPublicKey(pubKey)
132132
} catch (err) {
133133
log.error(err)
134-
return callback(errcode(new Error(`found public key record that we couldn't convert to a value`), 'ERR_INVALID_PUB_KEY_RECEIVED'))
134+
return callback(errcode(new Error('found public key record that we couldn\'t convert to a value'), 'ERR_INVALID_PUB_KEY_RECEIVED'))
135135
}
136136

137137
this._validateRecord(peerId, ipnsEntry, callback)

0 commit comments

Comments
 (0)