Make FormattingHost required again

This commit is contained in:
Andrew Branch
2020-05-14 14:05:32 -07:00
parent ab09d67b49
commit 90923e2050
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ namespace ts.formatting {
export interface FormatContext {
readonly options: FormatCodeSettings;
readonly getRules: RulesMap;
readonly host?: FormattingHost;
readonly host: FormattingHost;
}
export interface TextRangeWithKind<T extends SyntaxKind = SyntaxKind> extends TextRange {
+2 -2
View File
@@ -2085,9 +2085,9 @@ namespace ts {
/**
* The default is CRLF.
*/
export function getNewLineOrDefaultFromHost(host: FormattingHost | undefined, formatSettings?: FormatCodeSettings) {
export function getNewLineOrDefaultFromHost(host: FormattingHost, formatSettings?: FormatCodeSettings) {
return formatSettings?.newLineCharacter ||
host?.getNewLine?.() ||
host.getNewLine?.() ||
carriageReturnLineFeed;
}