Skip to content

Commit

Permalink
add plugin flowtype
Browse files Browse the repository at this point in the history
  • Loading branch information
MacKentoch committed Aug 14, 2017
1 parent b78b170 commit 17a1ee9
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 52 deletions.
9 changes: 6 additions & 3 deletions .eslintrc
Expand Up @@ -6,10 +6,13 @@
"es6": true,
"jest": true
},

"plugins": ["react"],
"plugins": [
"react",
"flowtype"
],
"extends": [
"plugin:react/recommended"
"plugin:react/recommended",
"plugin:flowtype/recommended"
],
// eslint > 2.x
"parserOptions": {
Expand Down
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -53,6 +53,7 @@
"enzyme": "^2.9.1",
"enzyme-to-json": "^1.5.1",
"eslint": "^4.2.0",
"eslint-plugin-flowtype": "^2.35.0",
"eslint-plugin-react": "^7.1.0",
"expose-loader": "^0.7.3",
"express": "^4.15.3",
Expand Down Expand Up @@ -83,7 +84,8 @@
"webpack-dev-middleware": "^1.12.0",
"webpack-dev-server": "^2.6.1",
"webpack-hot-middleware": "^2.18.2",
"webpack-node-externals": "^1.6.0"
"webpack-node-externals": "^1.6.0",
"why-did-you-update": "^0.0.8"
},
"dependencies": {
"animate.css": "^3.5.2",
Expand Down
7 changes: 4 additions & 3 deletions src/app/components/animatedView/AnimatedView.js
@@ -1,10 +1,11 @@
// @flow weak

import React, { Component } from 'react';
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import { withRouter } from 'react-router-dom';

class AnimatedView extends Component {
class AnimatedView extends PureComponent {
static propTypes = {
children: PropTypes.node,
animated: PropTypes.bool
Expand Down Expand Up @@ -34,4 +35,4 @@ class AnimatedView extends Component {
}
}

export default AnimatedView;
export default withRouter(AnimatedView);
88 changes: 44 additions & 44 deletions src/app/components/notifications/Notifications.js
Expand Up @@ -6,50 +6,50 @@ import Notification from './notification/Notification';

const Notifications = () => (
<NotificationPanel>
<Notification type={'danger'}>
<span>
<strong>
Oh snap!
</strong>
Change a few things up and try submitting again.
</span>
</Notification>

<Notification type={'success'}>
<span>
<strong>
Well done!
</strong>
You successfully read this important alert message.
</span>
</Notification>

<Notification type={'info'}>
<span>
<strong>
Heads up!
</strong>
This alert needs your attention, but it's not super important.
</span>
</Notification>

<Notification type={'warning'}>
<span>
<strong>
Warning!
</strong>
Best check yo self, you're not looking too good.
</span>
</Notification>

<Notification type={'danger'}>
<span>
<strong>
Oh snap!
</strong>
Change a few things up and try submitting again.
</span>
</Notification>
<Notification type={'danger'}>
<span>
<strong>
Oh snap!
</strong>
Change a few things up and try submitting again.
</span>
</Notification>

<Notification type={'success'}>
<span>
<strong>
Well done!
</strong>
You successfully read this important alert message.
</span>
</Notification>

<Notification type={'info'}>
<span>
<strong>
Heads up!
</strong>
This alert needs your attention, but it's not super important.
</span>
</Notification>

<Notification type={'warning'}>
<span>
<strong>
Warning!
</strong>
Best check yo self, you're not looking too good.
</span>
</Notification>

<Notification type={'danger'}>
<span>
<strong>
Oh snap!
</strong>
Change a few things up and try submitting again.
</span>
</Notification>

</NotificationPanel>
);
Expand Down
14 changes: 14 additions & 0 deletions src/app/index.js
Expand Up @@ -20,6 +20,20 @@ const BootstrapedElement = document.getElementById(ELEMENT_TO_BOOTSTRAP);

injectTpEventPlugin();

/* eslint-disable no-process-env */
// if (process.env.NODE_ENV !== 'production') {
// // eslint-disable-next-line no-unused-vars,react/no-deprecated
// let createClass = React.createClass;
// Object.defineProperty(React, 'createClass', {
// set: (nextCreateClass) => {
// createClass = nextCreateClass;
// }
// });
// // eslint-disable-next-line global-require
// const { whyDidYouUpdate } = require('why-did-you-update');
// whyDidYouUpdate(React);
// }
/* eslint-enable no-process-env */

const renderApp = RootComponent => {
render(
Expand Down
1 change: 1 addition & 0 deletions webpack.dev.config.js
Expand Up @@ -97,6 +97,7 @@ const config = {
loader: 'url-loader',
options: {
limit: 100000,
publicPath: '/public/assets/',
name: '[name].[ext]'
}
}
Expand Down
1 change: 1 addition & 0 deletions webpack.production.config.js
Expand Up @@ -97,6 +97,7 @@ const config = {
loader: 'url-loader',
options: {
limit: 100000,
publicPath: '/public/assets/',
name: '[name].[ext]'
}
}
Expand Down
18 changes: 17 additions & 1 deletion yarn.lock
Expand Up @@ -2616,6 +2616,12 @@ escope@^3.6.0:
esrecurse "^4.1.0"
estraverse "^4.1.1"

eslint-plugin-flowtype@^2.35.0:
version "2.35.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.35.0.tgz#d17494f0ae8b727c632d8b9d4b4a848e7e0c04af"
dependencies:
lodash "^4.15.0"

eslint-plugin-react@^7.1.0:
version "7.1.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.1.0.tgz#27770acf39f5fd49cd0af4083ce58104eb390d4c"
Expand Down Expand Up @@ -4708,7 +4714,11 @@ lodash.uniq@^4.3.0, lodash.uniq@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"

lodash@^4.0.0, lodash@^4.1.0, lodash@^4.14.0, lodash@^4.17.2, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0, lodash@^4.6.1:
lodash@4.12.0:
version "4.12.0"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.12.0.tgz#2bd6dc46a040f59e686c972ed21d93dc59053258"

lodash@^4.0.0, lodash@^4.1.0, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.2, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0, lodash@^4.6.1:
version "4.17.4"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"

Expand Down Expand Up @@ -8097,6 +8107,12 @@ which@1, which@^1.2.12, which@^1.2.9:
dependencies:
isexe "^1.1.1"

why-did-you-update@^0.0.8:
version "0.0.8"
resolved "https://registry.yarnpkg.com/why-did-you-update/-/why-did-you-update-0.0.8.tgz#389d97dd6c147e1edbc9f5d5470d44d985c8ae38"
dependencies:
lodash "4.12.0"

wide-align@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.0.tgz#40edde802a71fea1f070da3e62dcda2e7add96ad"
Expand Down

0 comments on commit 17a1ee9

Please sign in to comment.