Enable restrict-plus-operands and fix issues detected

This commit is contained in:
Leonid Logvinov 2018-01-17 16:14:25 +01:00
parent 9f47c72d31
commit b4375d6f64
No known key found for this signature in database
GPG Key ID: 0DD294BFDE8C95D4
5 changed files with 5 additions and 4 deletions

View File

@ -60,6 +60,7 @@
"prefer-function-over-method": true, "prefer-function-over-method": true,
"promise-function-async": true, "promise-function-async": true,
"quotemark": [true, "single", "avoid-escape", "jsx-double"], "quotemark": [true, "single", "avoid-escape", "jsx-double"],
"restrict-plus-operands": true,
"semicolon": [true, "always"], "semicolon": [true, "always"],
"space-before-function-paren": [ "space-before-function-paren": [
true, true,

View File

@ -105,7 +105,7 @@ export class EthWethConversionButton extends React.Component<
} }
this.props.onConversionSuccessful(); this.props.onConversionSuccessful();
} catch (err) { } catch (err) {
const errMsg = '' + err; const errMsg = `${err}`;
if (_.includes(errMsg, BlockchainCallErrs.UserHasNoAssociatedAddresses)) { if (_.includes(errMsg, BlockchainCallErrs.UserHasNoAssociatedAddresses)) {
this.props.dispatcher.updateShouldBlockchainErrDialogBeOpen(true); this.props.dispatcher.updateShouldBlockchainErrDialogBeOpen(true);
} else if (!_.includes(errMsg, 'User denied transaction')) { } else if (!_.includes(errMsg, 'User denied transaction')) {

View File

@ -329,7 +329,7 @@ export class GenerateOrderForm extends React.Component<GenerateOrderFormProps, G
${validationResult.errors}`); ${validationResult.errors}`);
} }
} catch (err) { } catch (err) {
const errMsg = '' + err; const errMsg = `${err}`;
if (utils.didUserDenyWeb3Request(errMsg)) { if (utils.didUserDenyWeb3Request(errMsg)) {
globalErrMsg = 'User denied sign request'; globalErrMsg = 'User denied sign request';
} else { } else {

View File

@ -77,7 +77,7 @@ export class AllowanceToggle extends React.Component<AllowanceToggleProps, Allow
this.setState({ this.setState({
isSpinnerVisible: false, isSpinnerVisible: false,
}); });
const errMsg = '' + err; const errMsg = `${err}`;
if (_.includes(errMsg, 'User denied transaction')) { if (_.includes(errMsg, 'User denied transaction')) {
return; return;
} }

View File

@ -514,7 +514,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
this.props.dispatcher.showFlashMessage(`Successfully minted ${amount.toString(10)} ${token.symbol}`); this.props.dispatcher.showFlashMessage(`Successfully minted ${amount.toString(10)} ${token.symbol}`);
return true; return true;
} catch (err) { } catch (err) {
const errMsg = '' + err; const errMsg = `${err}`;
if (_.includes(errMsg, BlockchainCallErrs.UserHasNoAssociatedAddresses)) { if (_.includes(errMsg, BlockchainCallErrs.UserHasNoAssociatedAddresses)) {
this.props.dispatcher.updateShouldBlockchainErrDialogBeOpen(true); this.props.dispatcher.updateShouldBlockchainErrDialogBeOpen(true);
return false; return false;