🚧
Still under progress. Soon will be finished.
Description
Internal class to enqueue any error during the analysis. There are two types of errors the analyser can throw:
- Config errors: Errors because of invalid compiler options
- Syntactic/Semantic errors: Errors thrown by the TypeScript compiler when parsing the code
Methods
-
format
codeFormats syntactic and semantic errors found during the analysis
format(errors: Diagnostic[]): stringParameters
errors Diagnostic[]Returns
string:The diagnostics formatted
-
getAll
codeUsed to retrieve all the errors the analyser has encountered
getAll(): Diagnostic[]Returns
Diagnostic[]:All the errors
-
isEmpty
codeChecks whether there are errors or not
isEmpty(): booleanReturns
boolean:True if there are no errors, otherwise false
-
flatten
codeA message may be a chain of multiple messages. This helps provide better context for an error. This function flattens the chain of messages
flatten(diagnostic: Diagnostic): stringParameters
diagnostic DiagnosticThe error to flatten
Returns
string:The messages flattened
-
addOne
codeAdds a new diagnostic error
addOne(node: Node | null | undefined, message: string | DiagnosticMessageChain): voidParameters
node Node | null | undefinedThe node where the error was found
message string | DiagnosticMessageChainThe error message
Returns
void: -
addMany
codeAdds multiple syntactic/semantic errors
addMany(diagnostics: readonly Diagnostic[]): voidParameters
diagnostics readonly Diagnostic[]An array of syntactic/semantic errors
Returns
void: