Skip to content

Bug: Inferred parserOptions.tsconfigRootDir concatenates incorrectly when a space is present in the path #11398

@matthew-plusprogramming

Description

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

Issue Description

I believe this issue may have something to do with: #11370

This was working in version 8.36.0

This is the line that I think is breaking things

Here is my stacktrace:

npm run lint

> monorepo@0.0.1 lint
> turbo run lint

turbo 2.5.4

• Packages in scope: @configs/eslint-config, @configs/ts-config, @configs/vite-config, @utils/type-utils, monorepo-cdk, node-server
• Running lint in 6 packages
• Remote caching disabled
monorepo-cdk:lint: cache miss, executing c976c864fcf47ec0
node-server:lint: cache miss, executing cf188dbd4300770e
monorepo-cdk:lint: 
node-server:lint: 
node-server:lint: 
node-server:lint: > node-server@0.0.1 lint
node-server:lint: > eslint src
node-server:lint: 
monorepo-cdk:lint: 
monorepo-cdk:lint: > monorepo-cdk@0.0.1 lint
monorepo-cdk:lint: > eslint src
monorepo-cdk:lint: 

node-server:lint: /Users/matthewlin/Desktop/Personal Projects/monorepo/src/apps/node-server/src/index.ts
node-server:lint:   0:0  error  Parsing error: error TS5012: Cannot read file 'Projects/monorepo/src/apps/node-server/tsconfig.json': ENOENT: no such file or directory, open '/Users/matthewlin/Desktop/Personal Projects/monorepo/src/apps/node-server/Projects/monorepo/src/apps/node-server/tsconfig.json'
node-server:lint: 
node-server:lint: /Users/matthewlin/Desktop/Personal Projects/monorepo/src/apps/node-server/src/vite-env.d.ts
node-server:lint:   0:0  error  Parsing error: error TS5012: Cannot read file 'Projects/monorepo/src/apps/node-server/tsconfig.json': ENOENT: no such file or directory, open '/Users/matthewlin/Desktop/Personal Projects/monorepo/src/apps/node-server/Projects/monorepo/src/apps/node-server/tsconfig.json'
node-server:lint: 
node-server:lint: ✖ 2 problems (2 errors, 0 warnings)
node-server:lint: 

monorepo-cdk:lint: /Users/matthewlin/Desktop/Personal Projects/monorepo/src/cdk/monorepo-cdk/src/constants/backend.ts
monorepo-cdk:lint:   0:0  error  Parsing error: error TS5012: Cannot read file 'Projects/monorepo/src/cdk/monorepo-cdk/tsconfig.json': ENOENT: no such file or directory, open '/Users/matthewlin/Desktop/Personal Projects/monorepo/src/cdk/monorepo-cdk/Projects/monorepo/src/cdk/monorepo-cdk/tsconfig.json'
monorepo-cdk:lint: 
monorepo-cdk:lint: /Users/matthewlin/Desktop/Personal Projects/monorepo/src/cdk/monorepo-cdk/src/index.ts
monorepo-cdk:lint:   0:0  error  Parsing error: error TS5012: Cannot read file 'Projects/monorepo/src/cdk/monorepo-cdk/tsconfig.json': ENOENT: no such file or directory, open '/Users/matthewlin/Desktop/Personal Projects/monorepo/src/cdk/monorepo-cdk/Projects/monorepo/src/cdk/monorepo-cdk/tsconfig.json'
monorepo-cdk:lint: 
monorepo-cdk:lint: /Users/matthewlin/Desktop/Personal Projects/monorepo/src/cdk/monorepo-cdk/src/stacks.ts
monorepo-cdk:lint:   0:0  error  Parsing error: error TS5012: Cannot read file 'Projects/monorepo/src/cdk/monorepo-cdk/tsconfig.json': ENOENT: no such file or directory, open '/Users/matthewlin/Desktop/Personal Projects/monorepo/src/cdk/monorepo-cdk/Projects/monorepo/src/cdk/monorepo-cdk/tsconfig.json'
monorepo-cdk:lint: 
monorepo-cdk:lint: /Users/matthewlin/Desktop/Personal Projects/monorepo/src/cdk/monorepo-cdk/src/stacks/bootstrap/index.ts
monorepo-cdk:lint:   0:0  error  Parsing error: error TS5012: Cannot read file 'Projects/monorepo/src/cdk/monorepo-cdk/tsconfig.json': ENOENT: no such file or directory, open '/Users/matthewlin/Desktop/Personal Projects/monorepo/src/cdk/monorepo-cdk/Projects/monorepo/src/cdk/monorepo-cdk/tsconfig.json'
monorepo-cdk:lint: 
monorepo-cdk:lint: /Users/matthewlin/Desktop/Personal Projects/monorepo/src/cdk/monorepo-cdk/src/stacks/my-stack/index.ts
monorepo-cdk:lint:   0:0  error  Parsing error: error TS5012: Cannot read file 'Projects/monorepo/src/cdk/monorepo-cdk/tsconfig.json': ENOENT: no such file or directory, open '/Users/matthewlin/Desktop/Personal Projects/monorepo/src/cdk/monorepo-cdk/Projects/monorepo/src/cdk/monorepo-cdk/tsconfig.json'
monorepo-cdk:lint: 
monorepo-cdk:lint: /Users/matthewlin/Desktop/Personal Projects/monorepo/src/cdk/monorepo-cdk/src/types/stack.ts
monorepo-cdk:lint:   0:0  error  Parsing error: error TS5012: Cannot read file 'Projects/monorepo/src/cdk/monorepo-cdk/tsconfig.json': ENOENT: no such file or directory, open '/Users/matthewlin/Desktop/Personal Projects/monorepo/src/cdk/monorepo-cdk/Projects/monorepo/src/cdk/monorepo-cdk/tsconfig.json'
monorepo-cdk:lint: 
monorepo-cdk:lint: /Users/matthewlin/Desktop/Personal Projects/monorepo/src/cdk/monorepo-cdk/src/utils/standard-backend.ts
monorepo-cdk:lint:   0:0  error  Parsing error: error TS5012: Cannot read file 'Projects/monorepo/src/cdk/monorepo-cdk/tsconfig.json': ENOENT: no such file or directory, open '/Users/matthewlin/Desktop/Personal Projects/monorepo/src/cdk/monorepo-cdk/Projects/monorepo/src/cdk/monorepo-cdk/tsconfig.json'
monorepo-cdk:lint: 
monorepo-cdk:lint: ✖ 7 problems (7 errors, 0 warnings)
monorepo-cdk:lint: 
npm error Lifecycle script `lint` failed with error:
npm error code 1
npm error path /Users/matthewlin/Desktop/Personal Projects/monorepo/src/apps/node-server
npm error Lifecycle script `lint` failed with error:
npm error workspace node-server@0.0.1
npm error location /Users/matthewlin/Desktop/Personal Projects/monorepo/src/apps/node-server
npm error command failed
npm error command sh -c eslint src
npm error code 1
npm error path /Users/matthewlin/Desktop/Personal Projects/monorepo/src/cdk/monorepo-cdk
npm error workspace monorepo-cdk@0.0.1
npm error location /Users/matthewlin/Desktop/Personal Projects/monorepo/src/cdk/monorepo-cdk
npm error command failed
npm error command sh -c eslint src


monorepo-cdk:lint: ERROR: command finished with error: command (/Users/matthewlin/Desktop/Personal Projects/monorepo/src/cdk/monorepo-cdk) /Users/matthewlin/.nvm/versions/node/v22.14.0/bin/npm run lint exited (1)
node-server:lint: ERROR: command finished with error: command (/Users/matthewlin/Desktop/Personal Projects/monorepo/src/apps/node-server) /Users/matthewlin/.nvm/versions/node/v22.14.0/bin/npm run lint exited (1)
monorepo-cdk#lint: command (/Users/matthewlin/Desktop/Personal Projects/monorepo/src/cdk/monorepo-cdk) /Users/matthewlin/.nvm/versions/node/v22.14.0/bin/npm run lint exited (1)
node-server#lint: command (/Users/matthewlin/Desktop/Personal Projects/monorepo/src/apps/node-server) /Users/matthewlin/.nvm/versions/node/v22.14.0/bin/npm run lint exited (1)

My

Reproduction Repository Link

https://github.com/matthew-plusprogramming/monorepo/tree/broken-version/packages/eslint-config

Repro Steps

  1. clone the repo
  2. Switch to the broken-version branch
  3. npm install
  4. npm run lint

Versions

package version
@typescript-eslint/eslint-plugin 8.37.0
@typescript-eslint/parser 8.37.0
TypeScript 5.8.3
ESLint 9.31.0
node 22.14.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions