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

The file does not match your project config #3334

Closed
its-dibo opened this issue May 2, 2021 · 1 comment
Closed

The file does not match your project config #3334

its-dibo opened this issue May 2, 2021 · 1 comment
Labels
awaiting response Issues waiting for a reply from the OP or another party package: parser Issues related to @typescript-eslint/parser

Comments

@its-dibo
Copy link

its-dibo commented May 2, 2021

  • [ x] I have tried restarting my IDE and the issue persists.
  • [ x] I have updated to the latest version of the packages.
  • [ x] I have read the FAQ and my problem is not listed.

I set this option in .eslintrc.js file:

 parserOptions: {
    project: "tsconfig.json",
    sourceType: "module",
  }

tsconfig.json only excludes 'node_modules', which means that the file package.json is included
but when I run prettier --write . the following error occurs

/home/sh_eldeeb_2010/@eng-dibo/dibo/package.json
  0:0  error  Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: package.json.
The extension for the file (.json) is non-standard. You should add "parserOptions.extraFileExtensions" to your config

I run prettier through lint-staged

@its-dibo its-dibo added package: parser Issues related to @typescript-eslint/parser triage Waiting for maintainers to take a look labels May 2, 2021
@bradzacher
Copy link
Member

The extension for the file (.json) is non-standard. You should add "parserOptions.extraFileExtensions" to your config

I think that the last line of the error message covers it?
If you're planning on our parser to parse json files for linting, then you need to configure it as such.

@bradzacher bradzacher added awaiting response Issues waiting for a reply from the OP or another party and removed triage Waiting for maintainers to take a look labels May 2, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 3, 2021
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