vercel / next-learn

Learn Next.js Starter Code
https://next-learn-dashboard.vercel.sh/
MIT License
3.8k stars 1.93k forks source link

Chapter 14 and ESLint Error defined but never used #893

Open mdmahendri opened 3 weeks ago

mdmahendri commented 3 weeks ago
> 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