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

Emit diagnostics for semantic validations. #10

Closed
sam-goodwin opened this issue Feb 28, 2022 · 3 comments · Fixed by #104
Closed

Emit diagnostics for semantic validations. #10

sam-goodwin opened this issue Feb 28, 2022 · 3 comments · Fixed by #104
Assignees
Projects

Comments

@sam-goodwin
Copy link
Collaborator

Implement a TypeScript Language Service Plugin which adds domain-specific diagnostics.

https://github.com/microsoft/TypeScript/wiki/Writing-a-Language-Service-Plugin

@sam-goodwin
Copy link
Collaborator Author

This will have to be an ES build plugin because a language service plugin can not fail the build since they don't run during tsc.

@sam-goodwin
Copy link
Collaborator Author

Actually, nevermind, we can use ts-morph! https://github.com/nonara/ts-patch#altering-diagnostics

@sam-goodwin sam-goodwin changed the title ESLint Plugin Compile-Time Semantic Validation of Step Functions, Appsync and Event Bridge May 26, 2022
@sam-goodwin sam-goodwin changed the title Compile-Time Semantic Validation of Step Functions, Appsync and Event Bridge Emit diagnostics for semantic validations. May 26, 2022
@sam-goodwin
Copy link
Collaborator Author

Nevermind (again!), according to https://github.com/nonara/ts-patch#notes

This alters diagnostics during emit only. If you want to alter diagnostics in your IDE as well, you'll need to create a LanguageService plugin to accompany your source transformer

We will have to do a language service plugin. In order to share validation logic between the language service plugin, I propose we have two separate compile passes:

  • validate
  • transform

They will both use the FunctionlessChecker which centralizes all of the "queries" we wish to ask of the AST. It extends TypeChecker to inherit all of TS's type checking queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Release
To do
Development

Successfully merging a pull request may close this issue.

1 participant