Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Symlinks cause parserOptions.project errors #2987

Open
Labels
accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workinghelp wantedExtra attention is neededpackage: typescript-estreeIssues related to @typescript-eslint/typescript-estree
@nikparo

Description

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

Repro

https://github.com/nikparo/ts-eslint-symlinks

Expected Result

The targeted directories and files should be linted, whether or not there are symlinks elsewhere pointing at them.

Actual Result

If there is a symlink somewhere pointing at a directory, then linting it will throwParsing error: "parserOptions.project" has been set for @typescript-eslint/parser. errors. At least if the symlink alphabetically comes before the directory.

> ts-eslint-symlinks@0.0.0 lint /Users/nik/Projects/tmp/ts-eslint-symlinks> eslint libs/symlinked-lib/**/*.ts  typescript-eslint:typescript-estree:parser parserOptions.project (excluding ignored) matched projects: Set { '/users/nik/projects/tmp/ts-eslint-symlinks/tsconfig.base.json' } +0ms  typescript-eslint:typescript-estree:createProjectProgram Creating project program for: /Users/nik/Projects/tmp/ts-eslint-symlinks/libs/symlinked-lib/src/index.ts +0ms  typescript-eslint:typescript-estree:createWatchProgram File did not belong to any existing programs, moving to create/update. /users/nik/projects/tmp/ts-eslint-symlinks/libs/symlinked-lib/src/index.ts +0ms  typescript-eslint:typescript-estree:createWatchProgram Creating watch program for /users/nik/projects/tmp/ts-eslint-symlinks/tsconfig.base.json. +0ms/Users/nik/Projects/tmp/ts-eslint-symlinks/libs/symlinked-lib/src/index.ts  0:0  error  Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.The file does not match your project config: libs/symlinked-lib/src/index.ts.The file must be included in at least one of the projects provided

By deleting the symlinkapps/legacy-app/libs (which points atlibs) the errors go away. Whether the symlink is ignored or not usingignorePatterns does not seem to matter.

Additional Info

I believe I have tracked this down to the use ofupdatedProgram.getRootFileNames() increateWatchProgram.js. That method call seems to only get the first instance of a symlinked file. I.e.apps/legacy-app/libs/symlinked-lib/src/index.ts will be in the returnedfileList, butlibs/symlinked-lib/src/index.ts will not.

Versions

packageversion
@typescript-eslint/typescript-estree4.14.1
TypeScript4.1.3
nodev12.20.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workinghelp wantedExtra attention is neededpackage: typescript-estreeIssues related to @typescript-eslint/typescript-estree

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp