Skip to content

Change stylistic ESLint TypeScript defaults #78679

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

Draft
wants to merge 1 commit into
base: canary
Choose a base branch
from

Conversation

ijjk
Copy link
Member

@ijjk ijjk commented Apr 29, 2025

As discussed stylistic ESLint defaults should not be errors they should be warnings instead as errors from ESLint should be serious as they cause builds to fail. If users want to be more strict they can make them errors themselves.

@ijjk ijjk added created-by: Next.js team PRs by the Next.js team. type: next labels Apr 29, 2025
@ijjk
Copy link
Member Author

ijjk commented Apr 29, 2025

Failing test suites

Commit: bbab6fb

pnpm test-start-turbo test/production/eslint/test/next-build-and-lint.test.ts (turbopack)

  • Next Build > production mode > first time setup with TypeScript - ESLint v8
  • Next Build > production mode > first time setup with TypeScript - ESLint v9
Expand output

● Next Build › production mode › first time setup with TypeScript - ESLint v8

Command failed: pnpm eslint --print-config pages/index.tsx

  221 |           }).toThrow('Command failed: pnpm next lint --strict')
  222 |
> 223 |           const eslintConfigAfterSetupJSON = execSync(
      |                                                      ^
  224 |             `pnpm eslint --print-config pages/index.tsx`,
  225 |             {
  226 |               cwd: next.testDir,

  at Object.<anonymous> (production/eslint/test/next-build-and-lint.test.ts:223:54)

● Next Build › production mode › first time setup with TypeScript - ESLint v9

Command failed: ESLINT_USE_FLAT_CONFIG=false pnpm eslint --print-config pages/index.tsx

  310 |           }).toThrow('Command failed: pnpm next lint --strict')
  311 |
> 312 |           const eslintConfigAfterSetupJSON = execSync(
      |                                                      ^
  313 |             // TODO(jiwon): remove `ESLINT_USE_FLAT_CONFIG=false` when we create the config for ESLint 9.
  314 |             // https://eslint.org/docs/latest/use/migrate-to-9.0.0#-new-default-config-format-eslintconfigjs
  315 |             `ESLINT_USE_FLAT_CONFIG=false pnpm eslint --print-config pages/index.tsx`,

  at Object.<anonymous> (production/eslint/test/next-build-and-lint.test.ts:312:54)

Read more about building and testing Next.js in contributing.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant