-
-
Notifications
You must be signed in to change notification settings - Fork 79
Closed
Description
Hi, I'm not sure if this issue belongs to this repo or eslint-plugin-vue
, but it does seem like a parsing issue.
Problem
Using VSCode, when we define global types in declaration files, those types are available in .ts
files, however in *.vue
files, eslint complains about them showing an error that says: 'XXX' is not defined.eslint(no-undef)
.
I have created a reproduction repo (branch) here.
- Clone the repo, make sure you're in
eslint-no-undef
branch and install dependencies withyarn
ornpm install
- Open project in VSCode.
- Check files
/src/types/config.d.ts
,/src/main.ts
and/src/App.vue
. As you can see, interfaceIFoo
is inferred inmain.ts
, however inApp.vue
, eslint shows an error
- Downgrade
typescript-eslint/parser
to version 3 (example 3.10.1), reload or restart VSCode, now it works without any issues.
Expected
Global types should be inferred in .vue
files just as in .ts
files using typescript-eslint/parser v4+.
rieval, NoTimeForHero, vqoph, Vannsl, yushen7 and 6 morekallepyorala, iRalph, Vannsl, zzw105 and jialef
Metadata
Metadata
Assignees
Labels
No labels