-
Notifications
You must be signed in to change notification settings - Fork 2
Migrates from next lint to eslint
#614
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates the linting setup from the deprecated next lint command to the standalone ESLint CLI with a flat configuration format (eslint.config.mjs), as recommended by Next.js 16. The migration includes updating the lint script, creating a new flat config file, and addressing various ESLint violations in the codebase.
Key changes:
- New ESLint flat config file with FlatCompat for backwards compatibility with existing rules
- Fixed React hooks dependency issues by wrapping immediate executions in setTimeout
- Improved TypeScript type definitions, replacing
anywith more specific types - Optimized file decoding performance by using Uint8Array directly instead of Blob
Reviewed Changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| eslint.config.mjs | New ESLint v9 flat configuration file migrating from .eslintrc.json |
| package.json | Updated lint script to use eslint CLI instead of deprecated next lint |
| types/globals.d.ts | Improved SwaggerUIBundle type from any to function signature |
| types/@next-auth.d.ts | Removed unused NextAuth import |
| src/features/sidebar/view/SecondarySplitHeader.tsx | Fixed useEffect hook by wrapping window check in setTimeout and removing isMac from dependencies |
| src/features/projects/view/ProjectsContextProvider.tsx | Wrapped initial refresh call in setTimeout to satisfy ESLint rules |
| src/features/encrypt/view/EncryptionForm.tsx | Moved styled component outside render function to prevent recreation |
| src/features/auth/view/SignInTexts.tsx | Moved helper function and constant to module scope to prevent recreation on each render |
| src/common/utils/fileUtils.ts | Optimized file decoding by using Uint8Array directly instead of Blob/arrayBuffer |
| test/projects/GitHubRepositoryDataSource.test.ts | Changed let to const for variable that's never reassigned |
| test/common/utils/saneParseInt.test.ts | Changed @ts-ignore to @ts-expect-error for better type safety |
| test/common/github/OAuthTokenRefreshingGitHubClient.test.ts | Changed let to const for variable that's never reassigned |
| test/auth/OAuthTokenRepository.test.ts | Replaced any[] types with specific tuple types for better type safety |
| test/auth/AuthjsAccountsOAuthTokenRepository.test.ts | Replaced any[] with readonly unknown[] for better type safety |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Running
npm run lintwould give the following warning, so these changes migrate the codebase to eslint.