Skip to content

Commit 86d02c2

Browse files
committed
fix: run lint
1 parent 90466cf commit 86d02c2

12 files changed

+51
-52
lines changed

plugins/add-vendors-plugin.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
33
// Code is Apache-2.0 and docs are CC-BY-4.0
44

5+
/* eslint-disable strict, no-console, object-shorthand, import/no-extraneous-dependencies */
6+
57
const { ConcatSource } = require('webpack-sources')
68

79
module.exports = class AddVendorsPlugin {
@@ -28,7 +30,7 @@ module.exports = class AddVendorsPlugin {
2830
compilation.assets[this.base] = main
2931
compilation.assets[`${this.base}.map`] = mainMap
3032
}
31-
33+
3234
callback()
3335
}
3436
)

src/baseRequest.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ import stringifyAsQueryParam from './stringify_as_query_param'
1111

1212
const fetch = fetchPonyfill(Promise)
1313

14-
export function ResponseError(message, status, requestURI) {
14+
export function ResponseError(message, status, requestURI) {
1515
this.name = 'ResponseError'
1616
this.message = message
1717
this.status = status
1818
this.requestURI = requestURI
1919
this.stack = (new Error()).stack
2020
}
2121

22-
ResponseError.prototype = new Error;
22+
ResponseError.prototype = new Error()
2323

2424
/**
2525
* @private
@@ -50,12 +50,15 @@ function handleResponse(res) {
5050
// If status is not a 2xx (based on Response.ok), assume it's an error
5151
// See https://developer.mozilla.org/en-US/docs/Web/API/GlobalFetch/fetch
5252
if (!(res && res.ok)) {
53-
throw new ResponseError('HTTP Error: Requested page not reachable', `${res.status} ${res.statusText}`, res.url)
53+
throw new ResponseError(
54+
'HTTP Error: Requested page not reachable',
55+
`${res.status} ${res.statusText}`,
56+
res.url
57+
)
5458
}
5559
return res
5660
}
5761

58-
5962
/**
6063
* @private
6164
* imported from https://github.com/bigchaindb/js-utility-belt/

src/connection.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default class Connection {
2222
// This driver implements the BEP-14 https://github.com/bigchaindb/BEPs/tree/master/14
2323
constructor(nodes, headers = {}, timeout = DEFAULT_TIMEOUT) {
2424
// Copy object
25-
this.headers = Object.assign({}, headers)
25+
this.headers = { ...headers }
2626

2727
// Validate headers
2828
Object.keys(headers).forEach(header => {
@@ -49,7 +49,7 @@ export default class Connection {
4949
if (typeof node === 'string') {
5050
return { 'endpoint': node, 'headers': headers }
5151
} else {
52-
const allHeaders = Object.assign({}, headers, node.headers)
52+
const allHeaders = { ...headers, ...node.headers }
5353
return { 'endpoint': node.endpoint, 'headers': allHeaders }
5454
}
5555
}
@@ -155,7 +155,6 @@ export default class Connection {
155155
})
156156
}
157157

158-
159158
/**
160159
* @param transaction
161160
*/
@@ -166,7 +165,6 @@ export default class Connection {
166165
})
167166
}
168167

169-
170168
/**
171169
* @param transaction
172170
*/

src/format_text.js

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import { sprintf } from 'sprintf-js'
66

7-
87
// Regexes taken from or inspired by sprintf-js
98
const Regex = {
109
TEMPLATE_LITERAL: /\${([^)]+?)}/g,

src/request.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ const ERROR_FROM_SERVER = 'HTTP Error: Requested page not reachable'
1919
* default settings, and response handling.
2020
*/
2121

22-
2322
export default class Request {
2423
constructor(node) {
2524
this.node = node
@@ -33,14 +32,15 @@ export default class Request {
3332
return Promise.reject(new Error('Request was not given a url.'))
3433
}
3534
// Load default fetch configuration and remove any falsy query parameters
36-
const requestConfig = Object.assign({}, this.node.headers, DEFAULT_REQUEST_CONFIG, config, {
35+
const requestConfig = {
36+
...this.node.headers,
37+
...DEFAULT_REQUEST_CONFIG,
38+
...config,
3739
query: config.query && sanitize(config.query)
38-
})
40+
}
3941
const apiUrl = this.node.endpoint + urlPath
4042
if (requestConfig.jsonBody) {
41-
requestConfig.headers = Object.assign({}, requestConfig.headers, {
42-
'Content-Type': 'application/json'
43-
})
43+
requestConfig.headers = { ...requestConfig.headers, 'Content-Type': 'application/json' }
4444
}
4545

4646
// If connectionError occurs, a timestamp equal to now +

src/sanitize.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
// SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
33
// Code is Apache-2.0 and docs are CC-BY-4.0
44

5-
import 'core-js/features/array/includes';
6-
import 'core-js/features/object/entries';
7-
5+
import 'core-js/features/array/includes'
6+
import 'core-js/features/object/entries'
87

98
/**
109
* @private
@@ -32,7 +31,7 @@ function filterFromObject(obj, filter, { isInclusion = true } = {}) {
3231
*/
3332
function applyFilterOnObject(obj, filterFn) {
3433
if (filterFn == null) {
35-
return Object.assign({}, obj)
34+
return { ...obj }
3635
}
3736

3837
const filteredObj = {}

src/stringify_as_query_param.js

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import 'core-js/features/object/entries'
66
import decamelize from 'decamelize'
77
import queryString from 'query-string'
88

9-
109
/**
1110
* @private
1211
* imported from https://github.com/bigchaindb/js-utility-belt/

src/transaction.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export default class Transaction {
166166
subconditions.forEach((subcondition) => {
167167
// TODO: add support for Condition
168168
thresholdCondition.addSubfulfillment(subcondition)
169-
//? Should be thresholdCondition.addSubcondition(subcondition)
169+
// ? Should be thresholdCondition.addSubcondition(subcondition)
170170
})
171171

172172
if (json) {

src/transport.js

-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import Request from './request'
66

7-
87
/**
98
*
109
* @private
@@ -13,7 +12,6 @@ import Request from './request'
1312
* customizable in the future).
1413
*/
1514

16-
1715
export default class Transport {
1816
constructor(nodes, timeout) {
1917
this.connectionPool = []

test/constants.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
33
// Code is Apache-2.0 and docs are CC-BY-4.0
44

5-
import base58 from 'bs58'
65
import { createHash } from 'crypto'
6+
import base58 from 'bs58'
77
import { Ed25519Sha256 } from 'crypto-conditions'
88
import { Transaction, Ed25519Keypair } from '../src'
99
// TODO: Find out if ava has something like conftest, if so put this there.
@@ -34,13 +34,14 @@ export const bobCondition = Transaction.makeEd25519Condition(bob.publicKey)
3434
export const bobOutput = Transaction.makeOutput(bobCondition)
3535

3636
export function delegatedSignTransaction(...keyPairs) {
37-
return function sign(serializedTransaction, input, index) {
37+
return function sign(serializedTransaction, input) {
3838
const transactionUniqueFulfillment = input.fulfills ? serializedTransaction
39-
.concat(input.fulfills.transaction_id)
40-
.concat(input.fulfills.output_index) : serializedTransaction
39+
.concat(input.fulfills.transaction_id)
40+
.concat(input.fulfills.output_index) : serializedTransaction
4141
const transactionHash = createHash('sha3-256').update(transactionUniqueFulfillment).digest()
42-
const filteredKeyPairs = keyPairs.filter(({ publicKey }) =>
43-
input.owners_before.includes(publicKey))
42+
const filteredKeyPairs = keyPairs.filter(
43+
({ publicKey }) => input.owners_before.includes(publicKey)
44+
)
4445

4546
const ed25519Fulfillment = new Ed25519Sha256()
4647
filteredKeyPairs.forEach(keyPair => {

webpack.development.js

+21-21
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,33 @@
22
// SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
33
// Code is Apache-2.0 and docs are CC-BY-4.0
44

5-
/* eslint-disable strict, no-console, object-shorthand */
5+
/* eslint-disable strict, no-console, object-shorthand, import/no-extraneous-dependencies */
66

77
'use strict'
88

99
const TerserPlugin = require('terser-webpack-plugin')
1010

1111
module.exports = {
12-
devtool: 'inline-source-map',
13-
optimization: {
14-
minimizer: [
15-
new TerserPlugin({
16-
test: /vendor/,
17-
sourceMap: false
18-
}),
19-
new TerserPlugin({
20-
test: /^((?!(vendor)).)*.js$/,
21-
sourceMap: false
22-
})
23-
],
24-
splitChunks: {
25-
cacheGroups: {
26-
commons: {
27-
test: /[\\/]node_modules[\\/]/,
28-
name: 'vendors',
29-
chunks: 'all'
12+
devtool: 'inline-source-map',
13+
optimization: {
14+
minimizer: [
15+
new TerserPlugin({
16+
test: /vendor/,
17+
sourceMap: false
18+
}),
19+
new TerserPlugin({
20+
test: /^((?!(vendor)).)*.js$/,
21+
sourceMap: false
22+
})
23+
],
24+
splitChunks: {
25+
cacheGroups: {
26+
commons: {
27+
test: /[\\/]node_modules[\\/]/,
28+
name: 'vendors',
29+
chunks: 'all'
30+
}
31+
}
3032
}
31-
}
3233
}
33-
}
3434
}

webpack.parts.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
33
// Code is Apache-2.0 and docs are CC-BY-4.0
44

5-
/* eslint-disable strict, no-console, object-shorthand */
5+
/* eslint-disable strict, no-console, object-shorthand, import/no-extraneous-dependencies */
66

77
'use strict'
88

0 commit comments

Comments
 (0)