Files
AutoGPT/autogpt_platform/frontend/.prettierignore
Ubbe 86361fc1ae fix(frontend): fix all lint errors and add next/typescript (#10182)
## Changes 🏗️

### ESLint Config
1. **Disabled `react-hooks/exhaustive-deps`:** 
- to prevent unnecessary dependency proliferation and rely on code
review instead
2. **Added
[`next/typescript`](https://nextjs.org/docs/app/api-reference/config/eslint#with-typescript):**
- to the ESLint config to make sure we also have TS linting rules
3. **Added custom rule for `@typescript-eslint/no-unused-vars`:** 
- to allow underscore-prefixed variables (convention for intentionally
unused), in some cases helpful

From now on, whenever we have unused variables or imports, the `lint` CI
will fail 🔴 , thanks to `next/typescript` that adds
`typescript-eslint/no-unused-vars` 💆🏽

### Minor Fixes
- Replaced empty interfaces with type aliases to resolve
`@typescript-eslint/no-empty-object-type` warnings
- Fixed unsafe non-null assertions with proper null checks
- Removed `@ts-ignore` comments in favour of proper type casting ( _when
possible_ 🙏🏽 )

### Google Analytics Component
- Changed Next.js Script strategy from `beforeInteractive` to
`afterInteractive` to resolve Next.js warnings
- this make sure loading analytics does not block page render 🙏🏽 (
_better page load time_ )

### Are these changes safe?

As long as the Typescript compiler does not complain ( check the
`type-check` job ) we should be save. Most changes are removing unused
code, if that code would be used somewhere else the compiler should
catch it and tell us 🫶

I also typed some code when possible, or bypassed the linter when I
thought it was fair for now. I disabled a couple ESLint rules. Most
importantly the `no-explicity-any` one as we have loads of stuff untyped
yet ( _this should be improved once API types are generated for us_ ).

### DX

Added some settings on `.vscode` folder 📁 so that files will be
formatted on save and also ESLint will fix errors on save when able 💯

### 📈 **Result:**

-  All linting errors resolved
-  Improved TypeScript strict mode compliance  
-  Better developer experience with cleaner code

## Checklist 📋

#### For code changes:
- [x] I have clearly listed my changes in the PR description
- [x] I have made a test plan
- [x]  I have tested my changes according to the test plan:
  - [x] Lint CI job passes
- [x] There is not type errors ( _TS will catch issue related to these
changes_ )
2025-06-17 14:29:21 +00:00

7 lines
53 B
Plaintext

node_modules
pnpm-lock.yaml
.next
.auth
build
public