typescript - TSLint on javascript files -
i spent many hour getting work, still without success...
the question is: how use tslint on .js file?
why? i'm trying have best possible ide writing many javascript scripts, used in our internal sw.
my vision:
- i have documented typescript definitions of functions , want use them in .js.
- i want import .js file , see errors on it. tslint capable type control on .ts, according .d.ts files. on .js file, jshint/eslint can see function names , parametres .d.ts files. ok, it's not enough. there no type control in .js, i'm missing.
- use jshint/eslint tslint in same time. using few functions both, making great combo in end. (tslint types, jshint/eslint rest)
- do not allow use typescript keywords in javascript.
- autocomplete in .js .d.ts. ok, working.
i can code in vscode, sublime, netbeans.
thank ideas!
there documentation on topic in vscode docs: https://code.visualstudio.com/docs/languages/javascript
you can use https://github.com/typings/typings install type definitions. https://code.visualstudio.com/docs/languages/javascript#_intellisense-support
you can add jsconfig.json project similar tsconfig.json , set module loader commonjs , target es6 if using es2015 syntax in javascript files. https://code.visualstudio.com/docs/languages/javascript#_javascript-projects-jsconfigjson
in addition can install eslint or jshint extensions. https://code.visualstudio.com/docs/languages/javascript#_javascript-linters-eslint-jshint
Comments
Post a Comment