Skip to content

Commit f319f5f

Browse files
Prettier lint codebase
1 parent 27f9c61 commit f319f5f

File tree

11 files changed

+120
-125
lines changed

11 files changed

+120
-125
lines changed

src/components/containers/__tests__/Layout-test.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ import {connectLayoutToPlot} from '../../../lib';
88
import {mount} from 'enzyme';
99

1010
const Layouts = [Panel, Fold, Section].map(connectLayoutToPlot);
11-
const Editor = props => (
12-
<TestEditor {...{onUpdate: jest.fn(), ...props}} />
13-
);
11+
const Editor = props => <TestEditor {...{onUpdate: jest.fn(), ...props}} />;
1412

1513
Layouts.forEach(Layout => {
1614
describe(`<${Layout.displayName}>`, () => {

src/components/fields/derived.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import {
99

1010
export const CanvasSize = connectToContainer(UnconnectedNumeric, {
1111
modifyPlotProps: (props, context, plotProps) => {
12-
const {fullContainer} = plotProps;
13-
if (plotProps.isVisible && fullContainer && fullContainer.autosize) {
12+
const {fullContainer} = plotProps;
13+
if (plotProps.isVisible && fullContainer && fullContainer.autosize) {
1414
plotProps.isVisible = false;
1515
}
1616
},

src/components/sidebar/SidebarItem.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ export default class SidebarItem extends Component {
66
return (
77
<div
88
onClick={this.props.onClick}
9-
className={bem('sidebar-item', [
10-
this.props.active ? 'is-active' : '',
11-
])}
9+
className={bem('sidebar-item', [this.props.active ? 'is-active' : ''])}
1210
>
1311
{this.props.label}
1412
</div>

src/components/widgets/CheckboxGroup.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import React, { Component } from "react";
2-
import PropTypes from "prop-types";
3-
import classnames from "classnames";
1+
import React, {Component} from 'react';
2+
import PropTypes from 'prop-types';
3+
import classnames from 'classnames';
44

55
class CheckboxGroup extends Component {
66
constructor(props) {
77
super(props);
8-
this.state = { options: this.props.options };
8+
this.state = {options: this.props.options};
99
this.handleChange = this.handleChange.bind(this);
1010
}
1111

1212
componentWillReceiveProps(nextProps) {
13-
this.setState({ options: nextProps.options });
13+
this.setState({options: nextProps.options});
1414
}
1515

1616
handleChange(i) {
@@ -23,13 +23,13 @@ class CheckboxGroup extends Component {
2323

2424
renderOptions() {
2525
return this.state.options.map((option, i) => {
26-
const checkClass = classnames(["checkbox__check", "icon"], {
27-
"icon-check-mark": option.checked,
26+
const checkClass = classnames(['checkbox__check', 'icon'], {
27+
'icon-check-mark': option.checked,
2828
});
2929

30-
const itemClass = classnames("checkbox__item", {
31-
"checkbox__item--vertical": this.props.orientation === "vertical",
32-
"checkbox__item--horizontal": this.props.orientation === "horizontal",
30+
const itemClass = classnames('checkbox__item', {
31+
'checkbox__item--vertical': this.props.orientation === 'vertical',
32+
'checkbox__item--horizontal': this.props.orientation === 'horizontal',
3333
});
3434

3535
return (
@@ -44,8 +44,8 @@ class CheckboxGroup extends Component {
4444
}
4545

4646
render() {
47-
const boxClass = classnames("checkbox__group", this.props.className, {
48-
checkbox__group_horizontal: this.props.orientation === "horizontal",
47+
const boxClass = classnames('checkbox__group', this.props.className, {
48+
checkbox__group_horizontal: this.props.orientation === 'horizontal',
4949
});
5050

5151
return <div className={boxClass}>{this.renderOptions()}</div>;
@@ -66,7 +66,7 @@ CheckboxGroup.propTypes = {
6666
};
6767

6868
CheckboxGroup.defaultProps = {
69-
className: "",
69+
className: '',
7070
};
7171

7272
export default CheckboxGroup;

src/components/widgets/EditableText.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { Component } from "react";
2-
import PropTypes from "prop-types";
1+
import React, {Component} from 'react';
2+
import PropTypes from 'prop-types';
33

44
// A generic component to handle text that can be edited when the user
55
// clicks on it.
@@ -24,15 +24,15 @@ class EditableText extends Component {
2424
}
2525

2626
handleChange(event) {
27-
const { onChange } = this.props;
27+
const {onChange} = this.props;
2828

2929
if (onChange) {
3030
onChange(event.target.value);
3131
}
3232
}
3333

3434
handleUpdate(event) {
35-
const { onUpdate } = this.props;
35+
const {onUpdate} = this.props;
3636

3737
if (onUpdate) {
3838
onUpdate(event.target.value);
@@ -62,7 +62,7 @@ class EditableText extends Component {
6262
<input
6363
ref={this.getRef}
6464
type={type}
65-
className={className || ""}
65+
className={className || ''}
6666
value={text}
6767
onClick={this.handleClick}
6868
onChange={this.handleChange}
@@ -98,13 +98,13 @@ EditableText.propTypes = {
9898
disable: PropTypes.bool,
9999
autoFocus: PropTypes.bool,
100100
readOnly: PropTypes.bool,
101-
type: PropTypes.oneOf(["text", "password"]),
101+
type: PropTypes.oneOf(['text', 'password']),
102102
size: PropTypes.number,
103103
};
104104

105105
EditableText.defaultProps = {
106106
readOnly: false,
107-
type: "text",
107+
type: 'text',
108108
};
109109

110110
export default EditableText;

src/components/widgets/FlaglistCheckboxGroup.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React, { Component } from "react";
2-
import PropTypes from "prop-types";
3-
import CheckboxGroup from "./CheckboxGroup";
1+
import React, {Component} from 'react';
2+
import PropTypes from 'prop-types';
3+
import CheckboxGroup from './CheckboxGroup';
44

55
// Component handles activeOption with shape "x+y+z"
66
// and ties it to the CheckboxGroup Component
@@ -12,7 +12,7 @@ class FlaglistCheckboxGroup extends Component {
1212
if (props.activeOption !== null) {
1313
currentActiveOption = props.activeOption;
1414
} else {
15-
currentActiveOption = "";
15+
currentActiveOption = '';
1616
}
1717

1818
this.state = {
@@ -26,10 +26,10 @@ class FlaglistCheckboxGroup extends Component {
2626
// to a series of options separated by `+` that our component can handle
2727
parseFlags(option) {
2828
let activeOption;
29-
if (option === "all") {
30-
activeOption = this.props.options.map(o => o.value).join("+");
31-
} else if (option === "none") {
32-
activeOption = "";
29+
if (option === 'all') {
30+
activeOption = this.props.options.map(o => o.value).join('+');
31+
} else if (option === 'none') {
32+
activeOption = '';
3333
} else {
3434
activeOption = option;
3535
}
@@ -38,35 +38,35 @@ class FlaglistCheckboxGroup extends Component {
3838

3939
// Sync local state to parent props.
4040
componentWillReceiveProps(nextProps) {
41-
this.setState({ activeOption: this.parseFlags(nextProps.activeOption) });
41+
this.setState({activeOption: this.parseFlags(nextProps.activeOption)});
4242
}
4343

4444
// Called whenever a checkbox is changed, this updates the local
4545
// state to reflect the new activeOptions and then called props.onChange with
4646
// the new options.
4747
handleChange(newOptions) {
48-
let newActiveOptions = "";
48+
let newActiveOptions = '';
4949

5050
newOptions.map(option => {
5151
if (option.checked === true) {
52-
newActiveOptions += option.value + "+";
52+
newActiveOptions += option.value + '+';
5353
}
5454
});
5555

5656
newActiveOptions = newActiveOptions.slice(0, -1);
5757

5858
if (newActiveOptions.length === 0) {
59-
newActiveOptions = "none";
59+
newActiveOptions = 'none';
6060
}
6161

62-
this.setState({ activeOption: newActiveOptions });
62+
this.setState({activeOption: newActiveOptions});
6363
this.props.onChange(newActiveOptions);
6464
}
6565

6666
// Turns the activeOptions "e.g "x+y+z" into an array that
6767
// the CheckboxGroup component can handle
6868
renderCheckedOption() {
69-
const activeOptions = this.state.activeOption.split("+");
69+
const activeOptions = this.state.activeOption.split('+');
7070
const allOptions = this.props.options;
7171
let newOptions = [];
7272

0 commit comments

Comments
 (0)