plantain-00 / type-coverage

A CLI tool to check type coverage for typescript code
MIT License
1.21k stars 43 forks source link

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

Closed JounQin closed 3 years ago

JounQin commented 3 years ago

image

plantain-00 commented 3 years ago

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.

JounQin commented 3 years ago

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

plantain-00 commented 3 years ago

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

JounQin commented 3 years ago

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.

plantain-00 commented 3 years ago

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