Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgraded eslint-config-standard-react and introduced @babel/preset-react #265

Merged
merged 1 commit into from
Feb 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion config/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ module.exports = {
'react-hot-loader/babel'
],
presets: [
'react-app'
'react-app',
['@babel/preset-react', {
'runtime': 'automatic'
}]
]
};
3 changes: 3 additions & 0 deletions config/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ module.exports = {
rules: {
'react/jsx-indent': ['error', 4],
'react/jsx-indent-props': ['error', 4],
'react/jsx-uses-react': 'off',
'react/jsx-uses-vars': 'warn',
'react/react-in-jsx-scope': 'off',
'react-hooks/exhaustive-deps': 'warn',
'react-hooks/rules-of-hooks': 'error'
},
Expand Down
3,787 changes: 1,651 additions & 2,136 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
},
"devDependencies": {
"@babel/core": "7.x.x",
"@babel/preset-react": "^7.x.x",
"@hapi/eslint-config-hapi": "^13.0.2",
"@hapi/eslint-plugin-hapi": "4.x.x",
"@hapi/hapi": "20.x.x",
Expand All @@ -60,7 +61,7 @@
"dotenv": "^8.2.0",
"error-overlay-webpack-plugin": "^0.4.1",
"eslint": "7.x.x",
"eslint-config-standard-react": "10.x.x",
"eslint-config-standard-react": "11.x.x",
"eslint-loader": "^4.0.0",
"eslint-plugin-jsx-a11y": "6.x.x",
"eslint-plugin-react": "7.x.x",
Expand Down
1 change: 0 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const React = require('react');
const T = require('prop-types');
const HotLoader = require('react-hot-loader/root');
const ReactRedux = require('react-redux');
Expand Down
1 change: 0 additions & 1 deletion src/App.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require('regenerator-runtime/runtime');

const React = require('react');
const Testing = require('@testing-library/react');
const App = require('./App');
const M = require('./middle-end');
Expand Down
2 changes: 0 additions & 2 deletions src/components/ErrorFallback.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const React = require('react');

module.exports = () => {

return (
Expand Down
1 change: 0 additions & 1 deletion src/components/Header.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const React = require('react');
const { NavLink } = require('react-router-dom');
const { default: Styled } = require('styled-components');
const { default: Typography } = require('@material-ui/core/Typography');
Expand Down
6 changes: 3 additions & 3 deletions src/components/Layout.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const React = require('react');
const { Suspense } = require('react');
const T = require('prop-types');
const Header = require('./Header');
const ErrorFallback = require('./ErrorFallback');
Expand All @@ -17,9 +17,9 @@ module.exports = ({ children, location }) => {
<Header />
<Container>
<ErrorBoundary key={location.key} FallbackComponent={ErrorFallback}>
<React.Suspense fallback={<LoadingFallback />}>
<Suspense fallback={<LoadingFallback />}>
{children}
</React.Suspense>
</Suspense>
</ErrorBoundary>
</Container>
</AppContainer>
Expand Down
2 changes: 0 additions & 2 deletions src/components/LoadingFallback.js
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
const React = require('react');

module.exports = () => <h3>Loading...</h3>;
2 changes: 0 additions & 2 deletions src/components/NotFoundPage.js
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
const React = require('react');

module.exports = () => <h3>Page not found!</h3>;
1 change: 0 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const HotLoader = require('react-hot-loader');
const React = require('react');
const ReactDOM = require('react-dom');
const M = require('./middle-end');
const App = require('./App');
Expand Down
1 change: 0 additions & 1 deletion src/routes/counter/components/CounterPage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const React = require('react');
const T = require('prop-types');
const { default: Button } = require('@material-ui/core/Button');
const { default: Typography } = require('@material-ui/core/Typography');
Expand Down
1 change: 0 additions & 1 deletion src/routes/counter/containers/CounterPage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const React = require('react');
const { useSelector } = require('react-redux');
const { useMiddleEnd } = require('strange-middle-end');
const CounterPage = require('../components/CounterPage');
Expand Down
6 changes: 3 additions & 3 deletions src/routes/helpers/not-found.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const React = require('react');
const { Component } = require('react');
const T = require('prop-types');
const { Redirect } = require('react-router-dom');

exports.CatchAllRoute = {
path: '',
render: class NotFoundCatchAll extends React.Component {
render: class NotFoundCatchAll extends Component {

static propTypes = {
location: T.shape({
Expand Down Expand Up @@ -33,7 +33,7 @@ exports.CatchAllRoute = {

exports.withNotFoundPage = (RouteComponent, NotFoundComponent) => {

return class RouteComponentWithNotFoundPage extends React.Component {
return class RouteComponentWithNotFoundPage extends Component {

static propTypes = {
location: T.shape({
Expand Down
1 change: 0 additions & 1 deletion src/routes/home/components/HomePage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const React = require('react');
const { default: Styled } = require('styled-components');
const { default: DuckImage } = require('../assets/duck.jpg');
const { default: Typography } = require('@material-ui/core/Typography');
Expand Down
4 changes: 2 additions & 2 deletions src/routes/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const React = require('react');
const { lazy: Lazy } = require('react');
const Layout = require('../components/Layout');
const NotFoundPage = require('../components/NotFoundPage');
const NotFoundHelpers = require('./helpers/not-found');
const HomePage = require('./home/components/HomePage');

const CounterPage = React.lazy(() => import('./counter/containers/CounterPage'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It didn't really bug me as-written, but this is cool too!

const CounterPage = Lazy(() => import('./counter/containers/CounterPage'));

module.exports = [
{
Expand Down