-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Known Issues
- Problems with parsing Vue SFC (False positives when using with Vue SFC #883)
-
Errors when parsing files in watch mode (/ ide plugins) (Parser reports "Parsing error" for new files added to project (VSCode) #864) -
Errors when parsing files with the same name in the same folder (Files with the same name (without extensions) are not parsable #955)
This issue will serve as a mega-thread of sorts for parsing issues.
There's a lot of people posting in various issues about the same problems, and people mixing up which issue is which.
In v2 we released a breaking change which causes the parser to hard fail for files that are not properly included within your project's tsconfig(s). This was done because we noticed that we had a huge performance issue - when we attempted to parse a file that wasn't included in an existing tsconfig, then we would have to parse that file as if it were a brand new project - including all of its dependencies. This was slow, and educating users about the correct configs was near impossible because we can only do it via looking at copy pasted configs in issue threads.
We throw an error so that you can see what files have not been included by typescript based on the config that you have provided. Chances are that you need to reconfigure your tsconfig's include
so that it properly encapsulates all of the files you want to lint. The best way to do this is written in the 2.0.0 release notes, but I'll copy it here to colocate the information:
Steps to fix this
-
Upgrade to the latest
canary
version on npm. -
Create a new config -
tsconfig.eslint.json
- which you pass into parserOptions.project. This new tsconfig shouldinclude
all of the files you want to lint, e.g.:
If you are using non standard file extensions (i.e. .vue files), you should setup your config something like the following:
{
"parserOptions": {
"extraFileExtensions": [".vue"]
}
}
FAQ
I upgraded to v2 and now I have parsing errors that I didn't have before, why?
See above. If you attempt the above steps, and it doesn't fix the errors, please respond to this post using this issue template. Comments asking for help without this template will be deleted. Please, help us to help you.
I am getting errors in my IDE (VSCode, WebStorm, etc).
First, check to make sure you can do a lint run for your entire project from the CLI (i.e. yarn eslint
). If you get errors here, then stop, and see above.
If you get no errors, then you've hit a known issue. Sit tight, we're working on a fix.
If and only if you have no errors in the CLI, and it's causing you too many headaches in your IDE, then consider adding createDefaultProgram
to your config. See the parser docs for more info. PLEASE NOTE THAT THIS IS A TEMPORARY FIX THAT SHOULD ONLY BE USED ONCE YOU HAVE NO PARSING ISSUES FROM THE CLI.
My project uses Vue SFC's, and I can't seem to get it working.
Have a look at our example for Vue SFC that we're testing against. Check that your config is the same.
If you're still seeing issues, please respond to this post using this issue template. Comments asking for help without this template will be deleted. Please, help us to help you.