aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-01-17 23:14:25 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-01-17 23:14:25 +0800
commitb4375d6f64fc0651c7ba347fcfe36e171fa261fc (patch)
tree1862b4a5ddbcb0c2a4870a9e86c9f6fc47e74bfe
parent9f47c72d31412d30471ab05dbb22780dd2f29036 (diff)
downloaddexon-sol-tools-b4375d6f64fc0651c7ba347fcfe36e171fa261fc.tar
dexon-sol-tools-b4375d6f64fc0651c7ba347fcfe36e171fa261fc.tar.gz
dexon-sol-tools-b4375d6f64fc0651c7ba347fcfe36e171fa261fc.tar.bz2
dexon-sol-tools-b4375d6f64fc0651c7ba347fcfe36e171fa261fc.tar.lz
dexon-sol-tools-b4375d6f64fc0651c7ba347fcfe36e171fa261fc.tar.xz
dexon-sol-tools-b4375d6f64fc0651c7ba347fcfe36e171fa261fc.tar.zst
dexon-sol-tools-b4375d6f64fc0651c7ba347fcfe36e171fa261fc.zip
Enable restrict-plus-operands and fix issues detected
-rw-r--r--packages/tslint-config/tslint.json1
-rw-r--r--packages/website/ts/components/eth_weth_conversion_button.tsx2
-rw-r--r--packages/website/ts/components/generate_order/generate_order_form.tsx2
-rw-r--r--packages/website/ts/components/inputs/allowance_toggle.tsx2
-rw-r--r--packages/website/ts/components/token_balances.tsx2
5 files changed, 5 insertions, 4 deletions
diff --git a/packages/tslint-config/tslint.json b/packages/tslint-config/tslint.json
index 486780de6..971588b08 100644
--- a/packages/tslint-config/tslint.json
+++ b/packages/tslint-config/tslint.json
@@ -60,6 +60,7 @@
"prefer-function-over-method": true,
"promise-function-async": true,
"quotemark": [true, "single", "avoid-escape", "jsx-double"],
+ "restrict-plus-operands": true,
"semicolon": [true, "always"],
"space-before-function-paren": [
true,
diff --git a/packages/website/ts/components/eth_weth_conversion_button.tsx b/packages/website/ts/components/eth_weth_conversion_button.tsx
index f2c505207..300e71f1f 100644
--- a/packages/website/ts/components/eth_weth_conversion_button.tsx
+++ b/packages/website/ts/components/eth_weth_conversion_button.tsx
@@ -105,7 +105,7 @@ export class EthWethConversionButton extends React.Component<
}
this.props.onConversionSuccessful();
} catch (err) {
- const errMsg = '' + err;
+ const errMsg = `${err}`;
if (_.includes(errMsg, BlockchainCallErrs.UserHasNoAssociatedAddresses)) {
this.props.dispatcher.updateShouldBlockchainErrDialogBeOpen(true);
} else if (!_.includes(errMsg, 'User denied transaction')) {
diff --git a/packages/website/ts/components/generate_order/generate_order_form.tsx b/packages/website/ts/components/generate_order/generate_order_form.tsx
index 3144fc3bd..3ae0d48a7 100644
--- a/packages/website/ts/components/generate_order/generate_order_form.tsx
+++ b/packages/website/ts/components/generate_order/generate_order_form.tsx
@@ -329,7 +329,7 @@ export class GenerateOrderForm extends React.Component<GenerateOrderFormProps, G
${validationResult.errors}`);
}
} catch (err) {
- const errMsg = '' + err;
+ const errMsg = `${err}`;
if (utils.didUserDenyWeb3Request(errMsg)) {
globalErrMsg = 'User denied sign request';
} else {
diff --git a/packages/website/ts/components/inputs/allowance_toggle.tsx b/packages/website/ts/components/inputs/allowance_toggle.tsx
index 1be441e17..da46db4f4 100644
--- a/packages/website/ts/components/inputs/allowance_toggle.tsx
+++ b/packages/website/ts/components/inputs/allowance_toggle.tsx
@@ -77,7 +77,7 @@ export class AllowanceToggle extends React.Component<AllowanceToggleProps, Allow
this.setState({
isSpinnerVisible: false,
});
- const errMsg = '' + err;
+ const errMsg = `${err}`;
if (_.includes(errMsg, 'User denied transaction')) {
return;
}
diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx
index 112b3fe60..5e7b4e9f6 100644
--- a/packages/website/ts/components/token_balances.tsx
+++ b/packages/website/ts/components/token_balances.tsx
@@ -514,7 +514,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
this.props.dispatcher.showFlashMessage(`Successfully minted ${amount.toString(10)} ${token.symbol}`);
return true;
} catch (err) {
- const errMsg = '' + err;
+ const errMsg = `${err}`;
if (_.includes(errMsg, BlockchainCallErrs.UserHasNoAssociatedAddresses)) {
this.props.dispatcher.updateShouldBlockchainErrDialogBeOpen(true);
return false;