Skip to content
This repository was archived by the owner on Apr 11, 2019. It is now read-only.

Commit 43c254a

Browse files
committed
Feat: update eslint versions to fix issues with eslint import resolver
1 parent 21b5d04 commit 43c254a

File tree

11 files changed

+148
-207
lines changed

11 files changed

+148
-207
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ module.exports = {
1818
"rules": {
1919
"func-names": 0,
2020
"eol-last": 0,
21+
"react/no-unused-prop-types": 0,
2122
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
2223
"react/jsx-no-bind": [ 2, {
2324
"ignoreRefs": false,

app/src/components/About/index.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// @flow
2-
import React, { PropTypes } from 'react';
2+
import React from 'react';
33
import Box from 'grommet/components/Box';
44
import Paragraph from 'grommet/components/Paragraph';
55
import Article from 'grommet/components/Article';
@@ -20,7 +20,6 @@ type AboutLink = {
2020
export default function About(props: {
2121
links: AboutLink[],
2222
}) {
23-
const { links } = props;
2423
return (
2524
<Box align="center">
2625
<Article align="center" className="panel" pad="large">
@@ -41,8 +40,8 @@ export default function About(props: {
4140
</Heading>
4241
<Box align="center" pad="medium">
4342
<List>
44-
{links && links.map((link, i) =>
45-
<ListItem key={i}>
43+
{props.links && props.links.map(link =>
44+
<ListItem key={link.url}>
4645
<Anchor href={link.url}>
4746
{link.name}
4847
</Anchor>
@@ -57,4 +56,4 @@ export default function About(props: {
5756
</Article>
5857
</Box>
5958
);
60-
};
59+
}

app/src/components/Avatar/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
// @flow
2-
import React, { PropTypes } from 'react';
2+
import React from 'react';
33
import cssModules from 'react-css-modules';
44
import styles from './index.module.scss';
5+
56
const defaultAvatarUrl = 'https://github.com/RyanCCollins/cdn/blob/master/alumni-webapp/no-user.png?raw=true';
67

78
function Avatar(props: {
8-
src?: ?string,
9+
src: ?string,
910
}) {
1011
const { src } = props;
1112
const imageSrc = src || defaultAvatarUrl;
@@ -15,7 +16,7 @@ function Avatar(props: {
1516
src={imageSrc}
1617
className={styles.avatar}
1718
/>
18-
)
19-
};
19+
);
20+
}
2021

2122
export default cssModules(Avatar, styles);

app/src/components/Contributor/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* @flow */
2-
import React, { PropTypes } from 'react';
2+
import React from 'react';
33
import { Avatar } from 'components';
44
import cssModules from 'react-css-modules';
55
import Heading from 'grommet/components/Heading';
@@ -30,7 +30,7 @@ function Contributor(props: {
3030
{person.name}
3131
</Heading>
3232
<Paragraph>
33-
{`${person.bio.slice(0, 300)}`}
33+
{person.bio.slice(0, 300)}
3434
</Paragraph>
3535
<Anchor
3636
icon={<SocialGithubIcon />}
@@ -40,7 +40,7 @@ function Contributor(props: {
4040
{person.github}
4141
</Anchor>
4242
</Box>
43-
)
44-
};
43+
);
44+
}
4545

4646
export default cssModules(Contributor, styles);
Lines changed: 55 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, { PropTypes } from 'react';
1+
// @flow
2+
import React from 'react';
23
import Layer from 'grommet/components/Layer';
34
import Form from 'grommet/components/Form';
45
import FormFields from 'grommet/components/FormFields';
@@ -10,62 +11,56 @@ import Footer from 'grommet/components/Footer';
1011
import { Divider } from 'components';
1112
import error from './utils/error';
1213

13-
const WelcomeModal = ({
14-
onClose,
15-
isVisible,
16-
nameInput,
17-
onSubmit,
18-
}) => (
19-
<Layer
20-
align="center"
21-
closer
22-
hidden={!isVisible}
23-
onClose={onClose}
24-
>
25-
<Box align="center" justify="center" pad="large">
26-
<Heading align="center">
27-
What should we call you?
28-
</Heading>
29-
<Divider />
30-
<Form>
31-
<FormFields>
32-
<FormField
33-
help="What should we call you?"
34-
error={error(nameInput)}
35-
label="Enter your name"
36-
htmlFor="nameInput"
37-
>
38-
<input
39-
{...nameInput}
40-
required
41-
autoFocus
42-
placeholder="Ryan Collins"
43-
id="nameInput"
44-
autoComplete="on"
45-
name="name"
46-
type="text"
47-
aria-invalid={nameInput.error}
48-
aria-required
49-
className="input"
50-
/>
51-
</FormField>
52-
</FormFields>
53-
</Form>
54-
<Footer align="center" justify="center" pad="large">
55-
<Button primary label="Submit" onClick={onSubmit} />
56-
</Footer>
57-
</Box>
58-
</Layer>
59-
);
60-
61-
WelcomeModal.propTypes = {
62-
onClose: PropTypes.func.isRequired,
63-
nameInput: PropTypes.shape({
64-
error: PropTypes.string,
65-
value: PropTypes.string,
66-
}),
67-
isVisible: PropTypes.bool.isRequired,
68-
onSubmit: PropTypes.func.isRequired,
69-
};
70-
71-
export default WelcomeModal;
14+
export default function WelcomeModal(props: {
15+
onClose: Function,
16+
nameInput: {
17+
error: ?string,
18+
value: ?string,
19+
},
20+
isVisible: boolean,
21+
onSubmit: Function,
22+
}) {
23+
const { onClose, nameInput, isVisible, onSubmit } = props;
24+
return (
25+
<Layer
26+
align="center"
27+
closer
28+
hidden={!isVisible}
29+
onClose={onClose}
30+
>
31+
<Box align="center" justify="center" pad="large">
32+
<Heading align="center">
33+
What should we call you?
34+
</Heading>
35+
<Divider />
36+
<Form>
37+
<FormFields>
38+
<FormField
39+
help="What should we call you?"
40+
error={error(nameInput)}
41+
label="Enter your name"
42+
htmlFor="nameInput"
43+
>
44+
<input
45+
{...nameInput}
46+
required
47+
autoFocus
48+
placeholder="Ryan Collins"
49+
id="nameInput"
50+
autoComplete="on"
51+
name="name"
52+
type="text"
53+
aria-invalid={nameInput.error}
54+
aria-required
55+
className="input"
56+
/>
57+
</FormField>
58+
</FormFields>
59+
</Form>
60+
<Footer align="center" justify="center" pad="large">
61+
<Button primary label="Submit" onClick={onSubmit} />
62+
</Footer>
63+
</Box>
64+
</Layer>
65+
);
66+
}

app/src/containers/LandingContainer/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ class LandingContainer extends Component {
124124
justify="center"
125125
masonry
126126
>
127-
{contributors.map((person, i) =>
128-
<Contributor key={i} person={person} />,
127+
{contributors.map(person =>
128+
<Contributor key={person.name} person={person} />,
129129
)}
130130
</Columns>
131131
</Section>
@@ -149,15 +149,15 @@ LandingContainer.propTypes = {
149149
isLoading: PropTypes.bool.isRequired,
150150
isShowingModal: PropTypes.bool.isRequired,
151151
fields: PropTypes.object.isRequired, // eslint-disable-line
152-
name: PropTypes.string,
152+
name: PropTypes.string.isRequired,
153153
contributors: PropTypes.arrayOf(
154154
PropTypes.shape({
155155
name: PropTypes.string.isRequired,
156156
github: PropTypes.string.isRequired,
157157
bio: PropTypes.string.isRequired,
158158
avatar: PropTypes.string.isRequired,
159159
}),
160-
),
160+
).isRequired,
161161
};
162162

163163
// mapStateToProps :: {State} -> {Props}

app/src/reducers.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ import { reducer as formReducer } from 'redux-form';
44
import client from './apolloClient';
55

66
/* GENERATOR: Import all of your reducers */
7-
import test from './containers/Test/reducer';
87
import landing from './containers/LandingContainer/reducer';
98
import app from './containers/AppContainer/reducer';
109

1110
const rootReducer = combineReducers({
1211
app,
1312
/* GENERATOR: Compile all of your reducers */
14-
test,
1513
landing,
1614
routing: routerReducer,
1715
form: formReducer,

app/src/store.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,17 @@ import { UserAuthWrapper as userAuthWrapper } from 'redux-auth-wrapper';
66
import rootReducer from './reducers';
77
import client from './apolloClient';
88
/* GENERATOR: Import all of your initial state */
9-
import { initialState as test } from './containers/Test/reducer';
109
import { initialState as landing } from './containers/LandingContainer/reducer';
1110
import { initialState as app } from './containers/AppContainer/reducer';
1211

1312
const initialState = {
1413
/* GENERATOR: Compile all of your initial state */
15-
test,
1614
app,
1715
landing,
1816
};
1917

2018
/* Commonly used middlewares and enhancers */
2119
/* See: http://redux.js.org/docs/advanced/Middleware.html*/
22-
2320
const routingMiddleware = routerMiddleware(browserHistory);
2421
const middlewares = [thunk, routingMiddleware, client.middleware()];
2522

@@ -32,9 +29,6 @@ if (isDeveloping && isClient) {
3229
middlewares.push(loggerMiddleware);
3330
}
3431

35-
/* Everyone should use redux dev tools */
36-
/* https://github.com/gaearon/redux-devtools */
37-
/* https://medium.com/@meagle/understanding-87566abcfb7a */
3832
const enhancers = [];
3933
if (isClient && isDeveloping) {
4034
const devToolsExtension = window.devToolsExtension;
@@ -48,10 +42,6 @@ const composedEnhancers = compose(
4842
...enhancers,
4943
);
5044

51-
/* Hopefully by now you understand what a store is and how redux uses them,
52-
* But if not, take a look at: https://github.com/reactjs/redux/blob/master/docs/api/createStore.md
53-
* And https://egghead.io/lessons/javascript-redux-implementing-store-from-scratch
54-
*/
5545
const store = createStore(
5646
rootReducer,
5747
initialState,

app/styles/styles.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
<div className="my-style" />
1212
*/
1313

14+
* {
15+
box-sizing: border-box;
16+
}
17+
1418
html {
1519
overflow-x: hidden;
1620
}

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,12 @@
9292
"react",
9393
"webpack",
9494
"sass",
95-
"css modules"
95+
"css modules",
96+
"grommet"
9697
],
9798
"engines": {
98-
"node": "5.2.0",
99-
"npm": "3.10.7"
99+
"node": "6.9.4",
100+
"npm": "3.10.10"
100101
},
101102
"author": "Ryan Collins",
102103
"license": "MIT",
@@ -156,7 +157,7 @@
156157
"devDependencies": {
157158
"autoprefixer": "^6.5.1",
158159
"babel-core": "^6.3.15",
159-
"babel-eslint": "^6.0.4",
160+
"babel-eslint": "^7.1.1",
160161
"babel-jest": "^18.0.0",
161162
"babel-loader": "^6.2.0",
162163
"babel-plugin-webpack-alias": "^2.1.1",
@@ -173,6 +174,7 @@
173174
"eslint-loader": "^1.1.1",
174175
"eslint-plugin-graphql": "^0.4.0",
175176
"eslint-plugin-import": "^2.2.0",
177+
"eslint-import-resolver-webpack": "0.8.0",
176178
"eslint-plugin-jsx-a11y": "^4.0.0",
177179
"eslint-plugin-react": "^6.9.0",
178180
"expect-jsx": "^2.6.0",
@@ -194,7 +196,6 @@
194196
"webpack": "2.1.0-beta.19",
195197
"webpack-dev-server": "2.1.0-beta.3",
196198
"webpack-hot-middleware": "^2.10.0",
197-
"webpack-manifest-plugin": "^1.1.0",
198-
"webpack-visualizer-plugin": "^0.1.5"
199+
"webpack-manifest-plugin": "^1.1.0"
199200
}
200201
}

0 commit comments

Comments
 (0)