next-learn icon indicating copy to clipboard operation
next-learn copied to clipboard

Chapter 14 and ESLint Error defined but never used

Open mdmahendri opened this issue 1 year ago • 0 comments

  • Running pnpm lint does not output ✔ No ESLint warnings or errors but it pointed out four files containing the error
  • This error will hinder the deployment to vercel and make the build fail, which is affecting the next chapter
> next lint


./app/lib/actions.ts
58:14  Error: 'error' is defined but never used.  @typescript-eslint/no-unused-vars
93:14  Error: 'error' is defined but never used.  @typescript-eslint/no-unused-vars
107:14  Error: 'error' is defined but never used.  @typescript-eslint/no-unused-vars

./app/ui/customers/table.tsx
5:3  Error: 'CustomersTableType' is defined but never used.  @typescript-eslint/no-unused-vars

./app/ui/dashboard/latest-invoices.tsx
5:10  Error: 'LatestInvoice' is defined but never used.  @typescript-eslint/no-unused-vars

./app/ui/dashboard/revenue-chart.tsx
4:10  Error: 'Revenue' is defined but never used.  @typescript-eslint/no-unused-vars

./app/ui/login-form.tsx
5:3  Error: 'ExclamationCircleIcon' is defined but never used.  @typescript-eslint/no-unused-vars

for action.ts error we need to modify and use error param, for example output it to console like this

...
   } catch (error) {
        console.error('Error ocurred:', error);
        return {
            message: 'Database Error: Fail create',
        }
    }
...

for the other errors we need to delete the the definition in each file, because until the end of course, they're never used

mdmahendri avatar Oct 27 '24 03:10 mdmahendri