-
Notifications
You must be signed in to change notification settings - Fork 30k
Labels
LintingRelated to `next lint` or ESLint with Next.js.Related to `next lint` or ESLint with Next.js.TypeScriptRelated to types with Next.js.Related to types with Next.js.locked
Description
Link to the code that reproduces this issue
https://github.com/jolacdev/nextjs-ts-bug
To Reproduce
- Run
create-next-appand fill the options for a basic setup:
npx create-next-app√ What is your project named? ... nextjs-ts-bug
√ Would you like to use TypeScript? ... Yes
√ Would you like to use ESLint? ... No
√ Would you like to use Tailwind CSS? ... No
√ Would you like your code inside a `src/` directory? ... Yes
√ Would you like to use App Router? (recommended) ... Yes
√ Would you like to use Turbopack for `next dev`? ... No
√ Would you like to customize the import alias (`@/*` by default)? ... No- Confirm that
package.jsonincludes"next": "15.2.2". - Open any component, e.g., the default
src/app/page.tsx. - 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"
}- Add
"use client"below theimportstatements inpage.tsx. - Restart the TypeScript server by (
Ctrl + Shift + P) → "TypeScript: Restart TS Server". - Issue: TypeScript linter does not highlight any issue related with
"use client".

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:
- Change the Next.js version in
package.jsonto"next": "15.1.7". - Reinstall dependencies by running
npm install. - Restart the TypeScript server by (
Ctrl + Shift + P) → "TypeScript: Restart TS Server". - Linter: TypeScript linter highlights the issue related with
"use client".

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/AWhich 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.Related to `next lint` or ESLint with Next.js.TypeScriptRelated to types with Next.js.Related to types with Next.js.locked