Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript Language Server Plugin #13

Closed
nwetzel22 opened this issue Mar 1, 2023 · 7 comments
Closed

TypeScript Language Server Plugin #13

nwetzel22 opened this issue Mar 1, 2023 · 7 comments

Comments

@nwetzel22
Copy link

A TSLS plugin would complement this tool well. Is there any intention of making one?

Plugin Guide

I've started working on one but just wanted to make sure it wasn't already in work.

@Gelio
Copy link
Owner

Gelio commented Mar 2, 2023

Hey, thanks for the idea! If I understand it right, you want a TS plugin that would automatically skip these errors so you would see the filtered errors in your IDE?

I didn't have any plans on creating such a plugin, and I don't have the bandwidth right now, so feel free to create one.

Are you planning on adding it to this repository or starting a new one?

@nwetzel22
Copy link
Author

Correct. The plugin would enable your IDE to ignore all of the same errors that loose-ts-check ignores. I would like to be able to keep the intellisense errors around somewhere so that they are not completely forgotten. Perhaps a flag to change the diagnostic "level" of matched errors would be a good solution. This way the ignored errors could be reported as "warnings" or "suggestions" rather than "errors". However, I think version 1.0 of the plugin will just simply ignore them.

I was bouncing back and forth between creating a new repo and contributing to this one. I ultimately decided to go with the new repo approach because it makes it simpler to load into tsconfig.compilerOptions.plugins. I'd be happy to merge it into this repo with your help in the future if you deem it worthy.

I should have version 1.0 out shortly. I'll keep you in the loop. Thanks for creating this tool, by the way. My team has some legacy TS code that has become difficult to maintain due to our TS version (1.6) falling out of support for Visual Studio. We've been trapped from upgrading due to one specific TS "error" and this tool has pulled us out of that trap. See our dilemma here.

@Gelio
Copy link
Owner

Gelio commented Mar 2, 2023

Thanks for explaining. The plugin sounds nice, and turning the diagnostic level down in the IDE is a good idea. I'm looking forward to using it

A separate repository sounds good. It would be great to reuse the same format of JSON files that loose-ts-check uses so we could have a small "ecosystem" of related projects that use these files as source of truth.

@nwetzel22
Copy link
Author

nwetzel22 commented Mar 2, 2023

The plugin reads the JSON file outputs generated by loose-ts-check :). The advantage we would get by combining the repos would be the use of some of the utility classes in your repo. I'm currently borrowing read-json-array and it would be nice to not have a duplicate of that. I guess those reusable methods could be exported from loose-ts-check as well to allow separate repos with some shared code.

Another idea that came to mind is a loose-ts-check-config.json to store ignored-error-codes and loosely-type-checked-files inputs so that paths to these files can be read from a single location for any tools that need to use them. I currently have these flags implemented in the plugin as well so the user would have to tell the plugin where these files are (if they deviate from the defaults).

@Gelio
Copy link
Owner

Gelio commented Mar 2, 2023

Great! I agree, all of these would be welcome additions to this repo and I'd be glad to review the code for them. I could also implement them myself but definitely not in March, as it's a bit busy for me now

@nwetzel22
Copy link
Author

The first version of the plugin has been published. I've only tested it with VS Code. Visual Studio doesn't appear to support the plugins, though I made a request for it. I haven't tried other editors. Let me know if you have a chance to test it out.

https://www.npmjs.com/package/loose-ts-check-plugin

@Gelio Gelio closed this as completed in 0ab08cf Mar 6, 2023
@Gelio
Copy link
Owner

Gelio commented Mar 6, 2023

Awesome work! Thanks for implementing it. I added a link to your plugin in the README of this repository. I believe we can close the issue now that the plugin is implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants