mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-18 05:43:11 -05:00
Add a code fixer for --isolatedDeclarations errors (#58260)
Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
This commit is contained in:
@@ -18,6 +18,7 @@ import {
|
||||
DiagnosticWithLocation,
|
||||
FileTextChanges,
|
||||
flatMap,
|
||||
getEmitDeclarations,
|
||||
isString,
|
||||
map,
|
||||
TextChange,
|
||||
@@ -124,9 +125,15 @@ export function eachDiagnostic(context: CodeFixAllContext, errorCodes: readonly
|
||||
}
|
||||
|
||||
function getDiagnostics({ program, sourceFile, cancellationToken }: CodeFixContextBase) {
|
||||
return [
|
||||
const diagnostics = [
|
||||
...program.getSemanticDiagnostics(sourceFile, cancellationToken),
|
||||
...program.getSyntacticDiagnostics(sourceFile, cancellationToken),
|
||||
...computeSuggestionDiagnostics(sourceFile, program, cancellationToken),
|
||||
];
|
||||
if (getEmitDeclarations(program.getCompilerOptions())) {
|
||||
diagnostics.push(
|
||||
...program.getDeclarationDiagnostics(sourceFile, cancellationToken),
|
||||
);
|
||||
}
|
||||
return diagnostics;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user