Skip to content

Commit 0bcb74f

Browse files
committed
De-lint JS sources
1 parent 866fbec commit 0bcb74f

File tree

8 files changed

+46
-32
lines changed

8 files changed

+46
-32
lines changed

.eslintrc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,4 @@ rules:
6969
jsx-a11y/label-has-associated-control: 1
7070
jsx-a11y/control-has-associated-label: 0
7171
arrow-parens: [2, "always"]
72+
react/jsx-props-no-spreading: 1

static/js/components/FoldableRow.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
* The second element can be, e.g., another row in the table.
99
* */
1010

11-
import React, { Component, PropTypes } from 'react';
11+
import React, { Component } from 'react';
12+
import PropTypes from 'prop-types';
1213
import colorScheme from './colorscheme';
1314

1415
const cs = colorScheme;

static/js/components/Form.jsx

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,12 @@ export const TextInput = (props) => {
9292

9393
return (
9494
<div className="form-group" style={textInputStyle}>
95-
{props.label &&
96-
<label>
97-
{props.label}
98-
</label>
95+
{
96+
props.label && (
97+
<label>
98+
{props.label}
99+
</label>
100+
)
99101
}
100102
<input
101103
className="form-control"
@@ -125,10 +127,12 @@ export const TextareaInput = (props) => {
125127

126128
return (
127129
<div className="form-group" style={textareaInputStyle}>
128-
{props.label &&
129-
<label>
130-
{props.label}
131-
</label>
130+
{
131+
props.label && (
132+
<label>
133+
{props.label}
134+
</label>
135+
)
132136
}
133137
<textarea
134138
className="form-control"
@@ -181,23 +185,25 @@ export const SelectInput = (props) => {
181185

182186
return (
183187
<div className="form-group" style={selectInputStyle}>
184-
{props.label &&
185-
<label>
186-
{props.label}
187-
</label>
188+
{
189+
props.label && (
190+
<label>
191+
{props.label}
192+
</label>
193+
)
188194
}
189195
<select
190196
className="form-control"
191197
{...selectProps}
192198
>
193-
{props.options.map((option, idx) => (
194-
<option
195-
value={option.id}
196-
key={option.id}
197-
>
198-
{option.label}
199-
</option>
200-
))
199+
{
200+
props.options.map((option, idx) => (
201+
<option value={option.id} key={option.id}>
202+
{
203+
option.label
204+
}
205+
</option>
206+
))
201207
}
202208
</select>
203209
<Error {...props} />
@@ -260,10 +266,12 @@ export const FileInput = (props) => {
260266

261267
return (
262268
<div className="form-group" style={fileInputStyle}>
263-
{props.label &&
264-
<label>
265-
{props.label}
266-
</label>
269+
{
270+
props.label && (
271+
<label>
272+
{props.label}
273+
</label>
274+
)
267275
}
268276
<input type="file" {...inputProps} />
269277
<Error {...props} />

static/js/components/Plot.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { Component } from 'react';
2+
import PropTypes from 'prop-types';
23
import { connect } from 'react-redux';
34
import { showNotification } from 'baselayer/components/Notifications';
45
/* eslint-disable */
@@ -75,8 +76,8 @@ class Plot extends Component {
7576
}
7677
}
7778
Plot.propTypes = {
78-
url: React.PropTypes.string.isRequired,
79-
dispatch: React.PropTypes.func.isRequired
79+
url: PropTypes.string.isRequired,
80+
dispatch: PropTypes.func.isRequired
8081
};
8182

8283
Plot = connect()(Plot);

static/js/components/Progress.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
import PropTypes from 'prop-types';
23

34
const Progress = (props) => {
45
let response = '';
@@ -27,7 +28,7 @@ const Progress = (props) => {
2728
};
2829

2930
Progress.propTypes = {
30-
type: React.PropTypes.string.isRequired
31+
type: PropTypes.string.isRequired
3132
};
3233

3334
export default Progress;

static/js/components/Projects.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, { PropTypes } from 'react';
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
23
import { connect } from 'react-redux';
34
import { reduxForm } from 'redux-form';
45

static/js/components/UserProfile.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
import PropTypes from 'prop-types';
23
import { connect } from 'react-redux';
34

45
let UserProfile = (props) => (
@@ -7,8 +8,8 @@ let UserProfile = (props) => (
78
</div>
89
);
910
UserProfile.propTypes = {
10-
style: React.PropTypes.object.isRequired,
11-
profile: React.PropTypes.object.isRequired
11+
style: PropTypes.object.isRequired,
12+
profile: PropTypes.object.isRequired
1213
};
1314

1415
const mapStateToProps = (state) => (

static/js/reducers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ const myFormReducer = (theirFormReducer) => (
127127
const field_names = Object.keys(state.featurize).filter(
128128
(field_name) => contains(action.payload.ctgy_list, field_name)
129129
);
130-
const featurizeFormState = Object.assign({}, state.featurize);
130+
const featurizeFormState = { ...state.featurize };
131131
const allAreChecked = (field_names.filter(
132132
(el) => !featurizeFormState[el].value
133133
).length === 0);

0 commit comments

Comments
 (0)