Updated ESLINT and fixing linting issues

This commit is contained in:
Nicolas Gotchac 2016-11-25 19:48:06 +01:00
parent 8392090861
commit f77afd072b
23 changed files with 64 additions and 67 deletions

View File

@ -15,6 +15,7 @@
"no-debugger": "error",
"no-alert": "error",
"jsx-quotes": ["error", "prefer-single"],
"react/jsx-curly-spacing": ["error", "always"]
"react/jsx-curly-spacing": ["error", "always"],
"object-property-newline": 0
}
}

View File

@ -158,18 +158,18 @@ export default class Application extends Component {
{ Transaction.renderHeader() }
</thead>
<tbody>
{
transactions.map((tx, idx) => (
<Transaction
key={ tx.transaction.hash }
idx={ idx + 1 }
isLocal={ tx.isLocal }
transaction={ tx.transaction }
stats={ tx.stats }
blockNumber={ blockNumber }
/>
))
}
{
transactions.map((tx, idx) => (
<Transaction
key={ tx.transaction.hash }
idx={ idx + 1 }
isLocal={ tx.isLocal }
transaction={ tx.transaction }
stats={ tx.stats }
blockNumber={ blockNumber }
/>
))
}
</tbody>
</table>
);

View File

@ -83,7 +83,7 @@ class BaseTransaction extends Component {
return (
<span className={ styles.nowrap }>
{ noOfPropagations } ({ noOfPeers } peers)
{ noOfPropagations } ({ noOfPeers } peers)
</span>
);
}
@ -110,7 +110,7 @@ export class Transaction extends BaseTransaction {
static renderHeader () {
return (
<tr className={ styles.header }>
<th></th>
<th />
<th>
Transaction
</th>
@ -129,8 +129,7 @@ export class Transaction extends BaseTransaction {
<th>
# Propagated
</th>
<th>
</th>
<th />
</tr>
);
}
@ -201,7 +200,7 @@ export class LocalTransaction extends BaseTransaction {
static renderHeader () {
return (
<tr className={ styles.header }>
<th></th>
<th />
<th>
Transaction
</th>

View File

@ -73,7 +73,7 @@ export default class Import extends Component {
Provide the ABI (Contract Interface) in the space provided below. Only non-constant functions (names &amp; types) will be imported, while constant functions and existing signatures will be ignored.
</div>
<div className={ styles.info }>
<textarea rows='8' className={ styles.error } onChange={ this.onAbiEdit }></textarea>
<textarea rows='8' className={ styles.error } onChange={ this.onAbiEdit } />
<div className={ styles.error }>
{ abiError }
</div>

View File

@ -30,9 +30,9 @@ import './style.css';
ReactDOM.render(
(
<Provider store={ store }>
<Container />
</Provider>
<Provider store={ store }>
<Container />
</Provider>
),
document.querySelector('#container')
);

View File

@ -147,7 +147,7 @@ export const loadToken = (index) => (dispatch, getState) => {
dispatch(setTokenData(index, null));
dispatch(setTokenLoading(index, false));
if (!e instanceof TypeError) {
if (!(e instanceof TypeError)) {
console.error(`loadToken #${index} error`, e);
}
});

View File

@ -79,16 +79,16 @@ export default class LoadContract extends Component {
const contractsTab = Object.keys(contracts).length === 0
? null
: (
<Tab label='Local' >
{ this.renderEditor() }
<Tab label='Local' >
{ this.renderEditor() }
<SelectableList
onChange={ this.onClickContract }
>
<Subheader>Saved Contracts</Subheader>
{ this.renderContracts(contracts) }
</SelectableList>
</Tab>
<SelectableList
onChange={ this.onClickContract }
>
<Subheader>Saved Contracts</Subheader>
{ this.renderContracts(contracts) }
</SelectableList>
</Tab>
);
return (
@ -174,9 +174,9 @@ export default class LoadContract extends Component {
const secondaryText = description || `Saved ${moment(timestamp).fromNow()}`;
const remove = removable
? (
<IconButton onTouchTap={ onDelete }>
<DeleteIcon />
</IconButton>
<IconButton onTouchTap={ onDelete }>
<DeleteIcon />
</IconButton>
)
: null;

View File

@ -98,10 +98,10 @@ export default class PasswordManager extends Component {
const passwordHint = meta && meta.passwordHint
? (
<span className={ styles.passwordHint }>
<span className={ styles.hintLabel }>Hint </span>
{ meta.passwordHint }
</span>
<span className={ styles.passwordHint }>
<span className={ styles.hintLabel }>Hint </span>
{ meta.passwordHint }
</span>
)
: null;

View File

@ -137,7 +137,7 @@ export default class SMSVerification extends Component {
step,
fee, number, isNumberValid, isVerified, hasRequested,
requestTx, isCodeValid, confirmationTx,
setNumber, setConsentGiven, setCode
setCode
} = this.props.store;
switch (phase) {

View File

@ -38,9 +38,9 @@ export default class Title extends Component {
const byLine = typeof byline === 'string'
? (
<span title={ byline }>
{ byline }
</span>
<span title={ byline }>
{ byline }
</span>
)
: byline;

View File

@ -74,10 +74,10 @@ class Tooltip extends Component {
label='Next'
onTouchTap={ onNextTooltip } />
] : (
<FlatButton
icon={ <ActionDoneAll /> }
label='Done'
onTouchTap={ onCloseTooltips } />
<FlatButton
icon={ <ActionDoneAll /> }
label='Done'
onTouchTap={ onCloseTooltips } />
);
return (

View File

@ -92,7 +92,7 @@ class Accounts extends Component {
const loadings = ((accounts && Object.keys(accounts)) || []).map((_, idx) => (
<div key={ idx } className={ styles.loading }>
<div></div>
<div />
</div>
));

View File

@ -192,7 +192,7 @@ class TabBar extends Component {
return (
<ToolbarGroup>
<div className={ styles.last }>
<div></div>
<div />
</div>
</ToolbarGroup>
);
@ -206,7 +206,7 @@ class TabBar extends Component {
.map((view, index) => {
const body = (view.id === 'accounts')
? (
<Tooltip className={ styles.tabbarTooltip } text='navigate between the different parts and views of the application, switching between an account view, token view and distributed application view' />
<Tooltip className={ styles.tabbarTooltip } text='navigate between the different parts and views of the application, switching between an account view, token view and distributed application view' />
)
: null;

View File

@ -65,8 +65,7 @@ export default class Dapp extends Component {
name={ name }
sandbox='allow-forms allow-popups allow-same-origin allow-scripts'
scrolling='auto'
src={ src }>
</iframe>
src={ src } />
);
}
}

View File

@ -51,8 +51,7 @@ export default class AddDapps extends Component {
] }
visible
scroll>
<div className={ styles.warning }>
</div>
<div className={ styles.warning } />
{ this.renderList(store.sortedLocal, 'Applications locally available', 'All applications installed locally on the machine by the user for access by the Parity client.') }
{ this.renderList(store.sortedBuiltin, 'Applications bundled with Parity', 'Experimental applications developed by the Parity team to show off dapp capabilities, integration, experimental features and to control certain network-wide client behaviour.') }
{ this.renderList(store.sortedNetwork, 'Applications on the global network', 'These applications are not affiliated with Parity nor are they published by Parity. Each remain under the control of their respective authors. Please ensure that you understand the goals for each application before interacting.') }

View File

@ -80,7 +80,7 @@ export default class TransactionPendingForm extends Component {
onClick={ this.onToggleReject }
className={ styles.rejectToggle }
>
{ html }
{ html }
</a>
);
}

View File

@ -62,7 +62,7 @@ export default class Calls extends Component {
onClick={ this.clearHistory }
className={ styles.removeIcon }
>
<i className='icon-trash'></i>
<i className='icon-trash' />
</a>
);
}

View File

@ -140,7 +140,7 @@ export default class EditableValue extends Component {
title={ `Reset to ${this.props.defaultValue}` }
{ ...this._testInherit('reset') }
>
<i className='icon-anchor'></i>
<i className='icon-anchor' />
</a>
);
}
@ -154,7 +154,7 @@ export default class EditableValue extends Component {
onClick={ this.onSubmit }
{ ...this._testInherit('submit') }
>
<i className='icon-check'></i>
<i className='icon-check' />
</a>,
<a
key={ 'cancel' }
@ -162,7 +162,7 @@ export default class EditableValue extends Component {
onClick={ this.onCancel }
{ ...this._testInherit('cancel') }
>
<i className='icon-close'></i>
<i className='icon-close' />
</a>
];
}
@ -175,7 +175,7 @@ export default class EditableValue extends Component {
title='Edit'
{ ...this._testInherit('edit') }
>
<i className='icon-pencil'></i>
<i className='icon-pencil' />
</a>
);
}

View File

@ -53,7 +53,7 @@ export default class JsonEditor extends Component {
className={ `${styles.editor} ${errorClass}` }
value={ this.state.value }
/>
{ this.renderError() }
{ this.renderError() }
</div>
);
}

View File

@ -66,7 +66,7 @@ export default class RpcCalls extends Component {
</div>
</div>
</div>
<div style={ { clear: 'both' } }></div>
<div style={ { clear: 'both' } } />
<div className='dapp-container'>
<div className='row'>
<div className='col col-6 mobile-full'>

View File

@ -46,7 +46,7 @@ class RpcDocs extends Component {
</div>
</div>
</div>
<div style={ { clear: 'both' } }></div>
<div style={ { clear: 'both' } } />
<div className='dapp-container'>
<div className='row'>
<div className='col col-12'>

View File

@ -24,10 +24,10 @@ export default class RpcNav extends Component {
return (
<div className={ styles.nav }>
<Link to={ '/rpc/calls' } activeClassName={ styles.activeNav } { ...this._test('rpc-calls-link') }>
<i className='icon-call-out'></i>
<i className='icon-call-out' />
</Link>
<Link to={ '/rpc/docs' } activeClassName={ styles.activeNav } { ...this._test('rpc-docs-link') }>
<i className='icon-docs'></i>
<i className='icon-docs' />
</Link>
</div>
);

View File

@ -118,8 +118,7 @@ class WriteContract extends Component {
<span
className={ styles.slider }
onMouseDown={ this.handleStartResize }
>
</span>
/>
</div>
<div