diff options
author | Fabio Berger <me@fabioberger.com> | 2018-05-23 00:04:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-23 00:04:50 +0800 |
commit | cc840a6911850856c3254f7ac73cd70c527e1a5c (patch) | |
tree | c7435ac7ce09541a67f0106a85f391dc48921e10 /packages/website | |
parent | a26cc7c14d4e59102d5f84d534f75c42b8683cad (diff) | |
parent | c4a2f700172e8be367225d90a1c51cef8cf0d7dd (diff) | |
download | dexon-0x-contracts-cc840a6911850856c3254f7ac73cd70c527e1a5c.tar.gz dexon-0x-contracts-cc840a6911850856c3254f7ac73cd70c527e1a5c.tar.zst dexon-0x-contracts-cc840a6911850856c3254f7ac73cd70c527e1a5c.zip |
Merge pull request #594 from 0xProject/improvement/addCustomTslintRules
Add more tslint rules
Diffstat (limited to 'packages/website')
-rw-r--r-- | packages/website/ts/components/generate_order/new_token_form.tsx | 8 | ||||
-rw-r--r-- | packages/website/ts/components/relayer_index/relayer_index.tsx | 4 | ||||
-rw-r--r-- | packages/website/tslint.json | 3 |
3 files changed, 8 insertions, 7 deletions
diff --git a/packages/website/ts/components/generate_order/new_token_form.tsx b/packages/website/ts/components/generate_order/new_token_form.tsx index 10f71b430..a9b8e9589 100644 --- a/packages/website/ts/components/generate_order/new_token_form.tsx +++ b/packages/website/ts/components/generate_order/new_token_form.tsx @@ -157,14 +157,14 @@ export class NewTokenForm extends React.Component<NewTokenFormProps, NewTokenFor const maxLength = 30; const tokens = _.values(this.props.tokenByAddress); const tokenWithNameIfExists = _.find(tokens, { name }); - const tokenWithNameExists = !_.isUndefined(tokenWithNameIfExists); + const doesTokenWithNameExists = !_.isUndefined(tokenWithNameIfExists); if (name === '') { nameErrText = 'Name is required'; } else if (!this._isValidName(name)) { nameErrText = 'Name should only contain letters, digits and spaces'; } else if (name.length > maxLength) { nameErrText = `Max length is ${maxLength}`; - } else if (tokenWithNameExists) { + } else if (doesTokenWithNameExists) { nameErrText = 'Token with this name already exists'; } @@ -177,14 +177,14 @@ export class NewTokenForm extends React.Component<NewTokenFormProps, NewTokenFor let symbolErrText = ''; const maxLength = 5; const tokens = _.values(this.props.tokenByAddress); - const tokenWithSymbolExists = !_.isUndefined(_.find(tokens, { symbol })); + const doesTokenWithSymbolExists = !_.isUndefined(_.find(tokens, { symbol })); if (symbol === '') { symbolErrText = 'Symbol is required'; } else if (!this._isAlphanumeric(symbol)) { symbolErrText = 'Can only include alphanumeric characters'; } else if (symbol.length > maxLength) { symbolErrText = `Max length is ${maxLength}`; - } else if (tokenWithSymbolExists) { + } else if (doesTokenWithSymbolExists) { symbolErrText = 'Token with symbol already exists'; } diff --git a/packages/website/ts/components/relayer_index/relayer_index.tsx b/packages/website/ts/components/relayer_index/relayer_index.tsx index d4fd6aeaf..675e83c9f 100644 --- a/packages/website/ts/components/relayer_index/relayer_index.tsx +++ b/packages/website/ts/components/relayer_index/relayer_index.tsx @@ -56,8 +56,8 @@ export class RelayerIndex extends React.Component<RelayerIndexProps, RelayerInde this._isUnmounted = true; } public render(): React.ReactNode { - const readyToRender = _.isUndefined(this.state.error) && !_.isUndefined(this.state.relayerInfos); - if (!readyToRender) { + const isReadyToRender = _.isUndefined(this.state.error) && !_.isUndefined(this.state.relayerInfos); + if (!isReadyToRender) { return ( <div className="col col-12" style={{ ...styles.root, height: '100%' }}> <div diff --git a/packages/website/tslint.json b/packages/website/tslint.json index d6a5f5031..b55ffe90f 100644 --- a/packages/website/tslint.json +++ b/packages/website/tslint.json @@ -4,6 +4,7 @@ "no-implicit-dependencies": false, "no-object-literal-type-assertion": false, "completed-docs": false, - "prefer-function-over-method": false + "prefer-function-over-method": false, + "custom-no-magic-numbers": false } } |