Add more JSX style rules
Change-Id: Ib8ae6729da4cd0720e04299c7beb9695319ef859
This commit is contained in:
parent
e713b783fb
commit
a53216bc87
10
.eslintrc
10
.eslintrc
|
@ -103,6 +103,7 @@
|
|||
eol-last: 2
|
||||
id-length: [0, {min: 2, exceptions: ['$', '_', 'e']}]
|
||||
id-match: [2, '^([A-Za-z\d_$]+)$', {properties: true}]
|
||||
jsx-quotes: [2, prefer-single]
|
||||
key-spacing: [2, {beforeColon: false, afterColon: true}]
|
||||
linebreak-style: [2, unix]
|
||||
max-nested-callbacks: [0, 5]
|
||||
|
@ -146,15 +147,20 @@
|
|||
prefer-template: 0
|
||||
|
||||
# react
|
||||
react/jsx-boolean-value: [2, never]
|
||||
react/jsx-closing-bracket-location: [2, {nonEmpty: false, selfClosing: line-aligned}]
|
||||
react/jsx-curly-spacing: [2, never]
|
||||
react/jsx-indent-props: [2, 4]
|
||||
react/jsx-key: 2
|
||||
react/jsx-no-duplicate-props: 2
|
||||
react/jsx-no-literals: 0
|
||||
react/jsx-no-undef: 2
|
||||
react/jsx-quotes: [2, single, avoid-escape]
|
||||
react/jsx-uses-react: 2
|
||||
react/jsx-uses-vars: 2
|
||||
react/no-unknown-property: 2
|
||||
react/prop-types: 0
|
||||
react/self-closing-comp: 0
|
||||
react/react-in-jsx-scope: 2
|
||||
react/self-closing-comp: 2
|
||||
react/sort-comp: 0
|
||||
env:
|
||||
browser: true
|
||||
|
|
|
@ -1989,8 +1989,8 @@
|
|||
}
|
||||
},
|
||||
"eslint-plugin-react": {
|
||||
"version": "3.1.0",
|
||||
"from": "eslint-plugin-react@3.1.0"
|
||||
"version": "3.9.0",
|
||||
"from": "eslint-plugin-react@3.9.0"
|
||||
},
|
||||
"exports-loader": {
|
||||
"version": "0.6.2",
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
"chai": "~3.2.0",
|
||||
"es5-shim": "4.1.11",
|
||||
"eslint": "1.7.3",
|
||||
"eslint-plugin-react": "3.1.0",
|
||||
"eslint-plugin-react": "3.9.0",
|
||||
"glob": "~5.0.5",
|
||||
"gulp-eslint": "1.0.0",
|
||||
"gulp-lintspaces": "0.3.2",
|
||||
|
|
|
@ -84,19 +84,22 @@ function(_, i18n, React, models, componentMixins, controls) {
|
|||
head={[{label: i18n('capacity_page.env_name'), className: headClassName},
|
||||
{label: i18n('capacity_page.node_count')}]}
|
||||
body={_.map(capacityReport.environment_stats, _.values)}
|
||||
tableClassName={tableClassName} />
|
||||
tableClassName={tableClassName}
|
||||
/>
|
||||
<controls.Table
|
||||
head={[{label: i18n('capacity_page.total_number_alloc_nodes'), className: headClassName},
|
||||
{label: i18n('capacity_page.total_number_unalloc_nodes')}]}
|
||||
body={[[capacityReport.allocation_stats.allocated,
|
||||
capacityReport.allocation_stats.unallocated]]}
|
||||
tableClassName={tableClassName} />
|
||||
tableClassName={tableClassName}
|
||||
/>
|
||||
<controls.Table
|
||||
head={[{label: i18n('capacity_page.node_role'), className: headClassName},
|
||||
{label: i18n('capacity_page.nodes_with_config')}]}
|
||||
body={_.zip(_.keys(capacityReport.roles_stat),
|
||||
_.values(capacityReport.roles_stat))}
|
||||
tableClassName={tableClassName} />
|
||||
tableClassName={tableClassName}
|
||||
/>
|
||||
<a href='/api/capacity/csv' target='_blank' className='btn btn-info'>
|
||||
<i className='glyphicon glyphicon-download-alt' />{' '}
|
||||
{i18n('capacity_page.download_report')}
|
||||
|
|
|
@ -308,7 +308,8 @@ function($, _, i18n, Backbone, React, utils, models, dispatcher, componentMixins
|
|||
selectNodes={this.selectNodes}
|
||||
changeLogSelection={this.changeLogSelection}
|
||||
{...this.state}
|
||||
{...this.props.tabData} />
|
||||
{...this.props.tabData}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -576,7 +576,7 @@ function(_, i18n, $, React, utils, models, dispatcher, dialogs, componentMixins,
|
|||
/>,
|
||||
!_.isEmpty(alerts.warning) &&
|
||||
[
|
||||
<p>{i18n(namespace + 'note_recommendations')}</p>,
|
||||
<p key='recommendations'>{i18n(namespace + 'note_recommendations')}</p>,
|
||||
<WarningsBlock
|
||||
key='warning'
|
||||
cluster={cluster}
|
||||
|
|
|
@ -698,16 +698,28 @@ function($, _, i18n, Backbone, React, models, dispatcher, utils, dialogs, compon
|
|||
return (
|
||||
<div className='well clearfix'>
|
||||
<div className='btn-group pull-right'>
|
||||
<button key='verify_networks' className='btn btn-default verify-networks-btn' onClick={this.verifyNetworks}
|
||||
disabled={isVerificationDisabled}>
|
||||
<button
|
||||
key='verify_networks'
|
||||
className='btn btn-default verify-networks-btn'
|
||||
onClick={this.verifyNetworks}
|
||||
disabled={isVerificationDisabled}
|
||||
>
|
||||
{i18n('cluster_page.network_tab.verify_networks_button')}
|
||||
</button>
|
||||
<button key='revert_changes' className='btn btn-default btn-revert-changes' onClick={this.revertChanges}
|
||||
disabled={isCancelChangesDisabled}>
|
||||
<button
|
||||
key='revert_changes'
|
||||
className='btn btn-default btn-revert-changes'
|
||||
onClick={this.revertChanges}
|
||||
disabled={isCancelChangesDisabled}
|
||||
>
|
||||
{i18n('common.cancel_changes_button')}
|
||||
</button>
|
||||
<button key='apply_changes' className='btn btn-success apply-btn' onClick={this.applyChanges}
|
||||
disabled={!this.isSavingPossible()}>
|
||||
<button
|
||||
key='apply_changes'
|
||||
className='btn btn-success apply-btn'
|
||||
onClick={this.applyChanges}
|
||||
disabled={!this.isSavingPossible()}
|
||||
>
|
||||
{i18n('common.save_settings_button')}
|
||||
</button>
|
||||
</div>
|
||||
|
@ -1351,6 +1363,7 @@ function($, _, i18n, Backbone, React, models, dispatcher, utils, dialogs, compon
|
|||
{networks.findWhere({name: 'baremetal'}) &&
|
||||
[
|
||||
<Range
|
||||
key='baremetal_range'
|
||||
{...this.composeProps('baremetal_range', true)}
|
||||
extendable={false}
|
||||
hiddenControls
|
||||
|
|
|
@ -980,11 +980,13 @@ function($, _, i18n, Backbone, React, utils, models, dispatcher, controls, dialo
|
|||
onClick={mode != this.props.viewMode && _.partial(this.props.changeViewMode, 'view_mode', mode)}
|
||||
>
|
||||
<input type='radio' name='view_mode' value={mode} />
|
||||
<i className={utils.classNames({
|
||||
glyphicon: true,
|
||||
'glyphicon-th-list': mode == 'standard',
|
||||
'glyphicon-th': mode == 'compact'
|
||||
})} />
|
||||
<i
|
||||
className={utils.classNames({
|
||||
glyphicon: true,
|
||||
'glyphicon-th-list': mode == 'standard',
|
||||
'glyphicon-th': mode == 'compact'
|
||||
})}
|
||||
/>
|
||||
</label>
|
||||
</controls.Tooltip>
|
||||
);
|
||||
|
@ -1170,7 +1172,7 @@ function($, _, i18n, Backbone, React, utils, models, dispatcher, controls, dialo
|
|||
label={i18n(ns + 'more')}
|
||||
options={inactiveSorters}
|
||||
onChange={this.props.addSorting}
|
||||
dynamicValues={true}
|
||||
dynamicValues
|
||||
isOpen= {this.state.isMoreSorterControlVisible}
|
||||
toggle={this.toggleMoreSorterControl}
|
||||
/>
|
||||
|
@ -1213,7 +1215,7 @@ function($, _, i18n, Backbone, React, utils, models, dispatcher, controls, dialo
|
|||
label={i18n(ns + 'more')}
|
||||
options={inactiveFilters}
|
||||
onChange={this.addFilter}
|
||||
dynamicValues={true}
|
||||
dynamicValues
|
||||
isOpen={this.state.isMoreFilterControlVisible}
|
||||
toggle={this.toggleMoreFilterControl}
|
||||
/>
|
||||
|
@ -1626,7 +1628,8 @@ function($, _, i18n, Backbone, React, utils, models, dispatcher, controls, dialo
|
|||
}
|
||||
label={i18n('common.select_all')}
|
||||
wrapperClassName='select-all pull-right'
|
||||
onChange={_.bind(this.props.selectNodes, this.props, _.pluck(this.props.nodes, 'id'))} />
|
||||
onChange={_.bind(this.props.selectNodes, this.props, _.pluck(this.props.nodes, 'id'))}
|
||||
/>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -142,10 +142,11 @@ define(['i18n', 'jquery', 'underscore', 'react', 'utils', 'component_mixins'],
|
|||
value={this.state.fileName && '[' + utils.showSize(this.state.content.length) + '] ' + this.state.fileName}
|
||||
onClick={this.pickFile}
|
||||
disabled={this.props.disabled}
|
||||
readOnly />
|
||||
<div className='input-group-addon' onClick={this.state.fileName ? this.removeFile : this.pickFile}>
|
||||
<i className={this.state.fileName && !this.props.disabled ? 'glyphicon glyphicon-remove' : 'glyphicon glyphicon-file'} />
|
||||
</div>
|
||||
readOnly
|
||||
/>
|
||||
<div className='input-group-addon' onClick={this.state.fileName ? this.removeFile : this.pickFile}>
|
||||
<i className={this.state.fileName && !this.props.disabled ? 'glyphicon glyphicon-remove' : 'glyphicon glyphicon-file'} />
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
{this.props.toggleable &&
|
||||
|
|
Loading…
Reference in New Issue