Skip to content

Commit

Permalink
Merge branch 'release/1.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
BigFatDog committed Jan 23, 2019
2 parents 7aad946 + 7b72dd9 commit 7feac19
Show file tree
Hide file tree
Showing 64 changed files with 16,131 additions and 18,359 deletions.
35 changes: 0 additions & 35 deletions .babelrc

This file was deleted.

85 changes: 0 additions & 85 deletions .eslintrc

This file was deleted.

89 changes: 89 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
const fs = require('fs');
const path = require('path');

const prettierOptions = JSON.parse(
fs.readFileSync(path.resolve(__dirname, '.prettierrc'), 'utf8'),
);

module.exports = {
parser: 'babel-eslint',
extends: ['airbnb', 'prettier', 'prettier/react'],
plugins: ['prettier', 'redux-saga', 'react', 'jsx-a11y'],
env: {
jest: true,
browser: true,
node: true,
es6: true,
},
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
rules: {
'prettier/prettier': ['error', prettierOptions],
'arrow-body-style': [2, 'as-needed'],
'class-methods-use-this': 0,
'comma-dangle': [2, 'always-multiline'],
'import/imports-first': 0,
'import/newline-after-import': 0,
'import/no-dynamic-require': 0,
'import/no-extraneous-dependencies': 0,
'import/no-named-as-default': 0,
'import/no-unresolved': 2,
'import/no-webpack-loader-syntax': 0,
'import/prefer-default-export': 0,
indent: [
2,
2,
{
SwitchCase: 1,
},
],
'jsx-a11y/aria-props': 2,
'jsx-a11y/heading-has-content': 0,
'jsx-a11y/label-has-associated-control': [
2,
{
// NOTE: If this error triggers, either disable it or add
// your custom components, labels and attributes via these options
// See https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/label-has-associated-control.md
controlComponents: ['Input'],
},
],
'jsx-a11y/label-has-for': 0,
'jsx-a11y/mouse-events-have-key-events': 2,
'jsx-a11y/role-has-required-aria-props': 2,
'jsx-a11y/role-supports-aria-props': 2,
'max-len': 0,
'newline-per-chained-call': 0,
'no-confusing-arrow': 0,
'no-console': 1,
'no-unused-vars': 2,
'no-use-before-define': 0,
'prefer-template': 2,
'react/destructuring-assignment': 0,
'react/jsx-closing-tag-location': 0,
'react/forbid-prop-types': 0,
'react/jsx-first-prop-new-line': [2, 'multiline'],
'react/jsx-filename-extension': 0,
'react/jsx-no-target-blank': 0,
'react/jsx-uses-vars': 2,
'react/require-default-props': 0,
'react/require-extension': 0,
'react/self-closing-comp': 0,
'react/sort-comp': 0,
'redux-saga/no-yield-in-race': 2,
'redux-saga/yield-effects': 2,
'require-yield': 0,
},
settings: {
'import/resolver': {
webpack: {
config: './internals/webpack/webpack.prod.babel.js',
},
},
},
};
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
build/
node_modules/
internals/generators/
internals/scripts/
package-lock.json
yarn.lock
package.json
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "all"
}
7 changes: 7 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"processors": ["stylelint-processor-styled-components"],
"extends": [
"stylelint-config-recommended",
"stylelint-config-styled-components"
]
}
29 changes: 29 additions & 0 deletions app/ErrorBoundary.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React, { Component } from 'react';

class ErrorBoundary extends Component {
constructor(props) {
super(props);
this.state = { hasError: false, error: null };
}

static getDerivedStateFromError(error) {
// Update state so the next render will show the fallback UI.
return { hasError: true, error };
}

componentDidCatch(error, info) {
// You can also log the error to an error reporting service
console.error(error, info);
}

render() {
if (this.state.hasError) {
// You can render any custom fallback UI
return <h1>{this.state.error}</h1>;
}

return this.props.children;
}
}

export default ErrorBoundary;
5 changes: 2 additions & 3 deletions app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { CookiesProvider } from 'react-cookie';
import { ConnectedRouter } from 'react-router-redux';
import createHistory from 'history/createBrowserHistory';
import { ConnectedRouter } from 'connected-react-router/immutable';
import history from './history';

// apollo
import { ApolloProvider } from 'react-apollo';
Expand All @@ -36,7 +36,6 @@ import './global-styles';

// Create redux store with history
const initialState = {};
const history = createHistory();
const store = configureStore(initialState, history);
const MOUNT_NODE = document.getElementById('app');

Expand Down
6 changes: 3 additions & 3 deletions app/containers/Auth/Login/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
import { instanceOf, func } from 'prop-types';
import { func } from 'prop-types';
import { connect } from 'react-redux';
import { push } from 'react-router-redux';
import { Link } from 'react-router-dom';
import { createStructuredSelector } from 'reselect';
import { compose } from 'redux';
Expand Down Expand Up @@ -171,7 +170,8 @@ class Login extends Component {
</form>
<BottomPrompt>
<FormattedMessage {...messages.registerPrompt} />
&nbsp;<Link to="/signup">
&nbsp;
<Link to="/signup">
<FormattedMessage {...messages.signUp} />
</Link>
</BottomPrompt>
Expand Down
7 changes: 4 additions & 3 deletions app/containers/Auth/SignUp/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
import { instanceOf, func } from 'prop-types';
import { func } from 'prop-types';
import { connect } from 'react-redux';
import { push } from 'react-router-redux';
import { push } from 'connected-react-router';
import { Link } from 'react-router-dom';
import { createStructuredSelector } from 'reselect';
import { compose } from 'redux';
Expand Down Expand Up @@ -198,7 +198,8 @@ class SignUp extends Component {
</form>
<BottomPrompt>
<FormattedMessage {...messages.signUpHaveAccount} />
&nbsp;<Link to={'/login'}>
&nbsp;
<Link to={'/login'}>
<FormattedMessage {...messages.signIn} />
</Link>
</BottomPrompt>
Expand Down
9 changes: 6 additions & 3 deletions app/containers/LanguageProvider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ LanguageProvider.propTypes = {
children: PropTypes.element.isRequired,
};

const mapStateToProps = createSelector(makeSelectLocale(), locale => ({
locale,
}));
const mapStateToProps = createSelector(
makeSelectLocale(),
locale => ({
locale,
})
);

export default connect(mapStateToProps)(LanguageProvider);
5 changes: 4 additions & 1 deletion app/containers/LanguageProvider/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ const selectLanguage = state => state.get('language');
* Select the language locale
*/
const makeSelectLocale = () =>
createSelector(selectLanguage, languageState => languageState.get('locale'));
createSelector(
selectLanguage,
languageState => languageState.get('locale')
);

export { selectLanguage, makeSelectLocale };
4 changes: 2 additions & 2 deletions app/containers/Layout/Header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { Link } from 'react-router-dom';
import { FormattedMessage } from 'react-intl';
import { compose } from 'redux';
import { connect } from 'react-redux';
import { func, instanceOf } from 'prop-types';
import { push } from 'react-router-redux';
import { func } from 'prop-types';
import { push } from 'connected-react-router';

import messages from './messages';

Expand Down
9 changes: 6 additions & 3 deletions app/containers/LocaleToggle/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ LocaleToggle.propTypes = {
locale: PropTypes.string,
};

const mapStateToProps = createSelector(makeSelectLocale(), locale => ({
locale,
}));
const mapStateToProps = createSelector(
makeSelectLocale(),
locale => ({
locale,
})
);

export function mapDispatchToProps(dispatch) {
return {
Expand Down
5 changes: 4 additions & 1 deletion app/containers/PostList/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import { createSelector } from 'reselect';
const selectHome = state => state.get('home');

const makeSelectUsername = () =>
createSelector(selectHome, homeState => homeState.get('username'));
createSelector(
selectHome,
homeState => homeState.get('username')
);

export { selectHome, makeSelectUsername };

0 comments on commit 7feac19

Please sign in to comment.