8000 Bug: Error with @typescript-eslint on project inside sym-linked folder · Issue #6030 · typescript-eslint/typescript-eslint · GitHub
[go: up one dir, main page]

Skip to content

Bug: Error with @typescript-eslint on project inside sym-linked folder #6030

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 tasks done
axelboc opened this issue Nov 18, 2022 · 3 comments
Closed
4 tasks done
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@axelboc
Copy link
axelboc commented Nov 18, 2022

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

Due to company policies, on my machine, my home directory (cd ~) points to /users/<username>, and /users is a symbolic link to /home. When I open a folder in VS Code located under /users, every TS file I open has the following ESLint error at the top reported by the vscode-eslint extension:

Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: ../../../../users/<username>/path-to-project/path-to/file.ts.
The file must be included in at least one of the projects provided.

When I open the same folder but from /home instead of /users, the error message disappears and the extension works as expected, which confirms that my project's TypeScript and linting configurations are correct (i.e. parserOptions.project points to the project's tsconfig.json, and the files on which the error appears are properly included by this tsconfig.json).

This issue has already been reported in #2234 but has been closed and locked without a resolution. I've also reported it in the vscode-eslint extension's repository and was told the problem came from typescript-eslint: microsoft/vscode-eslint#1543.

It is not a blocker, obviously, since I'm able to open my projects from /home instead of /users, but I think it's worth investigating given that it took me a few frustrating hours before I was able to identify the root cause. I hope this issue can save other people from experiencing this frustration.

Reproduction Repository Link

https://gitlab.esrf.fr/ui/myhdf5

Repro Steps

  1. clone the repo
  2. pnpm install
  3. open any TS file in VS Code with the vscode-eslint extension installed

Versions

package version
eslint-config-galex 4.1.7
@typescript-eslint/eslint-plugin 5.30.6
@typescript-eslint/parser 5.30.6
TypeScript 4.7.4
ESLint 8.21.0
node 16.18.0
pnpm 7.14.0
@axelboc axelboc added bug Something isn't working triage Waiting for team members to take a look labels Nov 18, 2022
@axelboc axelboc changed the title Bug: <short description of the issue> Bug: Error with @typescript-eslint on project inside sym-linked folder Nov 18, 2022
@bradzacher
Copy link
Member

If you're able to run from the CLI like in #2234 no matter the folder you're in, then I'm not sure what we can do or if it's specifically a bug within our project or not.

If it doesn't work within the IDE, but is fine with the CLI, then that suggests that there's something different about the vscode environment that doesn't play well with something within our code.

If you're not able to run in the CLI or VSCode, then probably a duplicate of #2987

Regardless - symlinks are a very rare usecase - so we'd be looking for help to investigate and fix this issue!

@bradzacher bradzacher added awaiting response Issues waiting for a reply from the OP or another party and removed triage Waiting for team members to take a look labels Nov 18, 2022
@axelboc
Copy link
Author
axelboc commented Nov 18, 2022

In the vscode-eslint issue I link to, one of the maintainers mentions they were able to replicate the issue in the CLI using absolute paths with a root symlink (as per my /users -> /home user case): microsoft/vscode-eslint#1543 (comment). I can confirm this on my end, which points to a typescript-eslint issue:

$ pnpm exec eslint /home/XXXXX/myhdf5/src/utils.ts
$ pnpm exec eslint /users/XXXXX/myhdf5/src/utils.ts

/users/XXXXX/myhdf5/src/utils.ts
  0:0  error  Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: ../../../../users/XXXXX/myhdf5/src/utils.ts.
The file must be included in at least one of the projects provided

✖ 1 problem (1 error, 0 warnings)

@bradzacher bradzacher added duplicate This issue or pull request already exists and removed awaiting response Issues waiting for a reply from the OP or another party labels Nov 22, 2022
@JoshuaKGoldberg
Copy link
Member

Since this seems to be a duplicate of #2987, I'll go ahead and close this issue. But if someone investigating #2987 finds that to be the case -or, if this issue persists after a fix for #2987 lands- then we should reopen this issue. Thanks for filing @alexboc!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 2, 2022
@JoshuaKGoldberg JoshuaKGoldberg closed this as not planned Won't fix, can't repro, duplicate, stale Aug 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants
0