microsoft / vscode-typescript-tslint-plugin

VS Code extension that provides TSLint support using the typescript-tslint-plugin
https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-tslint-plugin
MIT License
188 stars 35 forks source link

Support for TypeScript custom rules without transpiling to JS #105

Closed KrofDrakula closed 5 years ago

KrofDrakula commented 5 years ago

Following up from issue #131 in the deprecated plugin repository, I'm wondering if this project would consider enabling dynamic loading of TypeScript custom rules.

Currently, enabling the ts-node loader in node allows rules authored in TypeScript to be loaded directly when invoking tslint via CLI, but I haven't been able to find a way to do this for the VSCode plugin without precompiling the custom rule first.

Given that the last comment mentions being able to enable ts-node within the language server, what would it take to enable such behaviour?

mjbvz commented 5 years ago

This is not possible because the plugin is run the TypeScript server. We have no control over the node environment the server runs the plugin in

To workaround this, you could try writing a JavaScript rule that invokes ts-node on your rule.ts file

KrofDrakula commented 5 years ago

OK, compiling the rules it is, then. Thank you!