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

Support for microsoft/dtslint in typescript mode #2436

Closed
nikhilnxvverma1 opened this issue Apr 14, 2021 · 1 comment
Closed

Support for microsoft/dtslint in typescript mode #2436

nikhilnxvverma1 opened this issue Apr 14, 2021 · 1 comment

Comments

@nikhilnxvverma1
Copy link

I wanted to create a typescript declaration file editor which would report errors(red squiggles) for any code that is not allowed in an ambient context. That is to say any logical statement like if blocks, method calls, for loops etc. should be disallowed just like as in a regular *.d.ts file in VSCode.

I scoured through the documentation but couldn't find anything. Am I missing something obvious? I did however, discover dtslint (microsoft) but couldn't find a way to integrate it. If I am correct, the lint property is absent in DiagnosticsOptions of typescript's LanguageService.

I am working on a reflection system in typescript by traversing the AST of the declaration code and I need to prohibit users from writing logical statement code.

Thanks

@alexdima
Copy link
Member

From the editor's point of view, you can use monaco.editor.setModelMarkers to add new warnings or errors to a certain text model. I cannot offer any help with how to compute the markers you want to render.

I'll close this issue, but if you have specific follow up questions, we'll try to help as good as we can given the limited resources that we have.

Thanks for your understanding!

@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants