Skip to content

Parser is looking in the wrong place for the tsconfig file #2814

Closed
@Tbhesswebber

Description

@Tbhesswebber
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro

I apologize for the size of this repro - I am in a weird spot where I am using (Narwhal Extensions)[nx.dev] with nx-electron and somehow the whole shebang has managed to cause the parser to lose track of the base tsconfig in some circumstances.

To run linting on every piece of the project, you have to run nx run-many --target lint --all --parallel (the parallel flag just speeds it all up).

This is a super greenfield POC that just got started, so it's essentially empty, but I'd be happy to jump into a chat to better understand/explain the problem in order to file a better issue with whomever the real culprit is if it's not the parser.

# error message being received (file paths are condensed)
...galvanize/apps/g-ent-e2e/src/integration/app.spec.ts
  0:0  error  Parsing error: Cannot read file '.../galvanize/node_modules/tsconfig.base.json'

Running with typescript-eslint in debug mode hasn't seemed to provide any clarity.

Expected Result

I expected the parser to look at the root of the workspace for tsconfig.base.json

Actual Result

A number of files are causing parsing errors at line 0 column 0 because the parser is looking for ./node_modules/tsconfig.base.json rather than ./tsconfig.base.json. This does not happen with all of the files.

Additional Info

There are a couple hundred more lines of output from running DEBUG=typescript-eslint:* nx run-many --target lint --all --parallel, but none seem to be concerning.

typescript-eslint:typescript-estree:createProjectProgram Creating project program for: /Users/tannerhesswebber/Documents/code/galvanize/galvanize/apps/g-ent-desktop/src/environments/environment.prod.ts +330ms
  typescript-eslint:typescript-estree:createWatchProgram Found existing program for file. /users/tannerhesswebber/documents/code/galvanize/galvanize/apps/g-ent-desktop/src/environments/environment.prod.ts +330ms
  typescript-eslint:parser:parser Resolved libs from program: [ 'es2017', 'dom' ] +329ms

/Users/tannerhesswebber/Documents/code/galvanize/galvanize/apps/g-ent-desktop/src/environments/environment.ts
  0:0  error  Parsing error: Cannot read file '/users/tannerhesswebber/documents/code/galvanize/galvanize/node_modules/tsconfig.base.json'

Versions

package version
@typescript-eslint/parser 4.3.0
TypeScript 4.0.3
ESLint 7.10.0
node (system) 12.16.3
electron 7.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpackage: typescript-estreeIssues related to @typescript-eslint/typescript-estree

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions