Skip to content

Conversation

@simonbs
Copy link
Contributor

@simonbs simonbs commented Nov 17, 2025

Running npm run lint would give the following warning, so these changes migrate the codebase to eslint.

❯ npm run lint

> [email protected] lint
> next lint --max-warnings=0

`next lint` is deprecated and will be removed in Next.js 16.
For new projects, use create-next-app to choose your preferred linter.
For existing projects, migrate to the ESLint CLI:
npx @next/codemod@canary next-lint-to-eslint-cli .

Copilot AI review requested due to automatic review settings November 17, 2025 08:48
Copilot finished reviewing on behalf of simonbs November 17, 2025 08:51
Copy link
Contributor

Copilot AI left a 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 any with 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.

@simonbs simonbs merged commit 566ff3f into develop Nov 17, 2025
8 checks passed
@simonbs simonbs deleted the enhancement/migrate-to-es-lint branch November 17, 2025 09:07
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