From aae8eb6b82685b744adb15d3e0771ba65562a061 Mon Sep 17 00:00:00 2001 From: tkt <37575408+tktcorporation@users.noreply.github.com> Date: Mon, 10 Oct 2022 08:41:55 +0000 Subject: [PATCH] :art: rw lint --fix --- api/src/functions/auth.js | 3 ++- api/src/lib/auth.js | 1 + api/src/services/contacts/contacts.js | 3 ++- api/src/services/posts/posts.scenarios.js | 4 ++-- web/src/App.js | 2 +- web/src/Routes.js | 3 ++- web/src/components/Article/Article.stories.js | 3 +-- web/src/components/ArticleCell/ArticleCell.mock.js | 2 +- web/src/components/ArticleCell/ArticleCell.test.js | 1 + web/src/components/ArticlesCell/ArticlesCell.mock.js | 2 +- web/src/components/Post/EditPostCell/EditPostCell.js | 3 ++- web/src/components/Post/NewPost/NewPost.js | 3 ++- web/src/components/Post/Post/Post.js | 2 +- web/src/components/Post/Posts/Posts.js | 2 +- web/src/layouts/BlogLayout/BlogLayout.js | 2 +- web/src/pages/ArticlePage/ArticlePage.js | 1 + web/src/pages/ContactPage/ContactPage.js | 2 +- web/src/pages/ForgotPasswordPage/ForgotPasswordPage.js | 3 ++- web/src/pages/HomePage/HomePage.js | 1 + web/src/pages/LoginPage/LoginPage.js | 7 ++++--- web/src/pages/ResetPasswordPage/ResetPasswordPage.js | 7 ++++--- web/src/pages/SignupPage/SignupPage.js | 7 ++++--- 22 files changed, 38 insertions(+), 26 deletions(-) diff --git a/api/src/functions/auth.js b/api/src/functions/auth.js index a1a307527..0d2f817d1 100644 --- a/api/src/functions/auth.js +++ b/api/src/functions/auth.js @@ -1,6 +1,7 @@ -import { db } from 'src/lib/db' import { DbAuthHandler } from '@redwoodjs/api' +import { db } from 'src/lib/db' + export const handler = async (event, context) => { const forgotPasswordOptions = { // handler() is invoked after verifying that a user was found with the given diff --git a/api/src/lib/auth.js b/api/src/lib/auth.js index 75bea7211..a2a6b6ed9 100644 --- a/api/src/lib/auth.js +++ b/api/src/lib/auth.js @@ -1,4 +1,5 @@ import { AuthenticationError, ForbiddenError } from '@redwoodjs/graphql-server' + import { db } from './db' /** diff --git a/api/src/services/contacts/contacts.js b/api/src/services/contacts/contacts.js index 4a326ad48..6ee6a0318 100644 --- a/api/src/services/contacts/contacts.js +++ b/api/src/services/contacts/contacts.js @@ -1,6 +1,7 @@ -import { db } from 'src/lib/db' import { validate } from '@redwoodjs/api' +import { db } from 'src/lib/db' + export const contacts = () => { return db.contact.findMany() } diff --git a/api/src/services/posts/posts.scenarios.js b/api/src/services/posts/posts.scenarios.js index 3f1af4bcd..d03c8d5f6 100644 --- a/api/src/services/posts/posts.scenarios.js +++ b/api/src/services/posts/posts.scenarios.js @@ -1,10 +1,10 @@ export const standard = defineScenario({ post: { one: { - data: { title: 'String', body: 'String' } + data: { title: 'String', body: 'String' }, }, two: { - data: { title: 'String', body: 'String' } + data: { title: 'String', body: 'String' }, }, }, }) diff --git a/web/src/App.js b/web/src/App.js index e312b3579..f1b37f3e6 100644 --- a/web/src/App.js +++ b/web/src/App.js @@ -1,8 +1,8 @@ import { AuthProvider } from '@redwoodjs/auth' import { FatalErrorBoundary, RedwoodProvider } from '@redwoodjs/web' import { RedwoodApolloProvider } from '@redwoodjs/web/apollo' -import FatalErrorPage from 'src/pages/FatalErrorPage' +import FatalErrorPage from 'src/pages/FatalErrorPage' import Routes from 'src/Routes' import './scaffold.css' diff --git a/web/src/Routes.js b/web/src/Routes.js index a40632f86..91cd60e8a 100644 --- a/web/src/Routes.js +++ b/web/src/Routes.js @@ -8,8 +8,9 @@ // 'src/pages/Admin/BooksPage/BooksPage.js' -> AdminBooksPage import { Router, Route, Private, Set } from '@redwoodjs/router' -import PostsLayout from 'src/layouts/PostsLayout' + import BlogLayout from 'src/layouts/BlogLayout' +import PostsLayout from 'src/layouts/PostsLayout' const Routes = () => { return ( diff --git a/web/src/components/Article/Article.stories.js b/web/src/components/Article/Article.stories.js index 27c251f71..e941e7110 100644 --- a/web/src/components/Article/Article.stories.js +++ b/web/src/components/Article/Article.stories.js @@ -6,8 +6,7 @@ export const generated = () => { article={{ id: 1, title: 'First Post', - body: - 'Neutra tacos hot chicken prism raw denim, put a bird on it enamel pin post-ironic vape cred DIY. Street art next level umami squid. Hammock hexagon glossier 8-bit banjo. Neutra la croix mixtape echo park four loko semiotics kitsch forage chambray. Semiotics salvia selfies jianbing hella shaman. Letterpress helvetica vaporware cronut, shaman butcher YOLO poke fixie hoodie gentrify woke heirloom.', + body: 'Neutra tacos hot chicken prism raw denim, put a bird on it enamel pin post-ironic vape cred DIY. Street art next level umami squid. Hammock hexagon glossier 8-bit banjo. Neutra la croix mixtape echo park four loko semiotics kitsch forage chambray. Semiotics salvia selfies jianbing hella shaman. Letterpress helvetica vaporware cronut, shaman butcher YOLO poke fixie hoodie gentrify woke heirloom.', createdAt: '2020-01-01T12:34:56Z', }} /> diff --git a/web/src/components/ArticleCell/ArticleCell.mock.js b/web/src/components/ArticleCell/ArticleCell.mock.js index 525aaec13..1564f6d76 100644 --- a/web/src/components/ArticleCell/ArticleCell.mock.js +++ b/web/src/components/ArticleCell/ArticleCell.mock.js @@ -8,4 +8,4 @@ export const standard = () => { createdAt: '2020-01-01T12:34:56Z', }, } -}; +} diff --git a/web/src/components/ArticleCell/ArticleCell.test.js b/web/src/components/ArticleCell/ArticleCell.test.js index f27777cc4..a5323d9c8 100644 --- a/web/src/components/ArticleCell/ArticleCell.test.js +++ b/web/src/components/ArticleCell/ArticleCell.test.js @@ -1,4 +1,5 @@ import { render, screen } from '@redwoodjs/testing' + import { Loading, Empty, Failure, Success } from './ArticleCell' import { standard } from './ArticleCell.mock' diff --git a/web/src/components/ArticlesCell/ArticlesCell.mock.js b/web/src/components/ArticlesCell/ArticlesCell.mock.js index 6ea2d6b1a..d195c4d63 100644 --- a/web/src/components/ArticlesCell/ArticlesCell.mock.js +++ b/web/src/components/ArticlesCell/ArticlesCell.mock.js @@ -16,4 +16,4 @@ export const standard = () => { }, ], } -}; +} diff --git a/web/src/components/Post/EditPostCell/EditPostCell.js b/web/src/components/Post/EditPostCell/EditPostCell.js index a70715c82..2916e2ff4 100644 --- a/web/src/components/Post/EditPostCell/EditPostCell.js +++ b/web/src/components/Post/EditPostCell/EditPostCell.js @@ -1,6 +1,7 @@ +import { navigate, routes } from '@redwoodjs/router' import { useMutation } from '@redwoodjs/web' import { toast } from '@redwoodjs/web/toast' -import { navigate, routes } from '@redwoodjs/router' + import PostForm from 'src/components/Post/PostForm' export const QUERY = gql` diff --git a/web/src/components/Post/NewPost/NewPost.js b/web/src/components/Post/NewPost/NewPost.js index c5d437ccc..747945c87 100644 --- a/web/src/components/Post/NewPost/NewPost.js +++ b/web/src/components/Post/NewPost/NewPost.js @@ -1,6 +1,7 @@ +import { navigate, routes } from '@redwoodjs/router' import { useMutation } from '@redwoodjs/web' import { toast } from '@redwoodjs/web/toast' -import { navigate, routes } from '@redwoodjs/router' + import PostForm from 'src/components/Post/PostForm' const CREATE_POST_MUTATION = gql` diff --git a/web/src/components/Post/Post/Post.js b/web/src/components/Post/Post/Post.js index 59c4d3011..c4dabc24a 100644 --- a/web/src/components/Post/Post/Post.js +++ b/web/src/components/Post/Post/Post.js @@ -1,6 +1,6 @@ +import { Link, routes, navigate } from '@redwoodjs/router' import { useMutation } from '@redwoodjs/web' import { toast } from '@redwoodjs/web/toast' -import { Link, routes, navigate } from '@redwoodjs/router' const DELETE_POST_MUTATION = gql` mutation DeletePostMutation($id: Int!) { diff --git a/web/src/components/Post/Posts/Posts.js b/web/src/components/Post/Posts/Posts.js index 4c44edfaa..8494f2f7b 100644 --- a/web/src/components/Post/Posts/Posts.js +++ b/web/src/components/Post/Posts/Posts.js @@ -1,6 +1,6 @@ +import { Link, routes } from '@redwoodjs/router' import { useMutation } from '@redwoodjs/web' import { toast } from '@redwoodjs/web/toast' -import { Link, routes } from '@redwoodjs/router' import { QUERY } from 'src/components/Post/PostsCell' diff --git a/web/src/layouts/BlogLayout/BlogLayout.js b/web/src/layouts/BlogLayout/BlogLayout.js index 53dff9e43..90206400a 100644 --- a/web/src/layouts/BlogLayout/BlogLayout.js +++ b/web/src/layouts/BlogLayout/BlogLayout.js @@ -1,5 +1,5 @@ -import { Link, routes } from '@redwoodjs/router' import { useAuth } from '@redwoodjs/auth' +import { Link, routes } from '@redwoodjs/router' const BlogLayout = ({ children }) => { const { logIn, logOut, isAuthenticated, currentUser } = useAuth() diff --git a/web/src/pages/ArticlePage/ArticlePage.js b/web/src/pages/ArticlePage/ArticlePage.js index 1c1624d47..8dd042ad7 100644 --- a/web/src/pages/ArticlePage/ArticlePage.js +++ b/web/src/pages/ArticlePage/ArticlePage.js @@ -1,4 +1,5 @@ import { MetaTags } from '@redwoodjs/web' + import ArticleCell from 'src/components/ArticleCell' const ArticlePage = ({ id }) => { diff --git a/web/src/pages/ContactPage/ContactPage.js b/web/src/pages/ContactPage/ContactPage.js index 0df5e442e..1ef14876d 100644 --- a/web/src/pages/ContactPage/ContactPage.js +++ b/web/src/pages/ContactPage/ContactPage.js @@ -1,4 +1,3 @@ -import { MetaTags } from '@redwoodjs/web' import { Form, TextField, @@ -9,6 +8,7 @@ import { FormError, useForm, } from '@redwoodjs/forms' +import { MetaTags } from '@redwoodjs/web' import { useMutation } from '@redwoodjs/web' import { toast, Toaster } from '@redwoodjs/web/toast' diff --git a/web/src/pages/ForgotPasswordPage/ForgotPasswordPage.js b/web/src/pages/ForgotPasswordPage/ForgotPasswordPage.js index ffc25e697..cf5c599ac 100644 --- a/web/src/pages/ForgotPasswordPage/ForgotPasswordPage.js +++ b/web/src/pages/ForgotPasswordPage/ForgotPasswordPage.js @@ -1,9 +1,10 @@ import { useEffect, useRef } from 'react' + import { useAuth } from '@redwoodjs/auth' +import { Form, Label, TextField, Submit, FieldError } from '@redwoodjs/forms' import { navigate, routes } from '@redwoodjs/router' import { MetaTags } from '@redwoodjs/web' import { toast, Toaster } from '@redwoodjs/web/toast' -import { Form, Label, TextField, Submit, FieldError } from '@redwoodjs/forms' const ForgotPasswordPage = () => { const { isAuthenticated, forgotPassword } = useAuth() diff --git a/web/src/pages/HomePage/HomePage.js b/web/src/pages/HomePage/HomePage.js index 418ec6467..f5370260f 100644 --- a/web/src/pages/HomePage/HomePage.js +++ b/web/src/pages/HomePage/HomePage.js @@ -1,4 +1,5 @@ import { MetaTags } from '@redwoodjs/web' + import ArticlesCell from 'src/components/ArticlesCell' const HomePage = () => { diff --git a/web/src/pages/LoginPage/LoginPage.js b/web/src/pages/LoginPage/LoginPage.js index 552a0acdb..ab2a2d251 100644 --- a/web/src/pages/LoginPage/LoginPage.js +++ b/web/src/pages/LoginPage/LoginPage.js @@ -1,5 +1,7 @@ -import { Link, navigate, routes } from '@redwoodjs/router' import { useRef } from 'react' +import { useEffect } from 'react' + +import { useAuth } from '@redwoodjs/auth' import { Form, Label, @@ -8,10 +10,9 @@ import { Submit, FieldError, } from '@redwoodjs/forms' -import { useAuth } from '@redwoodjs/auth' +import { Link, navigate, routes } from '@redwoodjs/router' import { MetaTags } from '@redwoodjs/web' import { toast, Toaster } from '@redwoodjs/web/toast' -import { useEffect } from 'react' const LoginPage = () => { const { isAuthenticated, logIn } = useAuth() diff --git a/web/src/pages/ResetPasswordPage/ResetPasswordPage.js b/web/src/pages/ResetPasswordPage/ResetPasswordPage.js index 97a5a6d48..305baf629 100644 --- a/web/src/pages/ResetPasswordPage/ResetPasswordPage.js +++ b/web/src/pages/ResetPasswordPage/ResetPasswordPage.js @@ -1,8 +1,6 @@ import { useEffect, useRef, useState } from 'react' + import { useAuth } from '@redwoodjs/auth' -import { navigate, routes } from '@redwoodjs/router' -import { MetaTags } from '@redwoodjs/web' -import { toast, Toaster } from '@redwoodjs/web/toast' import { Form, Label, @@ -10,6 +8,9 @@ import { Submit, FieldError, } from '@redwoodjs/forms' +import { navigate, routes } from '@redwoodjs/router' +import { MetaTags } from '@redwoodjs/web' +import { toast, Toaster } from '@redwoodjs/web/toast' const ResetPasswordPage = ({ resetToken }) => { const { isAuthenticated, reauthenticate, validateResetToken, resetPassword } = diff --git a/web/src/pages/SignupPage/SignupPage.js b/web/src/pages/SignupPage/SignupPage.js index 852deb4c2..92d6de012 100644 --- a/web/src/pages/SignupPage/SignupPage.js +++ b/web/src/pages/SignupPage/SignupPage.js @@ -1,5 +1,7 @@ -import { Link, navigate, routes } from '@redwoodjs/router' import { useRef } from 'react' +import { useEffect } from 'react' + +import { useAuth } from '@redwoodjs/auth' import { Form, Label, @@ -8,10 +10,9 @@ import { FieldError, Submit, } from '@redwoodjs/forms' -import { useAuth } from '@redwoodjs/auth' +import { Link, navigate, routes } from '@redwoodjs/router' import { MetaTags } from '@redwoodjs/web' import { toast, Toaster } from '@redwoodjs/web/toast' -import { useEffect } from 'react' const SignupPage = () => { const { isAuthenticated, signUp } = useAuth()