简体   繁体   中英

Is there a way to enforce type definitions in VS Code for TypeScript?

Is there a way to have VS Code highlight whenever methods don't have return types or variables don't have types etc when using Typescript? Wanting it to be stricter to enforce things.

I've come across this as an answer in an older Stack Overflow post: https://palantir.github.io/tslint/rules/typedef/

However it requires tslint and that I believe is being deprecated which may or may not explain why the plugin in the link above does not seem to function. Are there some new rules to replace this that can be placed in the tsconfig.json perhaps?

tslint已过时,现在最好的选择是打字稿,eslint ,也有关于如何从tslint迁移到eslint在于指导在这里,你可以很容易地找到相应的规则typedef

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM