Skip to content

Commit

Permalink
fix(lint): Fix easy lint errors
Browse files Browse the repository at this point in the history
Disable some which we do not have resources to fix atm.
  • Loading branch information
scottwittenburg committed May 13, 2019
1 parent 3811668 commit 94a41a3
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 13 deletions.
10 changes: 10 additions & 0 deletions .eslintrc.js
Expand Up @@ -39,6 +39,16 @@ module.exports = {
'no-nested-ternary': 0,
'react/forbid-prop-types': 0,
'react/no-array-index-key': 0,

// When updating to kw-web-suite 8.0.0, we have more lint issues
// and no time to fix
'react/destructuring-assignment': 0,
'react/no-access-state-in-setstate': 0,
'react/jsx-one-expression-per-line': 0, // creates a conflict with prettier
'jsx-a11y/label-has-associated-control': 0,
'no-else-return': 0,
'import/no-cycle': 0,
'react/jsx-wrap-multilines': 0,
},
plugins: [
'prettier'
Expand Down
8 changes: 3 additions & 5 deletions src/React/CollapsibleControls/FloatImageControl/index.js
Expand Up @@ -89,11 +89,9 @@ export default class FloatImageControl extends React.Component {
return (
<div className={style.container}>
<CollapsibleWidget title="Scene">
{floatImageModel
.getLayers()
.map((item, idx) => (
<LayerItem key={idx} item={item} model={floatImageModel} />
))}
{floatImageModel.getLayers().map((item, idx) => (
<LayerItem key={idx} item={item} model={floatImageModel} />
))}
<div className={style.item}>
<div className={style.label}>Light</div>
<div className={style.actions}>
Expand Down
2 changes: 1 addition & 1 deletion src/React/Properties/CollapsiblePropertyGroup/index.js
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';

import style from 'PVWStyle/ReactProperties/CollapsiblePropertyGroup.mcss';
import factory from '../../Properties/PropertyFactory';
import factory from '../PropertyFactory';

export default function render(props) {
const isCollapsed = !props.prop.data.value[0];
Expand Down
2 changes: 1 addition & 1 deletion src/React/Properties/PropertyGroup/index.js
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';

import style from 'PVWStyle/ReactProperties/PropertyGroup.mcss';
import factory from '../../Properties/PropertyFactory';
import factory from '../PropertyFactory';

export default function render(props) {
return (
Expand Down
12 changes: 10 additions & 2 deletions src/React/Renderers/ImageRenderer/index.js
Expand Up @@ -611,10 +611,18 @@ export default class ImageRenderer extends React.Component {
</div>
</div>
<div className={style.buttons}>
<button className={style.button} onClick={this.toggleDialog}>
<button
className={style.button}
type="button"
onClick={this.toggleDialog}
>
Cancel
</button>
<button className={style.button} onClick={this.updateMetadata}>
<button
className={style.button}
type="button"
onClick={this.updateMetadata}
>
Save
</button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/React/Viewers/AbstractViewerMenu/example/index.js
Expand Up @@ -48,7 +48,7 @@ ReactDOM.render(
You can put HTML or a React component here, a{' '}
<em>QueryDataModelWidget</em> for example goes well here.
</p>,
<button key="c" onClick={() => alert('button pressed')}>
<button type="button" key="c" onClick={() => alert('button pressed')}>
Press me
</button>,
]
Expand Down
1 change: 1 addition & 0 deletions src/React/Widgets/ButtonSelectorWidget/index.js
Expand Up @@ -32,6 +32,7 @@ export default class ButtonSelectorWidget extends React.Component {
this.props.list.forEach((item) => {
list.push(
<button
type="button"
className={style.button}
key={item.name}
name={item.name}
Expand Down
2 changes: 2 additions & 0 deletions src/React/Widgets/EditableListWidget/index.js
Expand Up @@ -173,6 +173,7 @@ class EditableList extends React.PureComponent {
<div className={style.rowContent}>{cells}</div>
<div className={style.remove}>
<button
type="button"
className={style.icon}
onClick={() => this.props.onDelete(item.key)}
>
Expand Down Expand Up @@ -218,6 +219,7 @@ class EditableList extends React.PureComponent {
</div>
<div className={style.row}>
<button
type="button"
className={style.addButton}
onClick={() => this.props.onAdd(rows.length)}
>
Expand Down
1 change: 1 addition & 0 deletions src/React/Widgets/InlineToggleButtonWidget/index.js
Expand Up @@ -63,6 +63,7 @@ export default class InlineToggleButtonWidget extends React.Component {
if (obj.label) {
return (
<button
type="button"
style={{ lineHeight, fontSize, background }}
key={idx}
onClick={this.activateButton}
Expand Down
2 changes: 1 addition & 1 deletion src/React/Widgets/LookupTableWidget/index.js
Expand Up @@ -398,7 +398,7 @@ export default class LookupTableWidget extends React.Component {
className={style.previousButton}
/>
<div className={style.label}>
{this.state.currentControlPointIndex + 1} /{' '}
{this.state.currentControlPointIndex + 1}/{' '}
{this.props.lookupTable.getNumberOfControlPoints()}
</div>
<i onClick={this.nextControlPoint} className={style.nextButton} />
Expand Down
1 change: 1 addition & 0 deletions src/React/Widgets/OverlayTitleBar/index.js
Expand Up @@ -8,6 +8,7 @@ export default function overlayTitleBar(props) {
<div>
<span className={style.overlayTitle}>{props.title}</span>
<button
type="button"
className={style.closeControlBtn}
name={props.name}
onClick={props.onClose}
Expand Down
2 changes: 1 addition & 1 deletion src/React/Widgets/ScatterPlotCameraControl/index.js
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';

import style from 'PVWStyle/ReactWidgets/ScatterPlotCameraControl.mcss';
import InlineToggleButtonWidget from '../../Widgets/InlineToggleButtonWidget';
import InlineToggleButtonWidget from '../InlineToggleButtonWidget';

const SELECTED_COLOR = '#cdcdcd';
const DEFAULT_COLOR = '#fff';
Expand Down
3 changes: 2 additions & 1 deletion src/React/Widgets/SelectionEditorWidget/range/index.js
Expand Up @@ -103,12 +103,13 @@ render.propTypes = {
selection: PropTypes.object,
// ranges: PropTypes.object,
onChange: PropTypes.func,
// getLegend: PropTypes.func,
getLegend: PropTypes.func,
className: PropTypes.string,
};

render.defaultProps = {
selection: undefined,
className: undefined,
onChange: undefined,
getLegend: undefined,
};
2 changes: 2 additions & 0 deletions src/React/Widgets/index.js
Expand Up @@ -13,6 +13,7 @@ import Coordinate2DWidget from './Coordinate2DWidget';
import CountToolbar from './CountToolbar';
import DoubleSliderWidget from './DoubleSliderWidget';
import DropDownWidget from './DropDownWidget';
import EditableListWidget from './EditableListWidget';
import EqualizerWidget from './EqualizerWidget';
import FileBrowserWidget from './FileBrowserWidget';
import GitTreeWidget from './GitTreeWidget';
Expand Down Expand Up @@ -55,6 +56,7 @@ export default {
CountToolbar,
DoubleSliderWidget,
DropDownWidget,
EditableListWidget,
EqualizerWidget,
FileBrowserWidget,
GitTreeWidget,
Expand Down
4 changes: 4 additions & 0 deletions src/Rendering/Chart/Histogram2DPlotlyChartBuilder/index.js
Expand Up @@ -105,6 +105,7 @@ export default class Histogram2DPlotlyChartBuilder {
getHistogram() {
return this.histogram;
}

getScatter() {
return this.scatter;
}
Expand All @@ -123,6 +124,7 @@ export default class Histogram2DPlotlyChartBuilder {
this.histogram = histogram;
this.buildChart();
}

setScatter(scatter) {
// we need a new plot if the axes change, as opposed to just the data.
if (
Expand All @@ -137,6 +139,7 @@ export default class Histogram2DPlotlyChartBuilder {
this.scatter = scatter;
this.buildChart();
}

setPlot(plot) {
this.chartState.forceNewPlot = true;
this.plot = plot;
Expand Down Expand Up @@ -177,6 +180,7 @@ export default class Histogram2DPlotlyChartBuilder {
getChartType() {
return this.chartState.chartType;
}

getDataType() {
return chartFactory[this.chartState.chartType].data;
}
Expand Down

0 comments on commit 94a41a3

Please sign in to comment.