Skip to content

Commit 0a7b518

Browse files
committed
chore(prettier): upgrade to v2.1.2
1 parent e68e446 commit 0a7b518

File tree

27 files changed

+71
-149
lines changed

27 files changed

+71
-149
lines changed

app-template/afterPack-template.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const fs = require('fs');
22
const fse = require('fs-extra');
33
const path = require('path');
4-
module.exports = function(params) {
4+
module.exports = function (params) {
55
const unpackFile = path.join(
66
params.appOutDir,
77
'*NAMECASENOSPACE*.app/Contents/Resources/app.asar.unpacked'

app-template/apply.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const jsonHeader = `{
2626

2727
console.log(`Applying templates for: ${config.nameCase}`);
2828

29-
Object.keys(templates).forEach(function(k) {
29+
Object.keys(templates).forEach(function (k) {
3030
const targetDir = templates[k];
3131
console.log(' # ' + k + ' => ' + targetDir);
3232

@@ -38,7 +38,7 @@ Object.keys(templates).forEach(function(k) {
3838
content = MakefileHeader + content;
3939
}
4040

41-
Object.keys(config).forEach(function(k) {
41+
Object.keys(config).forEach(function (k) {
4242
if (k.indexOf('_') == 0) return;
4343

4444
const r = new RegExp('\\*' + k.toUpperCase() + '\\*', 'g');
@@ -87,7 +87,7 @@ Object.keys(templates).forEach(function(k) {
8787
});
8888

8989
// Get latest commit hash
90-
const getCommitHash = function() {
90+
const getCommitHash = function () {
9191
//exec git command to get the hash of the current commit
9292
const hash = shell
9393
.exec('git rev-parse HEAD', {

electron/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ app.on('activate', () => {
199199
}
200200
});
201201

202-
app.on('open-url', function(e, url) {
202+
app.on('open-url', function (e, url) {
203203
e.preventDefault();
204204
deeplinkingUrl = url;
205205
// Wait for main window to be ready

i18n/crowdin_download.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ https.get(
4949
crowdin_identifier +
5050
'/download/all.zip?key=' +
5151
crowdin_api_key,
52-
function(res) {
52+
function (res) {
5353
var data = [],
5454
dataLen = 0;
5555

5656
res
57-
.on('data', function(chunk) {
57+
.on('data', function (chunk) {
5858
data.push(chunk);
5959
dataLen += chunk.length;
6060
})
61-
.on('end', function() {
61+
.on('end', function () {
6262
var buf = new Buffer.alloc(dataLen);
6363
for (var i = 0, len = data.length, pos = 0; i < len; i++) {
6464
data[i].copy(buf, pos);

package.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,11 @@
213213
"karma-jasmine-html-reporter": "0.2.2",
214214
"karma-spec-reporter": "0.0.32",
215215
"mini-css-extract-plugin": "0.8.0",
216-
"prettier": "1.15.2",
216+
"prettier": "2.1.2",
217217
"shelljs": "0.8.1",
218218
"ts-node": "5.0.0",
219219
"tslint": "5.8.0",
220-
"tslint-config-prettier": "1.7.0",
220+
"tslint-config-prettier": "1.18.0",
221221
"typescript": "4.0.3",
222222
"webpack": "3.12.0",
223223
"webpack-obfuscator": "0.17.3"
@@ -278,6 +278,8 @@
278278
]
279279
},
280280
"prettier": {
281-
"singleQuote": true
281+
"singleQuote": true,
282+
"trailingComma": "none",
283+
"arrowParens": "avoid"
282284
}
283285
}

src/directives/fixed-scroll-bg-color/fixed-scroll-bg-color.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,7 @@ export class FixedScrollBgColor {
4040
'wrapper'
4141
)[0];
4242

43-
const linearGradient = `linear-gradient(to bottom, ${this.color}, ${
44-
this.color
45-
} 50%, ${this.bottomColor} 50%, ${this.bottomColor} 50%, ${
46-
this.bottomColor
47-
} 50%)`;
43+
const linearGradient = `linear-gradient(to bottom, ${this.color}, ${this.color} 50%, ${this.bottomColor} 50%, ${this.bottomColor} 50%, ${this.bottomColor} 50%)`;
4844

4945
if (color) {
5046
scrollContent.style.setProperty('background-image', linearGradient);

src/directives/navbar-bg/navbar-bg.spec.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ let instance;
88
let toolbarBg;
99

1010
@Component({
11-
template: `
12-
<ion-navbar [navbar-bg]="color"></ion-navbar>
13-
`
11+
template: ` <ion-navbar [navbar-bg]="color"></ion-navbar> `
1412
})
1513
class TestHostComponent {
1614
color: string = 'blue';

src/pages/buy-crypto/crypto-offers/crypto-offers.ts

+2-10
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,7 @@ export class CryptoOffersPage {
319319
this.amount < this.offers.simplex.amountLimits.min ||
320320
this.amount > this.offers.simplex.amountLimits.max
321321
) {
322-
this.offers.simplex.errorMsg = `The ${
323-
this.fiatCurrency
324-
} amount must be between ${this.offers.simplex.amountLimits.min} and ${
325-
this.offers.simplex.amountLimits.max
326-
}`;
322+
this.offers.simplex.errorMsg = `The ${this.fiatCurrency} amount must be between ${this.offers.simplex.amountLimits.min} and ${this.offers.simplex.amountLimits.max}`;
327323
return;
328324
} else {
329325
let paymentMethod: string[] = [];
@@ -467,11 +463,7 @@ export class CryptoOffersPage {
467463
this.amount < this.offers.wyre.amountLimits.min ||
468464
this.amount > this.offers.wyre.amountLimits.max
469465
) {
470-
this.offers.wyre.errorMsg = `The ${
471-
this.fiatCurrency
472-
} daily amount must be between ${this.offers.wyre.amountLimits.min} and ${
473-
this.offers.wyre.amountLimits.max
474-
}`;
466+
this.offers.wyre.errorMsg = `The ${this.fiatCurrency} daily amount must be between ${this.offers.wyre.amountLimits.min} and ${this.offers.wyre.amountLimits.max}`;
475467
return;
476468
} else {
477469
this.walletProvider

src/pages/buy-crypto/crypto-order-summary/crypto-order-summary.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,7 @@ export class CryptoOrderSummaryPage {
234234
return;
235235
} else {
236236
this.logger.debug(
237-
`No payment methods available for ${this.coin} and ${
238-
this.currency
239-
}. Show warning.`
237+
`No payment methods available for ${this.coin} and ${this.currency}. Show warning.`
240238
);
241239
this.setDefaultPaymentMethod();
242240
this.showPaymentMethodWarning('coin');

src/pages/home/home.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -476,9 +476,7 @@ export class HomePage {
476476
this.advertisements.unshift({
477477
name: advertisementName,
478478
title: `${discountText} off ${discountedCard.displayName}`,
479-
body: `Save ${discountText} off ${
480-
discountedCard.displayName
481-
} gift cards. Limited time offer.`,
479+
body: `Save ${discountText} off ${discountedCard.displayName} gift cards. Limited time offer.`,
482480
app: 'bitpay',
483481
linkText: 'Buy Now',
484482
link: BuyCardPage,
@@ -737,7 +735,5 @@ export class HomePage {
737735
}
738736

739737
function getGiftCardAdvertisementName(discountedCard: CardConfig): string {
740-
return `${discountedCard.discounts[0].code}-${
741-
discountedCard.name
742-
}-gift-card-discount`;
738+
return `${discountedCard.discounts[0].code}-${discountedCard.name}-gift-card-discount`;
743739
}

src/pages/integrations/bitpay-card/bitpay-card-topup/bitpay-card-topup.ts

+3-9
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,7 @@ export class BitPayCardTopUpPage {
439439
: Math.ceil(details.requiredFeeRate * 1024);
440440
txp.feePerKb = requiredFeeRate;
441441
this.logger.debug(
442-
`PayProDetails requiredFeeRate: ${
443-
details.requiredFeeRate
444-
}. Txp feePerKb: ${txp.feePerKb}`
442+
`PayProDetails requiredFeeRate: ${details.requiredFeeRate}. Txp feePerKb: ${txp.feePerKb}`
445443
);
446444
this.logger.debug(
447445
'Using merchant fee rate (for debit card):' + txp.feePerKb
@@ -795,9 +793,7 @@ export class BitPayCardTopUpPage {
795793
this.logCardTopUpEvent(wallet.coin, false);
796794

797795
this.logger.debug(
798-
`Creating invoice. amount: ${parsedAmount.amount} - currency: ${
799-
parsedAmount.currency
800-
}`
796+
`Creating invoice. amount: ${parsedAmount.amount} - currency: ${parsedAmount.currency}`
801797
);
802798
this.createInvoice(dataSrc)
803799
.then(invoice => {
@@ -887,9 +883,7 @@ export class BitPayCardTopUpPage {
887883
this.logCardTopUpEvent(account.currency.code, false);
888884

889885
this.logger.debug(
890-
`Creating invoice. amount: ${dataSrc.amount} - currency: ${
891-
dataSrc.currency
892-
}`
886+
`Creating invoice. amount: ${dataSrc.amount} - currency: ${dataSrc.currency}`
893887
);
894888
this.createInvoice(dataSrc)
895889
.then(invoice => {

src/pages/integrations/bitpay-card/bitpay-card.ts

+3-9
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,15 @@ export class BitPayCardPage {
121121
preset = preset || 'last30Days';
122122
switch (preset) {
123123
case 'last30Days':
124-
startDate = moment()
125-
.subtract(30, 'days')
126-
.toISOString();
124+
startDate = moment().subtract(30, 'days').toISOString();
127125
endDate = moment().toISOString();
128126
break;
129127
case 'lastMonth':
130128
startDate = moment()
131129
.startOf('month')
132130
.subtract(1, 'month')
133131
.toISOString();
134-
endDate = moment()
135-
.startOf('month')
136-
.toISOString();
132+
endDate = moment().startOf('month').toISOString();
137133
break;
138134
case 'all':
139135
startDate = null;
@@ -244,9 +240,7 @@ export class BitPayCardPage {
244240
let amTime = this.createdWithinPastDay(txs[i]);
245241
newDate = amTime
246242
? moment(txDateUtc).fromNow()
247-
: moment(txDate)
248-
.utc()
249-
.format('MMM D, YYYY');
243+
: moment(txDate).utc().format('MMM D, YYYY');
250244
txs[i].date = newDate;
251245
}
252246
}

src/pages/integrations/gift-cards/confirm-card-purchase/confirm-card-purchase.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,7 @@ export class ConfirmCardPurchasePage extends ConfirmPage {
361361
if (errMessage && errMessage.match(/suspended/i)) {
362362
err_title = this.translate.instant('Service not available');
363363
err_msg = this.translate.instant(
364-
`${
365-
this.cardConfig.displayName
366-
} gift card purchases are not available at this time. Please try again later.`
364+
`${this.cardConfig.displayName} gift card purchases are not available at this time. Please try again later.`
367365
);
368366
} else if (errMessage) {
369367
err_msg = errMessage;
@@ -842,9 +840,10 @@ export class ConfirmCardPurchasePage extends ConfirmPage {
842840
this.wallet = null;
843841
this.coinbaseAccount = option.accountSelected;
844842
const email = this.coinbaseProvider.coinbaseData.user.email;
845-
await this.initializeCoinbase(option.accountSelected, email).catch(
846-
() => {}
847-
);
843+
await this.initializeCoinbase(
844+
option.accountSelected,
845+
email
846+
).catch(() => {});
848847
} else {
849848
this.wallet = option;
850849
this.coinbaseAccount = null;

src/pages/integrations/gift-cards/home-gift-cards/home-gift-cards.ts

+5-8
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,11 @@ export class HomeGiftCards implements OnInit {
211211

212212
private groupCardsByBrand(cards: GiftCard[]): GiftCard[][] {
213213
return cards
214-
.reduce(
215-
(brands, c) => {
216-
const brandCards = brands.find(b => b[0].name === c.name);
217-
brandCards ? brandCards.push(c) : brands.push([c]);
218-
return brands;
219-
},
220-
[] as GiftCard[][]
221-
)
214+
.reduce((brands, c) => {
215+
const brandCards = brands.find(b => b[0].name === c.name);
216+
brandCards ? brandCards.push(c) : brands.push([c]);
217+
return brands;
218+
}, [] as GiftCard[][])
222219
.sort((a, b) => sortByDisplayName(a[0], b[0]));
223220
}
224221
}

src/pages/send/confirm/confirm.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,8 @@ export class ConfirmPage {
350350
private setWalletSelector(coin: string, network: string): Promise<any> {
351351
if (
352352
this.wallet &&
353-
(this.wallet.network == network && this.wallet.coin == coin)
353+
this.wallet.network == network &&
354+
this.wallet.coin == coin
354355
) {
355356
return Promise.resolve();
356357
}
@@ -597,9 +598,7 @@ export class ConfirmPage {
597598
} else if (this.usingMerchantFee) {
598599
const maxAllowedFee = feeRate * 5;
599600
this.logger.info(
600-
`Using Merchant Fee: ${
601-
tx.feeRate
602-
} vs. referent level (5 * feeRate) ${maxAllowedFee}`
601+
`Using Merchant Fee: ${tx.feeRate} vs. referent level (5 * feeRate) ${maxAllowedFee}`
603602
);
604603
const isUtxo = this.currencyProvider.isUtxoCoin(wallet.coin);
605604
if (

src/pages/settings/about/about.spec.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,9 @@ describe('AboutPage', () => {
4343
expect(instance.translate.instant).toHaveBeenCalledWith(
4444
'About {{appName}}'
4545
);
46-
expect(instance.replaceParametersProvider.replace).toHaveBeenCalledWith(
47-
'testVal',
48-
{ appName: 'testName' }
49-
);
46+
expect(
47+
instance.replaceParametersProvider.replace
48+
).toHaveBeenCalledWith('testVal', { appName: 'testName' });
5049
expect(instance.title).toEqual('testTitle');
5150
});
5251
});

src/pages/settings/alt-currency/alt-currency.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,7 @@ export class AltCurrencyPage {
157157

158158
private showErrorAndRemoveAltCurrency(altCurrency): void {
159159
const title = this.translate.instant('Error');
160-
const msg = `${altCurrency.name} (${
161-
altCurrency.isoCode
162-
}) is no longer supported. Please select another alternative currency`;
160+
const msg = `${altCurrency.name} (${altCurrency.isoCode}) is no longer supported. Please select another alternative currency`;
163161
this.errorsProvider.showDefaultError(msg, title, () => {
164162
this.lastUsedAltCurrencyList = _.reject(this.lastUsedAltCurrencyList, [
165163
'isoCode',

src/pipes/order-by.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ export class OrderByPipe implements PipeTransform {
1717
if (
1818
isNaN(parseFloat(a)) ||
1919
!isFinite(a) ||
20-
(isNaN(parseFloat(b)) || !isFinite(b))
20+
isNaN(parseFloat(b)) ||
21+
!isFinite(b)
2122
) {
2223
// Isn't a number so lowercase the string to properly compare
2324
if (a.toLowerCase() < b.toLowerCase()) return -1;

src/providers/bitpay-card/bitpay-card.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ export class BitPayCardProvider {
149149
if (
150150
['paid', 'confirmed', 'complete'].indexOf(invoices[i].status) >=
151151
0 ||
152-
(invoices[i].status === 'invalid' || isInvoiceUnderpaid)
152+
invoices[i].status === 'invalid' ||
153+
isInvoiceUnderpaid
153154
) {
154155
activityList.unshift(
155156
this._getMerchantInfo({

src/providers/in-app-browser/card.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -887,9 +887,7 @@ export class IABCardProvider {
887887
this.logger.log('appleWallet - startAddPaymentPass - not available');
888888
payload = {
889889
...payload,
890-
error: `ios version (${
891-
this.device.version
892-
}) does not support apple wallet`
890+
error: `ios version (${this.device.version}) does not support apple wallet`
893891
};
894892
}
895893

src/providers/incoming-data/incoming-data.spec.ts

+4-16
Original file line numberDiff line numberDiff line change
@@ -713,14 +713,8 @@ describe('Provider: Incoming Data Provider', () => {
713713

714714
let oldAddr = parsed.address ? parsed.address.toString() : '';
715715

716-
let a = bwcProvider
717-
.getBitcore()
718-
.Address(oldAddr)
719-
.toObject();
720-
let addr = bwcProvider
721-
.getBitcoreCash()
722-
.Address.fromObject(a)
723-
.toString();
716+
let a = bwcProvider.getBitcore().Address(oldAddr).toObject();
717+
let addr = bwcProvider.getBitcoreCash().Address.fromObject(a).toString();
724718

725719
let stateParams = {
726720
toAddress: addr,
@@ -749,14 +743,8 @@ describe('Provider: Incoming Data Provider', () => {
749743

750744
let oldAddr = parsed.address ? parsed.address.toString() : '';
751745

752-
let a = bwcProvider
753-
.getBitcore()
754-
.Address(oldAddr)
755-
.toObject();
756-
let addr = bwcProvider
757-
.getBitcoreCash()
758-
.Address.fromObject(a)
759-
.toString();
746+
let a = bwcProvider.getBitcore().Address(oldAddr).toObject();
747+
let addr = bwcProvider.getBitcoreCash().Address.fromObject(a).toString();
760748

761749
let stateParams = {
762750
toAddress: addr,

0 commit comments

Comments
 (0)