Nx: Using VSCode, everytime I create a new tsx file I get an eslint error.

Created on 22 Jan 2020  路  6Comments  路  Source: nrwl/nx

_Please make sure you have read the submission guidelines before posting an issue_

Prerequisites

  • [x] I am running the latest version
  • [x] I checked the documentation (nx.dev) and found no answer
  • [x] I checked to make sure that this issue has not already been filed
  • [ ] I'm reporting the issue to the correct repository (not related to React, Angular or any dependency)

Expected Behavior

Creating a new .ts .tsx file should give no eslint errors.

Current Behavior

Everytime I create a new file, I get an eslint error and need to reload the VSCode window.

Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: /Users/username/Projects/dreamleads/apps/frontend/src/foo.tsx.
The file must be included in at least one of the projects provided.
misc bug

Most helpful comment

Thanks everyone, this seems to have been fixed in https://github.com/nrwl/nx/pull/2497

All 6 comments

I was also getting this issue and came across this https://github.com/typescript-eslint/typescript-eslint/issues/1137

From that, you can see that issue has been fixed in @typescript-eslint/[email protected]. However, the current version of NX has @typescript-eslint/parser locked to 2.3.2.

I have manually updated the version of @typescript-eslint/parser and @typescript-eslint/eslint-plugin to both be the latest version, currently 2.17.0 and with one final restart of my IDE (Webstorm, though VSCode is also affected by this) it works and I no longer get this error.

My question now is, why were these packages locked to an older version and are there any implications of bumping them to the latest?

I would guess they are locking versions in case of any breaking configuration changes and they are manually upgrading packages.

Should be a straightforward fix if there isn't anything else we are missing.

@georgewilde Thank you for the tip!

Yes had this for quite a while...temporary fix for me is to restart vscode, hope the fix is released soon.
Thanks!

as of today, restarting vscode is the only "fix" unfortunately

My question now is, why were these packages locked to an older version and are there any implications of bumping them to the latest?

We have most packages locked in case of breakages between even minor versions. Thanks for looking into this and finding the workaround. The next version (9.1) will contain this fix. Cheers!

Thanks everyone, this seems to have been fixed in https://github.com/nrwl/nx/pull/2497

Was this page helpful?
0 / 5 - 0 ratings

Related issues

about-code picture about-code  路  3Comments

olakara picture olakara  路  3Comments

markphip picture markphip  路  3Comments

danieldanielecki picture danieldanielecki  路  3Comments

MichaelWarneke picture MichaelWarneke  路  3Comments