Skip to content

Commit

Permalink
chore(prettier): upgrade to v2.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
cmgustavo committed Nov 12, 2020
1 parent e68e446 commit 0a7b518
Show file tree
Hide file tree
Showing 27 changed files with 71 additions and 149 deletions.
2 changes: 1 addition & 1 deletion app-template/afterPack-template.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const fs = require('fs');
const fse = require('fs-extra');
const path = require('path');
module.exports = function(params) {
module.exports = function (params) {
const unpackFile = path.join(
params.appOutDir,
'*NAMECASENOSPACE*.app/Contents/Resources/app.asar.unpacked'
Expand Down
6 changes: 3 additions & 3 deletions app-template/apply.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const jsonHeader = `{

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

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

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

Object.keys(config).forEach(function(k) {
Object.keys(config).forEach(function (k) {
if (k.indexOf('_') == 0) return;

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

// Get latest commit hash
const getCommitHash = function() {
const getCommitHash = function () {
//exec git command to get the hash of the current commit
const hash = shell
.exec('git rev-parse HEAD', {
Expand Down
2 changes: 1 addition & 1 deletion electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ app.on('activate', () => {
}
});

app.on('open-url', function(e, url) {
app.on('open-url', function (e, url) {
e.preventDefault();
deeplinkingUrl = url;
// Wait for main window to be ready
Expand Down
6 changes: 3 additions & 3 deletions i18n/crowdin_download.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ https.get(
crowdin_identifier +
'/download/all.zip?key=' +
crowdin_api_key,
function(res) {
function (res) {
var data = [],
dataLen = 0;

res
.on('data', function(chunk) {
.on('data', function (chunk) {
data.push(chunk);
dataLen += chunk.length;
})
.on('end', function() {
.on('end', function () {
var buf = new Buffer.alloc(dataLen);
for (var i = 0, len = data.length, pos = 0; i < len; i++) {
data[i].copy(buf, pos);
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,11 @@
"karma-jasmine-html-reporter": "0.2.2",
"karma-spec-reporter": "0.0.32",
"mini-css-extract-plugin": "0.8.0",
"prettier": "1.15.2",
"prettier": "2.1.2",
"shelljs": "0.8.1",
"ts-node": "5.0.0",
"tslint": "5.8.0",
"tslint-config-prettier": "1.7.0",
"tslint-config-prettier": "1.18.0",
"typescript": "4.0.3",
"webpack": "3.12.0",
"webpack-obfuscator": "0.17.3"
Expand Down Expand Up @@ -278,6 +278,8 @@
]
},
"prettier": {
"singleQuote": true
"singleQuote": true,
"trailingComma": "none",
"arrowParens": "avoid"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ export class FixedScrollBgColor {
'wrapper'
)[0];

const linearGradient = `linear-gradient(to bottom, ${this.color}, ${
this.color
} 50%, ${this.bottomColor} 50%, ${this.bottomColor} 50%, ${
this.bottomColor
} 50%)`;
const linearGradient = `linear-gradient(to bottom, ${this.color}, ${this.color} 50%, ${this.bottomColor} 50%, ${this.bottomColor} 50%, ${this.bottomColor} 50%)`;

if (color) {
scrollContent.style.setProperty('background-image', linearGradient);
Expand Down
4 changes: 1 addition & 3 deletions src/directives/navbar-bg/navbar-bg.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ let instance;
let toolbarBg;

@Component({
template: `
<ion-navbar [navbar-bg]="color"></ion-navbar>
`
template: ` <ion-navbar [navbar-bg]="color"></ion-navbar> `
})
class TestHostComponent {
color: string = 'blue';
Expand Down
12 changes: 2 additions & 10 deletions src/pages/buy-crypto/crypto-offers/crypto-offers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,7 @@ export class CryptoOffersPage {
this.amount < this.offers.simplex.amountLimits.min ||
this.amount > this.offers.simplex.amountLimits.max
) {
this.offers.simplex.errorMsg = `The ${
this.fiatCurrency
} amount must be between ${this.offers.simplex.amountLimits.min} and ${
this.offers.simplex.amountLimits.max
}`;
this.offers.simplex.errorMsg = `The ${this.fiatCurrency} amount must be between ${this.offers.simplex.amountLimits.min} and ${this.offers.simplex.amountLimits.max}`;
return;
} else {
let paymentMethod: string[] = [];
Expand Down Expand Up @@ -467,11 +463,7 @@ export class CryptoOffersPage {
this.amount < this.offers.wyre.amountLimits.min ||
this.amount > this.offers.wyre.amountLimits.max
) {
this.offers.wyre.errorMsg = `The ${
this.fiatCurrency
} daily amount must be between ${this.offers.wyre.amountLimits.min} and ${
this.offers.wyre.amountLimits.max
}`;
this.offers.wyre.errorMsg = `The ${this.fiatCurrency} daily amount must be between ${this.offers.wyre.amountLimits.min} and ${this.offers.wyre.amountLimits.max}`;
return;
} else {
this.walletProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,7 @@ export class CryptoOrderSummaryPage {
return;
} else {
this.logger.debug(
`No payment methods available for ${this.coin} and ${
this.currency
}. Show warning.`
`No payment methods available for ${this.coin} and ${this.currency}. Show warning.`
);
this.setDefaultPaymentMethod();
this.showPaymentMethodWarning('coin');
Expand Down
8 changes: 2 additions & 6 deletions src/pages/home/home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -476,9 +476,7 @@ export class HomePage {
this.advertisements.unshift({
name: advertisementName,
title: `${discountText} off ${discountedCard.displayName}`,
body: `Save ${discountText} off ${
discountedCard.displayName
} gift cards. Limited time offer.`,
body: `Save ${discountText} off ${discountedCard.displayName} gift cards. Limited time offer.`,
app: 'bitpay',
linkText: 'Buy Now',
link: BuyCardPage,
Expand Down Expand Up @@ -737,7 +735,5 @@ export class HomePage {
}

function getGiftCardAdvertisementName(discountedCard: CardConfig): string {
return `${discountedCard.discounts[0].code}-${
discountedCard.name
}-gift-card-discount`;
return `${discountedCard.discounts[0].code}-${discountedCard.name}-gift-card-discount`;
}
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,7 @@ export class BitPayCardTopUpPage {
: Math.ceil(details.requiredFeeRate * 1024);
txp.feePerKb = requiredFeeRate;
this.logger.debug(
`PayProDetails requiredFeeRate: ${
details.requiredFeeRate
}. Txp feePerKb: ${txp.feePerKb}`
`PayProDetails requiredFeeRate: ${details.requiredFeeRate}. Txp feePerKb: ${txp.feePerKb}`
);
this.logger.debug(
'Using merchant fee rate (for debit card):' + txp.feePerKb
Expand Down Expand Up @@ -795,9 +793,7 @@ export class BitPayCardTopUpPage {
this.logCardTopUpEvent(wallet.coin, false);

this.logger.debug(
`Creating invoice. amount: ${parsedAmount.amount} - currency: ${
parsedAmount.currency
}`
`Creating invoice. amount: ${parsedAmount.amount} - currency: ${parsedAmount.currency}`
);
this.createInvoice(dataSrc)
.then(invoice => {
Expand Down Expand Up @@ -887,9 +883,7 @@ export class BitPayCardTopUpPage {
this.logCardTopUpEvent(account.currency.code, false);

this.logger.debug(
`Creating invoice. amount: ${dataSrc.amount} - currency: ${
dataSrc.currency
}`
`Creating invoice. amount: ${dataSrc.amount} - currency: ${dataSrc.currency}`
);
this.createInvoice(dataSrc)
.then(invoice => {
Expand Down
12 changes: 3 additions & 9 deletions src/pages/integrations/bitpay-card/bitpay-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,15 @@ export class BitPayCardPage {
preset = preset || 'last30Days';
switch (preset) {
case 'last30Days':
startDate = moment()
.subtract(30, 'days')
.toISOString();
startDate = moment().subtract(30, 'days').toISOString();
endDate = moment().toISOString();
break;
case 'lastMonth':
startDate = moment()
.startOf('month')
.subtract(1, 'month')
.toISOString();
endDate = moment()
.startOf('month')
.toISOString();
endDate = moment().startOf('month').toISOString();
break;
case 'all':
startDate = null;
Expand Down Expand Up @@ -244,9 +240,7 @@ export class BitPayCardPage {
let amTime = this.createdWithinPastDay(txs[i]);
newDate = amTime
? moment(txDateUtc).fromNow()
: moment(txDate)
.utc()
.format('MMM D, YYYY');
: moment(txDate).utc().format('MMM D, YYYY');
txs[i].date = newDate;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,7 @@ export class ConfirmCardPurchasePage extends ConfirmPage {
if (errMessage && errMessage.match(/suspended/i)) {
err_title = this.translate.instant('Service not available');
err_msg = this.translate.instant(
`${
this.cardConfig.displayName
} gift card purchases are not available at this time. Please try again later.`
`${this.cardConfig.displayName} gift card purchases are not available at this time. Please try again later.`
);
} else if (errMessage) {
err_msg = errMessage;
Expand Down Expand Up @@ -842,9 +840,10 @@ export class ConfirmCardPurchasePage extends ConfirmPage {
this.wallet = null;
this.coinbaseAccount = option.accountSelected;
const email = this.coinbaseProvider.coinbaseData.user.email;
await this.initializeCoinbase(option.accountSelected, email).catch(
() => {}
);
await this.initializeCoinbase(
option.accountSelected,
email
).catch(() => {});
} else {
this.wallet = option;
this.coinbaseAccount = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,11 @@ export class HomeGiftCards implements OnInit {

private groupCardsByBrand(cards: GiftCard[]): GiftCard[][] {
return cards
.reduce(
(brands, c) => {
const brandCards = brands.find(b => b[0].name === c.name);
brandCards ? brandCards.push(c) : brands.push([c]);
return brands;
},
[] as GiftCard[][]
)
.reduce((brands, c) => {
const brandCards = brands.find(b => b[0].name === c.name);
brandCards ? brandCards.push(c) : brands.push([c]);
return brands;
}, [] as GiftCard[][])
.sort((a, b) => sortByDisplayName(a[0], b[0]));
}
}
Expand Down
7 changes: 3 additions & 4 deletions src/pages/send/confirm/confirm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ export class ConfirmPage {
private setWalletSelector(coin: string, network: string): Promise<any> {
if (
this.wallet &&
(this.wallet.network == network && this.wallet.coin == coin)
this.wallet.network == network &&
this.wallet.coin == coin
) {
return Promise.resolve();
}
Expand Down Expand Up @@ -597,9 +598,7 @@ export class ConfirmPage {
} else if (this.usingMerchantFee) {
const maxAllowedFee = feeRate * 5;
this.logger.info(
`Using Merchant Fee: ${
tx.feeRate
} vs. referent level (5 * feeRate) ${maxAllowedFee}`
`Using Merchant Fee: ${tx.feeRate} vs. referent level (5 * feeRate) ${maxAllowedFee}`
);
const isUtxo = this.currencyProvider.isUtxoCoin(wallet.coin);
if (
Expand Down
7 changes: 3 additions & 4 deletions src/pages/settings/about/about.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@ describe('AboutPage', () => {
expect(instance.translate.instant).toHaveBeenCalledWith(
'About {{appName}}'
);
expect(instance.replaceParametersProvider.replace).toHaveBeenCalledWith(
'testVal',
{ appName: 'testName' }
);
expect(
instance.replaceParametersProvider.replace
).toHaveBeenCalledWith('testVal', { appName: 'testName' });
expect(instance.title).toEqual('testTitle');
});
});
Expand Down
4 changes: 1 addition & 3 deletions src/pages/settings/alt-currency/alt-currency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,7 @@ export class AltCurrencyPage {

private showErrorAndRemoveAltCurrency(altCurrency): void {
const title = this.translate.instant('Error');
const msg = `${altCurrency.name} (${
altCurrency.isoCode
}) is no longer supported. Please select another alternative currency`;
const msg = `${altCurrency.name} (${altCurrency.isoCode}) is no longer supported. Please select another alternative currency`;
this.errorsProvider.showDefaultError(msg, title, () => {
this.lastUsedAltCurrencyList = _.reject(this.lastUsedAltCurrencyList, [
'isoCode',
Expand Down
3 changes: 2 additions & 1 deletion src/pipes/order-by.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export class OrderByPipe implements PipeTransform {
if (
isNaN(parseFloat(a)) ||
!isFinite(a) ||
(isNaN(parseFloat(b)) || !isFinite(b))
isNaN(parseFloat(b)) ||
!isFinite(b)
) {
// Isn't a number so lowercase the string to properly compare
if (a.toLowerCase() < b.toLowerCase()) return -1;
Expand Down
3 changes: 2 additions & 1 deletion src/providers/bitpay-card/bitpay-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ export class BitPayCardProvider {
if (
['paid', 'confirmed', 'complete'].indexOf(invoices[i].status) >=
0 ||
(invoices[i].status === 'invalid' || isInvoiceUnderpaid)
invoices[i].status === 'invalid' ||
isInvoiceUnderpaid
) {
activityList.unshift(
this._getMerchantInfo({
Expand Down
4 changes: 1 addition & 3 deletions src/providers/in-app-browser/card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -887,9 +887,7 @@ export class IABCardProvider {
this.logger.log('appleWallet - startAddPaymentPass - not available');
payload = {
...payload,
error: `ios version (${
this.device.version
}) does not support apple wallet`
error: `ios version (${this.device.version}) does not support apple wallet`
};
}

Expand Down
20 changes: 4 additions & 16 deletions src/providers/incoming-data/incoming-data.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -713,14 +713,8 @@ describe('Provider: Incoming Data Provider', () => {

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

let a = bwcProvider
.getBitcore()
.Address(oldAddr)
.toObject();
let addr = bwcProvider
.getBitcoreCash()
.Address.fromObject(a)
.toString();
let a = bwcProvider.getBitcore().Address(oldAddr).toObject();
let addr = bwcProvider.getBitcoreCash().Address.fromObject(a).toString();

let stateParams = {
toAddress: addr,
Expand Down Expand Up @@ -749,14 +743,8 @@ describe('Provider: Incoming Data Provider', () => {

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

let a = bwcProvider
.getBitcore()
.Address(oldAddr)
.toObject();
let addr = bwcProvider
.getBitcoreCash()
.Address.fromObject(a)
.toString();
let a = bwcProvider.getBitcore().Address(oldAddr).toObject();
let addr = bwcProvider.getBitcoreCash().Address.fromObject(a).toString();

let stateParams = {
toAddress: addr,
Expand Down
Loading

0 comments on commit 0a7b518

Please sign in to comment.