Skip to content

Next.js TypeScript Built-in Plugin Not Linting in v15.2.X #76980

@jolacdev

Description

@jolacdev

Link to the code that reproduces this issue

https://github.com/jolacdev/nextjs-ts-bug

To Reproduce

  1. Run create-next-app and fill the options for a basic setup:
npx create-next-app
What is your project named? ... nextjs-ts-bugWould you like to use TypeScript? ... YesWould you like to use ESLint? ... NoWould you like to use Tailwind CSS? ... NoWould you like your code inside a `src/` directory? ... YesWould you like to use App Router? (recommended) ... YesWould you like to use Turbopack for `next dev`? ... NoWould you like to customize the import alias (`@/*` by default)? ... No
  1. Confirm that package.json includes "next": "15.2.2".
  2. Open any component, e.g., the default src/app/page.tsx.
  3. Open the command palette (Ctrl + Shift + P), search for "TypeScript: Select TypeScript Version", and select "Use Workspace Version".
  • This creates .vscode/settings.json:
{
  "typescript.tsdk": "node_modules\\typescript\\lib"
}
  1. Add "use client" below the import statements in page.tsx.
  2. Restart the TypeScript server by (Ctrl + Shift + P) → "TypeScript: Restart TS Server".
  3. Issue: TypeScript linter does not highlight any issue related with "use client".
    Image

Current vs. Expected behavior

Current Behavior: The TypeScript built-in plugin in Next.js fails to lint files from version 15.2.0 onwards when using the workspace TypeScript version.

Expected Behavior: In Next.js 15.1.7 and earlier, the linter correctly detects TypeScript issues.

This example highlights a clean setup using create-next-app, which currently installs Next.js 15.2.2.

🔹 Note: This is only a linting issue. The environment UI errors and build errors still occur as expected.

To get the linter working correctly:

  1. Change the Next.js version in package.json to "next": "15.1.7".
  2. Reinstall dependencies by running npm install.
  3. Restart the TypeScript server by (Ctrl + Shift + P) → "TypeScript: Restart TS Server".
  4. Linter: TypeScript linter highlights the issue related with "use client".
    Image

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10 Pro
  Available memory (MB): 32719
  Available CPU cores: 12
Binaries:
  Node: 20.16.0
  npm: 10.8.1
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 15.2.2 // Latest available version is detected (15.2.2).
  eslint-config-next: N/A
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.8.2
Next.js Config:
  output: N/A

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

Linting, TypeScript

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

next dev (local)

Additional context

No response

Metadata

Metadata

Assignees

Labels

LintingRelated to `next lint` or ESLint with Next.js.TypeScriptRelated to types with Next.js.locked

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions