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

Fix these errors / debugger results #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix these errors / debugger results #1

wants to merge 1 commit into from

Conversation

zuuring
Copy link
Collaborator

@zuuring zuuring commented Sep 12, 2023

@chemicalpleasures I've done first round of code review on this and a lot of the things I noticed are actually picked up with eslint debugger in places where you have empty variables and missing syntax. In total there are about 100+ errors picked up by debugger which I would resolve all of them to make your code A++ and also not cause any deployment issues.

To run eslint

Switch to this branch, do a fresh npm install to get eslint installed properly. Now from the terminal you can run the command npx eslint pages pages being the folder name you are scanning. Do this to each folder with .js / .jsx / .tsx files to scan all of your ones. Each time you fix a problem, run the eslinter again to scan to see if you're resolves. Once you no longer get any errors coming from eslint you know you're in the clear!

Here is the output from the pages folder which gives you an idea on the errors there are to resolve.

   1:17  error  'useEffect' is defined but never used                            @typescript-eslint/no-unused-vars
   2:10  error  'Button' is defined but never used                               @typescript-eslint/no-unused-vars
   3:8   error  'SendIcon' is defined but never used                             @typescript-eslint/no-unused-vars
   4:22  error  'signOut' is defined but never used                              @typescript-eslint/no-unused-vars
   5:8   error  'axios' is defined but never used                                @typescript-eslint/no-unused-vars
  13:19  error  'session' is assigned a value but never used                     @typescript-eslint/no-unused-vars
  14:16  error  'formData' is assigned a value but never used                    @typescript-eslint/no-unused-vars
  14:26  error  'setFormData' is assigned a value but never used                 @typescript-eslint/no-unused-vars
  21:15  error  'loginClick' is assigned a value but never used                  @typescript-eslint/no-unused-vars
  53:63  error  `'` can be escaped with `'`, `‘`, `'`, `’`  react/no-unescaped-entities
  53:67  error  `'` can be escaped with `'`, `‘`, `'`, `’`  react/no-unescaped-entities

/Users/erikzuuring/git/figstudios/pages/api/addCart.js
  8:57  error  'confirmed' is assigned a value but never used  @typescript-eslint/no-unused-vars

/Users/erikzuuring/git/figstudios/pages/api/addToCart.js
  3:16  error  'uuidv4' is defined but never used  @typescript-eslint/no-unused-vars

/Users/erikzuuring/git/figstudios/pages/api/checkout_sessions/[id].js
  3:27  error  'process' is not defined  no-undef

/Users/erikzuuring/git/figstudios/pages/api/checkout_sessions/index.ts
  2:8  error  'axios' is defined but never used  @typescript-eslint/no-unused-vars

/Users/erikzuuring/git/figstudios/pages/api/confirmCartBooking.js
  2:10  error  'ObjectId' is defined but never used  @typescript-eslint/no-unused-vars
  3:8   error  'Stripe' is defined but never used    @typescript-eslint/no-unused-vars
  4:16  error  'uuidv4' is defined but never used    @typescript-eslint/no-unused-vars

/Users/erikzuuring/git/figstudios/pages/api/createCart.ts
   4:16  error  'uuidv4' is defined but never used        @typescript-eslint/no-unused-vars
  16:13  error  '_id' is assigned a value but never used  @typescript-eslint/no-unused-vars

/Users/erikzuuring/git/figstudios/pages/api/deleteFromCart.js
  2:10  error  'ObjectId' is defined but never used  @typescript-eslint/no-unused-vars

/Users/erikzuuring/git/figstudios/pages/api/fetchProfile.js
  3:10  error  'getSession' is defined but never used  @typescript-eslint/no-unused-vars

/Users/erikzuuring/git/figstudios/pages/api/getBooking.js
  10:15  error  'post' is assigned a value but never used  @typescript-eslint/no-unused-vars
  14:18  error  'booking' is not defined                   no-undef

/Users/erikzuuring/git/figstudios/pages/api/getCart.js
  2:10  error  'ObjectId' is defined but never used  @typescript-eslint/no-unused-vars

/Users/erikzuuring/git/figstudios/pages/api/registerUser.js
  2:10  error  'ObjectId' is defined but never used  @typescript-eslint/no-unused-vars

/Users/erikzuuring/git/figstudios/pages/api/webhooks/index.ts
  74:39  error  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any

/Users/erikzuuring/git/figstudios/pages/cart.tsx
    2:8   error  'Link' is defined but never used                     @typescript-eslint/no-unused-vars
    8:10  error  'loadStripe' is defined but never used               @typescript-eslint/no-unused-vars
    9:10  error  'Button' is defined but never used                   @typescript-eslint/no-unused-vars
   11:5   error  'add' is defined but never used                      @typescript-eslint/no-unused-vars
   12:5   error  'eachDayOfInterval' is defined but never used        @typescript-eslint/no-unused-vars
   13:5   error  'endOfMonth' is defined but never used               @typescript-eslint/no-unused-vars
   15:5   error  'getDay' is defined but never used                   @typescript-eslint/no-unused-vars
   16:5   error  'isEqual' is defined but never used                  @typescript-eslint/no-unused-vars
   17:5   error  'isSameDay' is defined but never used                @typescript-eslint/no-unused-vars
   18:5   error  'isSameMonth' is defined but never used              @typescript-eslint/no-unused-vars
   19:5   error  'isToday' is defined but never used                  @typescript-eslint/no-unused-vars
   20:5   error  'parse' is defined but never used                    @typescript-eslint/no-unused-vars
   22:5   error  'startOfToday' is defined but never used             @typescript-eslint/no-unused-vars
   29:5   error  'cartDetails' is assigned a value but never used     @typescript-eslint/no-unused-vars
   67:19  error  'cart' is missing in props validation                react/prop-types
   67:19  error  'cart' is defined but never used                     @typescript-eslint/no-unused-vars
   67:25  error  'items' is missing in props validation               react/prop-types
   67:32  error  'userId' is missing in props validation              react/prop-types
   68:12  error  'redirecting' is assigned a value but never used     @typescript-eslint/no-unused-vars
   68:25  error  'setRedirecting' is assigned a value but never used  @typescript-eslint/no-unused-vars
   69:19  error  'session' is assigned a value but never used         @typescript-eslint/no-unused-vars
  100:54  error  '_' is defined but never used                        @typescript-eslint/no-unused-vars

/Users/erikzuuring/git/figstudios/pages/contact.tsx
   1:17   error  'useEffect' is defined but never used            @typescript-eslint/no-unused-vars
   2:10   error  'Button' is defined but never used               @typescript-eslint/no-unused-vars
   3:8    error  'SendIcon' is defined but never used             @typescript-eslint/no-unused-vars
   4:22   error  'signOut' is defined but never used              @typescript-eslint/no-unused-vars
   6:8    error  'Link' is defined but never used                 @typescript-eslint/no-unused-vars
  12:19   error  'session' is assigned a value but never used     @typescript-eslint/no-unused-vars
  21:15   error  'loginClick' is assigned a value but never used  @typescript-eslint/no-unused-vars
  61:382  error  No duplicate props allowed                       react/jsx-no-duplicate-props
  68:375  error  No duplicate props allowed                       react/jsx-no-duplicate-props
  75:358  error  No duplicate props allowed                       react/jsx-no-duplicate-props
  82:361  error  No duplicate props allowed                       react/jsx-no-duplicate-props

/Users/erikzuuring/git/figstudios/pages/profile.tsx
   3:10  error  'Box' is defined but never used                 @typescript-eslint/no-unused-vars
   3:23  error  'Divider' is defined but never used             @typescript-eslint/no-unused-vars
   3:32  error  'FormHelperText' is defined but never used      @typescript-eslint/no-unused-vars
   3:48  error  'Input' is defined but never used               @typescript-eslint/no-unused-vars
   3:55  error  'InputLabel' is defined but never used          @typescript-eslint/no-unused-vars
  12:10  error  'userId' is assigned a value but never used     @typescript-eslint/no-unused-vars
  12:18  error  'setUserId' is assigned a value but never used  @typescript-eslint/no-unused-vars

/Users/erikzuuring/git/figstudios/pages/protected.tsx
  25:7  error  'React' must be in scope when using JSX  react/react-in-jsx-scope
  26:9  error  'React' must be in scope when using JSX  react/react-in-jsx-scope
  33:5  error  'React' must be in scope when using JSX  react/react-in-jsx-scope
  34:7  error  'React' must be in scope when using JSX  react/react-in-jsx-scope
  35:7  error  'React' must be in scope when using JSX  react/react-in-jsx-scope
  36:9  error  'React' must be in scope when using JSX  react/react-in-jsx-scope

/Users/erikzuuring/git/figstudios/pages/register.tsx
  17:7    error  'username' is never reassigned. Use 'const' instead              prefer-const
  27:2    error  Unnecessary semicolon                                            no-extra-semi
  46:9    error  'handleSubmit' is assigned a value but never used                @typescript-eslint/no-unused-vars
  65:11   error  'msg' is assigned a value but never used                         @typescript-eslint/no-unused-vars
  88:116  error  `'` can be escaped with `'`, `‘`, `'`, `’`  react/no-unescaped-entities

/Users/erikzuuring/git/figstudios/pages/result.tsx
   4:10  error  'useSession' is defined but never used    @typescript-eslint/no-unused-vars
  39:38  error  'success' is missing in props validation  react/prop-types
  39:47  error  'error' is missing in props validation    react/prop-types
  39:47  error  'error' is defined but never used         @typescript-eslint/no-unused-vars

- Adds eslint debugger to catch edge cases on code review
@vercel
Copy link

vercel bot commented Sep 12, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
voidspace ✅ Ready (Inspect) Visit Preview Sep 12, 2023 10:49am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant