Skip to content
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

Not working on virtual filename generated by ESLint preprocessor #3174

Closed
3 tasks done
JounQin opened this issue Mar 12, 2021 · 1 comment
Closed
3 tasks done

Not working on virtual filename generated by ESLint preprocessor #3174

JounQin opened this issue Mar 12, 2021 · 1 comment
Labels
package: parser Issues related to @typescript-eslint/parser working as intended Issues that are closed as they are working as intended

Comments

@JounQin
Copy link
Contributor

JounQin commented Mar 12, 2021

  • 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

  
```TypeScript
export type Value = 1 | 2 | 3 | 4 | 5
```
  

image

Expected Result

Work like normal ts files

Actual Result

Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: test/fixtures/code-block.md/2.ts.
The file must be included in at least one of the projects provided

Additional Info

related to eslint/eslint#11989 and prettier/eslint-plugin-prettier#393

Versions

package version
@typescript-eslint/parser 4.16.1
TypeScript 4.2.3
ESLint 7.21.0
node 12.21.0
@JounQin JounQin added package: parser Issues related to @typescript-eslint/parser triage Waiting for team members to take a look labels Mar 12, 2021
@bradzacher
Copy link
Member

bradzacher commented Mar 12, 2021

Unfortunately we cannot support this usecase.
The TypeScript APIs we use require files to exist on the disk.

The "fake" files created by pre-processors obviously are not on disk, so they cannot be included in the TypeScript program.

You'll need to configure your ESLint appropriately.

@bradzacher bradzacher added working as intended Issues that are closed as they are working as intended and removed triage Waiting for team members to take a look labels Mar 12, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: parser Issues related to @typescript-eslint/parser working as intended Issues that are closed as they are working as intended
Projects
None yet
Development

No branches or pull requests

2 participants