-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
64 changed files
with
16,131 additions
and
18,359 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | ||
}, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.