Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Description
- 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
package | version |
---|---|
@typescript-eslint/typescript-estree | 4.14.1 |
TypeScript | 4.1.3 |
node | v12.20.0 |