Skip to content
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

Eslint not work king for nextjs 15 + js ( without ts ) #77381

Open
mangekyo-user opened this issue Mar 21, 2025 · 0 comments
Open

Eslint not work king for nextjs 15 + js ( without ts ) #77381

mangekyo-user opened this issue Mar 21, 2025 · 0 comments
Labels
Linting Related to `next lint` or ESLint with Next.js.

Comments

@mangekyo-user
Copy link

Link to the code that reproduces this issue

https://github.com/mangekyo-user/nextjs-issue

To Reproduce

  1. Start project with yarn create next-app

  2. Would you like to use TypeScript? … [No] / Yes
    ✔ Would you like to use ESLint? … No / [Yes]
    ✔ Would you like to use Tailwind CSS? … No / [Yes]
    ✔ Would you like your code inside a src/ directory? … No / [Yes]
    ✔ Would you like to use App Router? (recommended) … No / [Yes]
    ✔ Would you like to use Turbopack for next dev? … No / [Yes]
    ✔ Would you like to customize the import alias (@/* by default)? … [No] / Yes

  3. yarn install
    At this step, nextjs keep asking for typescript

warning "eslint-config-next > @typescript-eslint/[email protected]" has unmet peer dependency "typescript@>=4.8.4 <5.9.0".
warning "eslint-config-next > @typescript-eslint/[email protected]" has unmet peer dependency "typescript@>=4.8.4 <5.9.0".
warning "eslint-config-next > @typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=4.8.4".
warning "eslint-config-next > @typescript-eslint/eslint-plugin > @typescript-eslint/[email protected]" has unmet peer dependency "typescript@>=4.8.4 <5.9.0".
warning "eslint-config-next > @typescript-eslint/parser > @typescript-eslint/[email protected]" has unmet peer dependency "typescript@>=4.8.4 <5.9.0".
warning "eslint-config-next > @typescript-eslint/eslint-plugin > @typescript-eslint/[email protected]" has unmet peer dependency "typescript@>=4.8.4 <5.9.0".

  1. yarn lint
    Error came in here

Failed to load parser '@typescript-eslint/parser' declared in ' » eslint-config-next/core-web-vitals » /Users/ductran/Documents/Testing/my-app/node_modules/eslint-config-next/index.js#overrides[0]': Cannot find module 'typescript'
Require stack:

  • /Users/ductran/Documents/Testing/my-app/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getWatchProgramsForProjects.js
  • /Users/ductran/Documents/Testing/my-app/node_modules/@typescript-eslint/typescript-estree/dist/clear-caches.js
  • /Users/ductran/Documents/Testing/my-app/node_modules/@typescript-eslint/typescript-estree/dist/index.js
  • /Users/ductran/Documents/Testing/my-app/node_modules/@typescript-eslint/parser/dist/parser.js
  • /Users/ductran/Documents/Testing/my-app/node_modules/@typescript-eslint/parser/dist/index.js
  • /Users/ductran/Documents/Testing/my-app/node_modules/@eslint/eslintrc/lib/config-array-factory.js
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Current vs. Expected behavior

The bug happen when setting the project with no typescript. If setting the project with typescript it work perfectly fine.

Provide environment information

Node : v23.8.0

Which area(s) are affected? (Select all that apply)

Linting

Which stage(s) are affected? (Select all that apply)

Other (Deployed)

Additional context

No response

@github-actions github-actions bot added the Linting Related to `next lint` or ESLint with Next.js. label Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Linting Related to `next lint` or ESLint with Next.js.
Projects
None yet
Development

No branches or pull requests

1 participant