Closed salazarr-js closed 4 years ago
What's the content of your tsconfig.json
?
Could you please provide a reproduce repo?
@meteorlxy in this repo I specify every step I did to get the error message, maybe is not a bug, I don't know if this behavior is by design, but just following the docs I got the error. The tsconfig.json
and any .ts
files are required to the plugin to function properly
Uh, didn't try a minimal repo with this plugin, so didn't notice this behavior.
I could not figure the root cause immediately.
I guess:
tsconfig.json
files
or include
in tsconfig.json
, the "parser" will throw an error like thisNotice that, the files
or include
here has no effects. It might be ONLY part of the check.
For example, you can set files
to anything exists:
{
"files": ["screenshot.png"]
}
Although this file has nothing to do with typescript, it will pass the check of the "parser", and everything works well.
BTW, seems that the include
property does not respect non-ts files, e.g. **/*.md
š¤
nice, what I can do? add a little clarification to the documentation?
@salazarr-js It would be nice if you can help š
Uh, didn't try a minimal repo with this plugin, so didn't notice this behavior.
I could not figure the root cause immediately.
I guess:
- ts-loader requires typescript compiler
- typescript compiler will use a "parser" to parse the
tsconfig.json
- If nothing match the
files
orinclude
intsconfig.json
, the "parser" will throw an error like thisNotice that, the
files
orinclude
here has no effects. It might be ONLY part of the check.For example, you can set
files
to anything exists:{ "files": ["screenshot.png"] }
Although this file has nothing to do with typescript, it will pass the check of the "parser", and everything works well.
BTW, seems that the
include
property does not respect non-ts files, e.g.**/*.md
š¤
That 's correct, we must have something in files
or include
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Environment
"vuepress-plugin-typescript": "^0.2.0"
"vuepress": "^1.4.1"
macOS Catalina 10.15.3
Version 80.0.3987.163 (Official Build) (64-bit)
Describe the bug
After installing the plugin
vuepress-plugin-typescript
as the docs specify, I got[tsl] ERROR TS18002: The 'files' list in config file 'tsconfig.json' is empty.
Steps To Reproduce
.vuepress/config.js
export default Vue.extend({ data: () => ({ msg: 'Hello, TypeScript in Markdown!', }) });
Screenshots
Expected behavior
We can expect following the steps in the docs everything works fine out of the box.
Additional context
If I add an empty
enhanceApp.ts
in.vuepress
folder everything works fine, but I don't use it.