diff --git a/.babelrc b/.babelrc index 86c445f..4ffef06 100644 --- a/.babelrc +++ b/.babelrc @@ -1,3 +1,3 @@ { - "presets": ["es2015", "react"] + "presets": ["env", "react"] } diff --git a/.eslintrc b/.eslintrc index 365c9a4..1ee3fb1 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,5 +1,6 @@ { - "extends": "airbnb", + "extends": [ "airbnb-base" ], + "plugins": [ "react" ], parser: "babel-eslint", "rules": { "react/prop-types": [2], @@ -11,10 +12,12 @@ "import/namespace": 0, "import/no-unresolved": 0, "import/no-named-as-default": 2, + "import/extensions": ["off", "never"], "comma-dangle": 0, // not sure why airbnb turned this on. gross! "indent": [2, 2, {"SwitchCase": 1}], "no-console": 0, "no-alert": 0, + "no-multi-spaces": ["error", { exceptions: { "ImportDeclaration": true} }], // For import spacing "linebreak-style": 0, "react/jsx-filename-extension": 0, "arrow-body-style": 0, @@ -25,7 +28,6 @@ "react/forbid-prop-types": 0, "object-curly-spacing": 0 }, - "plugins": [ "react" ], "settings": { "import/resolve": { "moduleDirectory": ["node_modules", "src"] diff --git a/.gitignore b/.gitignore index 9774227..dbab3f8 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ npm-debug.log # Build folder dist/ +build/ diff --git a/.travis.yml b/.travis.yml index d0151b3..fdc1344 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,13 @@ language: node_js node_js: - - 5 + - 8 sudo: false cache: + yarn: true directories: - node_modules before_install: - | - npm install - npm --version + script: - npm run lint diff --git a/README.md b/README.md index 49ddad5..ba96d5d 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ web server in your machine that automatically updates the code and the styles wh ## TODO List * Tests -* Upgrade to Webpack 2.^ once stable +~~* Upgrade to Webpack 2.^ once stable ## Requirements * nodejs v5.* diff --git a/app/app.jsx b/app/app.jsx index 5441918..00c98bc 100644 --- a/app/app.jsx +++ b/app/app.jsx @@ -1,8 +1,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; -import { Router, Route, IndexRoute, browserHistory } from 'react-router'; +import { BrowserRouter, Route, Switch } from 'react-router-dom'; -// Components import Home from './components/templates/Home/Home'; import Main from './components/templates/Main/Main'; import About from './components/templates/About/About'; @@ -10,12 +9,13 @@ import About from './components/templates/About/About'; require('./_style.scss'); const App = () => ( - - - - - - + + + + + + + ); if (typeof window !== 'undefined') { diff --git a/app/components/atoms/Button/Button.jsx b/app/components/atoms/Button/Button.jsx index 34a9541..53e6c3b 100644 --- a/app/components/atoms/Button/Button.jsx +++ b/app/components/atoms/Button/Button.jsx @@ -1,4 +1,5 @@ -import React from 'react'; +import React from 'react'; +import PropTypes from 'prop-types'; require('./_style.scss'); @@ -7,7 +8,7 @@ const Button = props => ( ); Button.propTypes = { - text: React.PropTypes.string.isRequired, + text: PropTypes.string.isRequired, }; export default Button; diff --git a/app/components/atoms/Input/Input.jsx b/app/components/atoms/Input/Input.jsx index ce6c993..6cc95f7 100644 --- a/app/components/atoms/Input/Input.jsx +++ b/app/components/atoms/Input/Input.jsx @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; require('./_style.scss'); @@ -7,9 +8,9 @@ const Input = props => ( ); Input.propTypes = { - text: React.PropTypes.string, - type: React.PropTypes.string, - placeholder: React.PropTypes.string, + text: PropTypes.string, + type: PropTypes.string, + placeholder: PropTypes.string, }; export default Input; diff --git a/app/components/atoms/Label/Label.jsx b/app/components/atoms/Label/Label.jsx index 352769c..2abf84c 100644 --- a/app/components/atoms/Label/Label.jsx +++ b/app/components/atoms/Label/Label.jsx @@ -1,4 +1,5 @@ -import React from 'react'; +import React from 'react'; +import PropTypes from 'prop-types'; require('./_style.scss'); @@ -7,7 +8,7 @@ const Label = props => ( ); Label.propTypes = { - text: React.PropTypes.string.isRequired, + text: PropTypes.string.isRequired, }; export default Label; diff --git a/app/components/atoms/Paragraph/Paragraph.jsx b/app/components/atoms/Paragraph/Paragraph.jsx index fea79c6..f615d4b 100644 --- a/app/components/atoms/Paragraph/Paragraph.jsx +++ b/app/components/atoms/Paragraph/Paragraph.jsx @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; require('./_style.scss'); @@ -7,7 +8,7 @@ const Paragraph = props => ( ); Paragraph.propTypes = { - text: React.PropTypes.string.isRequired, + text: PropTypes.string.isRequired, }; export default Paragraph; diff --git a/app/components/atoms/Title/Title.jsx b/app/components/atoms/Title/Title.jsx index d05e993..9ec0622 100644 --- a/app/components/atoms/Title/Title.jsx +++ b/app/components/atoms/Title/Title.jsx @@ -1,4 +1,5 @@ -import React from 'react'; +import React from 'react'; +import PropTypes from 'prop-types'; require('./_style.scss'); @@ -7,7 +8,7 @@ const Title = props => ( ); Title.propTypes = { - text: React.PropTypes.string.isRequired, + text: PropTypes.string.isRequired, }; export default Title; diff --git a/app/components/molecules/Content/Content.jsx b/app/components/molecules/Content/Content.jsx index da70a03..aa13648 100644 --- a/app/components/molecules/Content/Content.jsx +++ b/app/components/molecules/Content/Content.jsx @@ -1,6 +1,8 @@ -import React from 'react'; -import Title from '../../atoms/Title/Title'; -import Paragraph from '../../atoms/Paragraph/Paragraph'; +import React from 'react'; +import PropTypes from 'prop-types'; + +import Title from '../../atoms/Title/Title'; +import Paragraph from '../../atoms/Paragraph/Paragraph'; require('./_style.scss'); @@ -12,8 +14,8 @@ const Content = props => ( ); Content.propTypes = { - title: React.PropTypes.string, - text: React.PropTypes.string, + title: PropTypes.string, + text: PropTypes.string, }; export default Content; diff --git a/app/components/molecules/LabeledInput/LabeledInput.jsx b/app/components/molecules/LabeledInput/LabeledInput.jsx index c603b74..5b088eb 100644 --- a/app/components/molecules/LabeledInput/LabeledInput.jsx +++ b/app/components/molecules/LabeledInput/LabeledInput.jsx @@ -1,6 +1,8 @@ -import React from 'react'; -import Label from '../../atoms/Label/Label'; -import Input from '../../atoms/Input/Input'; +import React from 'react'; +import PropTypes from 'prop-types'; + +import Label from '../../atoms/Label/Label'; +import Input from '../../atoms/Input/Input'; require('./_style.scss'); @@ -12,8 +14,8 @@ const LabeledInput = props => ( ); LabeledInput.propTypes = { - label: React.PropTypes.string.isRequired, - placeholder: React.PropTypes.string, + label: PropTypes.string.isRequired, + placeholder: PropTypes.string, }; export default LabeledInput; diff --git a/app/components/organisms/Article/Article.jsx b/app/components/organisms/Article/Article.jsx index 71d6409..54b0066 100644 --- a/app/components/organisms/Article/Article.jsx +++ b/app/components/organisms/Article/Article.jsx @@ -1,4 +1,6 @@ import React from 'react'; +import PropTypes from 'prop-types'; + import Content from '../../molecules/Content/Content'; require('./_style.scss'); @@ -11,9 +13,9 @@ const Article = props => ( ); Article.propTypes = { - image: React.PropTypes.object, - title: React.PropTypes.string.isRequired, - content: React.PropTypes.string, + image: PropTypes.object, + title: PropTypes.string.isRequired, + content: PropTypes.string, }; export default Article; diff --git a/app/components/organisms/Form/Form.jsx b/app/components/organisms/Form/Form.jsx index 5e36aec..7d343ff 100644 --- a/app/components/organisms/Form/Form.jsx +++ b/app/components/organisms/Form/Form.jsx @@ -1,21 +1,23 @@ -import React from 'react'; +import React from 'react'; +import PropTypes from 'prop-types'; + import LabeledInput from '../../molecules/LabeledInput/LabeledInput'; -import Button from '../../atoms/Button/Button'; +import Button from '../../atoms/Button/Button'; require('./_style.scss'); const Form = props => (
{ - props.fields.map((field, i) => ()) + props.fields.map((field, i) => ()) }