Directives
Directives are predefined annotations that attach to the syntax nodes unlike decorators which will cary over with model is
, op is
, etc. This means any syntax node is able to have a directive(e.g alias
).
These are the available directives:
#deprecated
The deprecated directive allows marking a node and through it its type as deprecated. It takes a single argument which is the deprecation message.
Using that type will result in a deprecation warning:
Adding another #suppress
on a node that reports a deprecation warning will suppress the warning automatically.
Api
A library or emitter can check if a type was annotated with the deprecated directive using the isDeprecated
method and/or get the message using getDeprecationDetails
.
#suppress
Suppress directive allows suppressing a specific warning diagnostic. It takes 2 arguments:
- The diagnostic code to suppress
- A message to justify the suppression
Api
There is currently no exposed api to resolve suppresssions