plantain-00 / type-coverage

A CLI tool to check type coverage for typescript code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[vscode] unexpected to be run on `.js` files

JounQin opened this issue · comments

What's your tsconfig.json?
js file can be run because typescript supports it withallowJs in tsconfig.json.
If they are in your tsconfig.json files or include but you want to ignore them, use --ignore-files.

plain js project, and in a ts project without allowJs it still warn on some js config files.

The vscode plugin can be activated by js file and jsx file because of typescript supports allowJs: https://github.com/plantain-00/type-coverage/blob/master/packages/vscode/package.json#L37-L38
Actually, the vscode typescript and typescript eslint plugin are also checking pure js project, so I think it's OK that this plugin is checking pure js project too.
屏幕快照 2021-02-23 07 45 40

This is very unexpected. It should read allowJs of tsconfig.json, if there's no tsconfig.json, it should just ignore .js files IMO.

I have to uninstall it because it's very noise for .js files now.

typescript eslint plugin are also checking pure js project

That's because you enabled it for .js explicitly in eslint config.

VSCode type check for js is controlled by a flag named javascript.validate.enable which is true by default.

js file validation now is in configuration and disabled by default.
屏幕快照 2021-02-28 12 31 17