8000 @typescript-eslint/parser don't work properly with symlink folders · Issue #2234 · typescript-eslint/typescript-eslint · GitHub
[go: up one dir, main page]

Skip to content

@typescript-eslint/parser don't work properly with symlink folders #2234

< 8000 div class="gh-header-actions mt-0 mb-3 mb-md-2 ml-1 flex-md-order-1 flex-shrink-0 d-flex flex-items-center gap-1">
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
btd1337 opened this issue Jun 20, 2020 · 4 comments
Closed

@typescript-eslint/parser don't work properly with symlink folders #2234

btd1337 opened this issue Jun 20, 2020 · 4 comments
Labels
awaiting response Issues waiting for a reply from the OP or another party package: parser Issues related to @typescript-eslint/parser

Comments

@btd1337
Copy link
btd1337 commented Jun 20, 2020

Repro

I use a symlink from my project folder point to my home folder:

/opt/project/workspace => ~/worspace

Opening the VSCode using the symlink path ~/workspace the error always persists.

Opening VSCode using the original path: /opt/project/workspace solves the problem.

This shouldn't be an error, but for now it is.

It's important to say that I made all other issues solutions related but nothing works.

{
  "rules": {
   '@typescript-eslint/ban-ts-comment': 'warn',
   '@typescript-eslint/no-unused-vars': ['error', { args: 'none' }]
  },
  "parserOptions": {
    project: 'tsconfig.eslint.json',
    sourceType: 'module',
    ecmaVersion: 6,
  }
}
// tsconfig.eslint.json
{
	"extends": "./tsconfig.json",
	"include": [
		"./src/**/*.ts",
		"./test/**/*.ts",
	]
}
// your repro code case

Expected Result
Code below works properly:

import { Response } from 'express';

Actual Result

Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: "ANY FILE WITH IMPORT".
The file must be included in at least one of the projects provided.

Additional Info

Versions

package version
@typescript-eslint/parser ^3.2.0
TypeScript 3.9.5
ESLint 7.2.0
node 12.13.1
npm 6.14.4
@btd1337 btd1337 added package: parser Issues related to @typescript-eslint/parser triage Waiting for team members to take a look labels Jun 20, 2020
@bradzacher
Copy link
Member

Does the lint work fine from the CLI when it is in the symlinked folder? or does it only error from vscode when it's opened in the symlinked folder?

Could you please set parserOptions.debugLevel: true and dump the output?

@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 Jun 20, 2020
@btd1337
Copy link
Author
btd1337 commented Jun 21, 2020

Enabling parserOptions.debugLevel: true on my .eslintrc.js and open symlink folder:

Captura de tela de 2020-06-20 22-35-40

Open from original folder location:

Captura de tela de 2020-06-20 22-38-43

Just point error in .eslintrc because it not be included in tsconfig file.

Test it on your machine and watch the error happen.

The lint always looks for the relative path from the beginning of the original path and gives an error when it is opened by a symbolic path.

Google translate sorry.

@bradzacher
Copy link
Member

Does the lint work fine from the CLI when it is in the symlinked folder? or does it only error from vscode when it's opened in the symlinked folder?

Test it on your machine and watch the error happen.

I don't have your setup, and I don't have the bandwidth to recreate it myself right now.
So you need to help me investigate within your setup.

With the debug flag turned on, you need to get the logs out of the extension, which you can do via the "eslint: show output channel" in vscode.

@btd1337
Copy link
Author
btd1337 commented Jun 22, 2020

Yeah, lint works fine from the CLI. The bug occurs only into VSCode.

Running the command eslint: show output channel:

[Info  - 22:19:24] ESLint server stopped.
[Info  - 22:19:25] ESLint server running in node v12.8.1
[Info  - 22:19:25] ESLint server is running.
[Info  - 22:19:26] ESLint library loaded from: /opt/dev/back/node_modules/eslint/lib/api.js   // full path

I'm open in ~/project/ and eslint point to /opt/dev/back/

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
awaiting response Issues waiting for a reply from the OP or another party package: parser Issues related to @typescript-eslint/parser
Projects
None yet
Development

No branches or pull requests

2 participants
0