Skip to content

Commit 3d2a0b5

Browse files
committed
lint fixes
1 parent 34d46e3 commit 3d2a0b5

19 files changed

+292
-296
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/*.test.js

.eslintrc

+6-5
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,16 @@
2222
],
2323
"rules": {
2424
"semi": [2, "always"],
25-
"indent": ["error", 2],
25+
"indent": ["error", "tab", { "SwitchCase": 1 }],
2626
"object-curly-spacing": ["error", "always"],
27-
"no-extra-parens": "error",
28-
"max-len": ["error", { "code": 100 }],
29-
"no-multi-spaces": "error"
27+
"no-extra-parens": ["off"],
28+
"max-len": ["off"],
29+
"no-multi-spaces": "error",
30+
"react/prop-types": ["off"]
3031
},
3132
"settings": {
3233
"react": {
33-
"version": "16.3"
34+
"version": "16.8"
3435
}
3536
}
3637
}

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@
7575
"jest": {
7676
"roots": [
7777
"src/react"
78+
],
79+
"testPathIgnorePatterns": [
80+
"*.test.js"
7881
]
7982
},
8083
"author": "Ben Keen <[email protected]>",

src/react/components/Dropdown.js

+31-33
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,38 @@ import Select from 'react-select';
33

44
const getSelected = (data, selected) => data.find((item) => item.value === selected);
55

6-
const Dropdown = ({ data, selected, onChange }) => {
7-
return (
8-
<Select
9-
options={data}
10-
defaultValue={getSelected(data, selected)}
11-
onChange={onChange}
12-
styles={{
13-
control: (provided, state) => {
14-
return {
15-
...provided,
16-
borderColor: state.isFocused ? '#89b290' : 'hsl(0,0%,80%)',
17-
boxShadow: 'none',
18-
'&:hover': {
19-
borderColor: state.isFocused ? '#89b290' : '#dddddd',
20-
}
21-
};
22-
},
23-
option: (provided, state) => {
24-
const newState = {
25-
...provided,
26-
'&:active': {
27-
backgroundColor: '#87c192'
28-
}
29-
};
30-
if (state.isSelected) {
31-
newState.backgroundColor = '#87c192';
32-
} else if (state.isFocused) {
33-
newState.backgroundColor = '#c9e5cf';
6+
const Dropdown = ({ data, selected, onChange }) => (
7+
<Select
8+
options={data}
9+
defaultValue={getSelected(data, selected)}
10+
onChange={onChange}
11+
styles={{
12+
control: (provided, state) => {
13+
return {
14+
...provided,
15+
borderColor: state.isFocused ? '#89b290' : 'hsl(0,0%,80%)',
16+
boxShadow: 'none',
17+
'&:hover': {
18+
borderColor: state.isFocused ? '#89b290' : '#dddddd'
3419
}
35-
return newState;
20+
};
21+
},
22+
option: (provided, state) => {
23+
const newState = {
24+
...provided,
25+
'&:active': {
26+
backgroundColor: '#87c192'
27+
}
28+
};
29+
if (state.isSelected) {
30+
newState.backgroundColor = '#87c192';
31+
} else if (state.isFocused) {
32+
newState.backgroundColor = '#c9e5cf';
3633
}
37-
}}
38-
/>
39-
);
40-
};
34+
return newState;
35+
}
36+
}}
37+
/>
38+
);
4139

4240
export default Dropdown;

src/react/components/Icons.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ import React from 'react';
22

33
export const Github = ({ size, style = {} }) => (
44
<svg role="img"
5-
height={`${size}px`}
6-
width={`${size}px`}
7-
style={style}
8-
viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub icon</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>
5+
height={`${size}px`}
6+
width={`${size}px`}
7+
style={style}
8+
viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
9+
<title>GitHub icon</title>
10+
<path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" />
11+
</svg>
912
);
10-

src/react/installation/pages/Step1.container.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import { connect } from 'react-redux';
32
import { withRouter } from 'react-router-dom';
43
import { selectors as i18nSelectors } from '../../store/i18n';

src/react/installation/pages/Step2.container.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import { connect } from 'react-redux';
32
import { selectors as i18nSelectors } from '../../store/i18n';
43
import { actions, selectors } from '../store';

src/react/installation/pages/Step3.container.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import { connect } from 'react-redux';
32
import { selectors as i18nSelectors } from '../../store/i18n';
43
import { selectors as constantSelectors } from '../../store/constants';

src/react/installation/pages/Step4.container.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import { connect } from 'react-redux';
32
import { selectors as i18nSelectors } from '../../store/i18n';
43
import { actions, selectors } from '../store';

src/react/installation/pages/Step5.container.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import { connect } from 'react-redux';
32
import { actions, selectors } from '../store';
43
import Step2 from './Step5.component';

src/react/installation/pages/Step6.container.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import { connect } from 'react-redux';
32
import { selectors as i18nSelectors } from '../../store/i18n';
43
import { selectors as constantSelectors } from '../../store/constants';

src/react/installation/store/installation.actions.js

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import axios from 'axios';
22
import { actions as initActions } from '../../store/init';
33
import { navUtils } from '../../utils';
44
import { selectors } from '../store';
5-
import { ERROR_UPDATING_LANGUAGE, LANGUAGE_UPDATED } from "../../store/init/init.actions";
65

76
export const START_REQUEST = 'START_REQUEST';
87
export const REQUEST_ERROR = 'REQUEST_ERROR';

0 commit comments

Comments
 (0)