Open JounQin opened 3 years ago
I can't reproduce this
So the vscode plugin will not read type-coverage
configuration from package.json
? It doesn't make sense to me.
Then I have an idea that we should provide an option which presents whether to enable this plugin's function, reading type-coverage
configuration by default.
What means when no type-coverage
configuration found, this plugin should be disabled.
The CLI read package.json
from process.cwd()
, but the vscode plugin doesn't know where is your CLI process.cwd()
.
For example in a monorepo repository, you can run type-coverage
in the root directory, or in a package directory, they have different package.json
.
A lot of tools like eslint, tslint, prettier, etc have similar situation but they are just working when they are enabled specifically.
We can find up package.json
for type-coverage
configuration from current file to top workpace folder. (Of course, cache is required for better performance)
I checked what tslint does, default tslint.json and configured tslint.json is relative to the project root(tsconfig.json) rather than top workspace folder: https://github.com/Microsoft/typescript-tslint-plugin#configuration-options
@plantain-00 I have this option enabled in vscode but still not working
I can't reproduce it.
That's weird then. I'm using a mono repo in workspace with multi projects.
Can you try https://github.com/mdx-js/eslint-mdx at https://github.com/mdx-js/eslint-mdx/blob/master/packages/eslint-mdx/src/parser.ts#L225?
Still can not reproduce it. The catch any is ignored and other any is reported.
Version(if relevant): 2.16.3
Environment(if relevant):
Code(if relevant):
Expected:
No warning reported
Actual:
Besides, this cli works correctly.